update-grub-legacy-ec2 fails to detect xen kernel
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
| Trusty |
Fix Released
|
Undecided
|
Unassigned | ||
| Xenial |
Fix Released
|
Medium
|
Unassigned | ||
| Yakkety |
Fix Released
|
Medium
|
Unassigned | ||
| Zesty |
Fix Released
|
Medium
|
Unassigned | ||
Bug Description
The update-
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Ignoring non-Xen Kernel on Xen domU host: vmlinuz-
Found kernel: /boot/vmlinuz-
Updating /boot/grub/menu.lst ... done
This has been fixed on grub-legacy. Instead of matching the kernel name, it checks the config for CONFIG_XEN=y. In addition, Linux kernels come with CONFIG_XEN=y by default for some time now, and it is perfectly safe to run a Xen-capable kernel on non-Xen hosts.
Steps to reproduce:
1. Compile and generate debs for custom kernel with version string not including '-generic' or '-virtual'
2. Install debs on ec2 system (ami-a94e0c99)
3. Reboot
Expected results:
System comes up with new kernel
Actual results:
System comes up with old kernel, and new kernel is not present in /boot/grub/menu.lst
Impact:
Running ami-a94e0c99, and likely many others, a user can not install a custom kernel without manually editing files. Furthermore, those writes will likely be overwritten by administrative operations in the future.
Recommendation:
Update detection logic to search for CONFIG_XEN=y in the kernel config, and remove version string detection.
Please let me know how I can help this along. I can submit a proposed fix, but am not sure where to send it.
Related bugs:
* bug 1655934: update-
Related branches
- Dan Watkins: Needs Fixing
- cloud-init Commiters: Pending requested
-
Diff: 38 lines (+18/-0) 1 file modifiedapidebian/update-grub-legacy-ec2 (+18/-0)
fwiw, if you put an executable program 'is_xen_kernel' anywhere in PATH when update-
So, to make this work without any protection is just like:
ln -s /usr/bin/
Hello evan2645, or anyone else affected,
Accepted cloud-init into xenial-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
Hello evan2645, or anyone else affected,
Accepted cloud-init into xenial-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
## launched a xenial instance
$ cat /etc/cloud/
build_name: server
serial: 20170207
## Enable proposed
$ rel=$(lsb_release -sc)
$ line=$(awk '1ドル == "deb" && 2ドル ~ /ubuntu.com/ {
printf("%s %s %s-proposed main universe\n", 1,ドル 2,ドル rel); exit(0) };
' "rel=$rel" /etc/apt/
$ echo "$line" | sudo tee /etc/apt/
$ sudo apt-get update -qy
$ sudo apt-get install -qy cloud-init grub-legacy-ec2
## copy -generic to -ec2
$ sudo sh -c 'for i in /boot/*-generic; do n=${i%-
'/boot/
'/boot/
'/boot/
'/boot/
'/boot/
## run update-
$ sudo update-
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-
Replacing config file /run/grub/menu.lst with new version
Found kernel: /boot/vmlinuz-
Replacing config file /run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done
removed: verification-needed
Hello evan2645, or anyone else affected,
Accepted cloud-init into yakkety-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
removed: verification-needed
## launched a yakkety instance
$ cat /etc/cloud/
build_name: server
serial: 20170207
$ lsb_release -sc
yakkety
## Enable proposed
$ rel=$(lsb_release -sc)
$ line=$(awk '1ドル == "deb" && 2ドル ~ /ubuntu.com/ {
printf("%s %s %s-proposed main universe\n", 1,ドル 2,ドル rel); exit(0) };
' "rel=$rel" /etc/apt/
$ echo "$line" | sudo tee /etc/apt/
deb http://
$ sudo apt-get update -qy
$ sudo apt-get install -qy grub-legacy-ec2
$ dpkg-query show grub-legacy-ec2
grub-legacy-ec2 0.7.9-0ubuntu1~
## copy -generic to -ec2
$ sudo sh -c 'for i in /boot/*-generic; do n=${i%-
'/boot/
'/boot/
'/boot/
'/boot/
'/boot/
## run update-
## Note that we see the '-ec2' kernels, before this change they
## wouldn't be considered.
$ sudo update-
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-
Replacing config file /run/grub/menu.lst with new version
Found kernel: /boot/vmlinuz-
Replacing config file /run/grub/menu.lst with new version
Updating /boot/grub/menu.lst ... done
removed: verification-needed-yakkety
Hey all - great to see this getting addressed!
Unfortunately, I'm no longer in a position to test the fix :(. Apologies. Reading through everything though, it seems that it should be effective.
Thanks for all your work!
This bug was fixed in the package cloud-init - 0.7.9-0ubuntu1~
---------------
cloud-init (0.7.9-
* debian/copyright: update License field to include Apache-2.0
* debian/
has CONFIG_XEN=y (LP: #1379080).
* debian/
ec2 bootable (LP: #1655934).
* New upstream release.
- doc: adjust headers in tests documentation for consistency.
- pep8: fix issue found in zesty build with pycodestyle.
- integration test: initial commit of integration test framework
[Wesley Wiedenmeier]
- LICENSE: Allow dual licensing GPL-3 or Apache 2.0 [Jon Grimm]
- Fix config order of precedence, putting kernel command line over system.
[Wesley Wiedenmeier] (LP: #1582323)
- pep8: whitespace fix
- Update the list of valid ssh keys. [Michael Felt]
- network: add ENI unit test for statically rendered routes.
- set_hostname: avoid erroneously appending domain to fqdn
[Lars Kellogg-Stedman] (LP: #1647910)
- doc: change 'nobootwait' to 'nofail' in docs [Anhad Jai Singh]
- Replace an expired bit.ly link in code comment. [Joshua Harlow]
-- Scott Moser <email address hidden> 2017年1月31日 21:02:28 -0500
The verification of the Stable Release Update for cloud-init has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.
This bug was fixed in the package cloud-init - 0.7.9-0ubuntu1~
---------------
cloud-init (0.7.9-
* debian/
cloud-init (0.7.9-
* debian/copyright: update License field to include Apache.
* debian/
has CONFIG_XEN=y (LP: #1379080).
* debian/
walinux agent in stable release.
* New upstream release.
- doc: adjust headers in tests documentation for consistency.
- pep8: fix issue found in zesty build with pycodestyle.
- integration test: initial commit of integration test framework
[Wesley Wiedenmeier]
- LICENSE: Allow dual licensing GPL-3 or Apache 2.0 [Jon Grimm]
- Fix config order of precedence, putting kernel command line over system.
[Wesley Wiedenmeier] (LP: #1582323)
- pep8: whitespace fix [Scott Moser]
- Update the list of valid ssh keys. [Michael Felt]
- network: add ENI unit test for statically rendered routes.
- set_hostname: avoid erroneously appending domain to fqdn
[Lars Kellogg-Stedman] (LP: #1647910)
- doc: change 'nobootwait' to 'nofail' in docs [Anhad Jai Singh]
- Replace an expired bit.ly link in code comment. [Joshua Harlow]
- user-groups: fix bug when groups was provided as string and had spaces
[Scott Moser] (LP: #1354694)
- when adding a user, strip whitespace from group list
[Lars Kellogg-Stedman] (LP: #1354694)
- fix decoding of utf-8 chars in yaml test
- Replace usage of sys_netdev_info with read_sys_net
[Joshua Harlow] (LP: #1625766)
- fix problems found in python2.6 test. [Joshua Harlow]
- Just use file logging by default [Joshua Harlow] (LP: #1643990)
- Improve formatting for ProcessExecutio
- flake8: fix trailing white space
- Doc: various documentation fixes [Sean Bright]
- cloudinit/
[Brent Baude]
- packages/redhat: fix rpm spec file.
- main: set TZ in environment if not already set. [Ryan Harper]
-- Scott Moser <email address hidden> 2017年2月06日 16:18:28 -0500
Hello evan2645, or anyone else affected,
Accepted cloud-init into trusty-proposed. The package will build now and be available at https:/
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-
Further information regarding the verification process can be found at https:/
I have verified that cloud-init (0.7.5-0ubuntu1.22) in trusty -proposed does fix the problem.
removed: verification-needed
This bug was fixed in the package cloud-init - 0.7.5-0ubuntu1.22
---------------
cloud-init (0.7.5-0ubuntu1.22) trusty; urgency=medium
* debian/
- Correctly detect kernels ending in -aws as kernels that can boot on EC2
(LP: #1655934)
- Consider kernels with CONFIG_XEN=y bootable on aws. (LP: #1379080)
-- Scott Moser <email address hidden> 2017年6月08日 19:25:41 -0400