Home > Uncategorized > EC2 custom Kernel

EC2 custom Kernel

One minor issue with EC2 is that they supply the kernel, and that already caused difficulties with my first EC2-tutorial – the image I created doesn’t let you create a new snapshot from a running image since the EC2 kernel lacks loopback support, and I didn’t supply a matching kernel module.

Amazon has a nice guide on how to do it – here is a gentoo-specific one.

These instructions start from a working ami image created using my previous instructions. Go ahead and mount it and chroot into the image.

  1. Install a kernel using emerge xen-sources
  2. Be sure to enable xen support in the kernel config file. Here is a working config.
  3. Build the kernel with make && make modules_install as usual
  4. Copy the kernel image to /boot as usual.
  5. Create /boot/grub/menu.lst, containing:
    default 0
    timeout 3
    title EC2
    root (hd0)
    kernel /boot/kernel root=/dev/sda1
  6. While optional you might want to clean up the kernel source directory, or even remove it – you’re paying by the gb and the sources and object files are large.
  7. Bundle it up with the instructions in the first guide, but on the ec2-bundle-vol command line add –kernel followed by a suitable kernel ID from the pdf linked above. For a 64-bit ami in the US-east region use aki‐427d952b

That’s it – upload, register, and boot it up!

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: