update-grub needs to ignore linux-ec2 kernels
Binary package hint: grub2
I'm investigating backporting support for guest managed kernels into 10.04 guest UEC images.
Doing so would allow 10.04 guest images that were running on EC2 and 10.10 UEC hosts to run 'apt-get dist-upgrade && reboot' and boot into their new kernel. Currently, the 10.04 guests cannot manage their own kernel under either UEC or EC2.
The solution in place for 10.10 is to use grub-pc to load the kernel on UEC and legacy-grub-ec2 to load the kernel on EC2.
That same solution will almost work for 10.04. The one point of failure is that 10.04 images have 2 kernels in them (linux-ec2 and linux-virtual). Currently the linux-ec2 kernel is 22.214.171.1249.10 and linux-virtual is 126.96.36.199.27. That would mean that when update-grub runs, it will choose the linux-ec2 kernel as the newest, and, on reboot, the guest would reboot into that -ec2 kernel on UEC.
To avoid that, we need to have update-grub explicitly ignore the -ec2 kernel.
I had a discussion on this solution with cjwatson at http://
The key point of that discussion is that it will *never* be useful for the -ec2 kernel to be loaded by grub-pc. the only possible case that would occur is the future development of a grub2 based xen pv-grub.
One other bit of information, is that the upgrade path from lucid to maverick is preserved. The maverick based grub-pc do not exclude the linux-ec2, but do not need to. Maverick does not include a linux-ec2 kernel (well, it is in the archive, but not updated). Thus, when a do-release-upgrade from lucid->maverick would occur, there will be a -virtual kernel installed that will appear to maverick's grub-pc to be newest. It would be selected, and all future upgrades would have -virtual kernels that were newer than -ec2 kernel.
DistroRelease: Ubuntu 10.04
Package: grub-pc 1.98-1ubuntu7
Uname: Linux 2.6.32-309-ec2 i686
Date: Thu Nov 4 18:34:45 2010
PATH=(custom, no user)
===== SRU Information =====
* impact of the bug: In the maverick cycle, work was done to make instances launched from UEC images capable of managing their own kernel using grub-legacy-ec2 on EC2 and grub2-pc on UEC. Without those changes, lucid images are not able to manage their kernel. What that means is that an instance running in UEC cannot have a security upgrade applied to a kernel by a simple 'apt-get upgrade && reboot'.
In the lucid images, we have 2 flavors insalled (linux-ec2 and linux-virtual). The linux-ec2 version is higher than the linux-virtual version. As such, update-grub from grub-pc would select the the ec2 kernel for booting on UEC, and the instance would fail to reboot.
* how the bug has been addressed: In maverick, the linux-ec2 kernel was removed entirely. There is no '-ec2' kernel to be ignored. In lucid, the fix is to explicitly ignore kernels named '*-ec2'.
* minimal patch: The changes are available in my branch at , the diff can be seen from tip of that branch to revision 69 (current lucid-updates) .
* instructions on how to reproduce the bug:
* Run grub-install /dev/sda1 and update-grub in a uec image.
* verify that the linux-ec2 kernel is the first kernel listed in /boot/grub/grub.cfg
* regression potential: The possibility for regression is very low. There is no current situation where grub-pc would ever be intended to load an Ubuntu 'linux-ec2' kernel.
|Changed in grub2 (Ubuntu Lucid):|
|importance:||Undecided → Medium|
|status:||New → Triaged|
|Changed in grub2 (Ubuntu Lucid):|
|milestone:||none → ubuntu-10.04.2|