Created
July 19, 2010 15:26
-
-
Save godber/481551 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# rebundle.sh - Rebundles, uploads and registers an AMI. | |
# For blogpost: | |
# http://blog.crunch.io/user-managed-kernel-amis-from-existing-ubuntu | |
# Austin Godber <[email protected]> | |
if [ `id -u` != '0' -o "$AWS_USER_ID" == "" ]; then | |
echo "ERROR: You must run this with 'sudo -E' or as the root user" | |
exit 1 | |
fi | |
arch=i386 | |
prefix=testami | |
bucket=<your bucket> | |
# Uncomment this if you want to rerun. | |
#rm -rf /mnt/${prefix}* | |
ec2-bundle-vol -r $arch -d /mnt \ | |
-p $prefix \ | |
-u $AWS_USER_ID \ | |
-k /mnt/tmp/pk-*.pem \ | |
-c /mnt/tmp/cert-*.pem \ | |
-s 10240 \ | |
-e /mnt,/tmp,/root/.ssh,/home/ubuntu/.ssh \ | |
--kernel "aki-407d9529" | |
ec2-upload-bundle \ | |
-b $bucket \ | |
-m /mnt/$prefix.manifest.xml \ | |
-a $AWS_ACCESS_KEY_ID \ | |
-s $AWS_SECRET_ACCESS_KEY | |
ec2-register --name "$bucket/$prefix" $bucket/$prefix.manifest.xml | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment