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 modifieddebian/update-grub-legacy-ec2 (+18/-0)
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Zesty): | |
status: | New → Fix Committed |
Changed in cloud-init (Ubuntu Yakkety): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Xenial): | |
status: | New → Confirmed |
Changed in cloud-init (Ubuntu Yakkety): | |
importance: | Undecided → Medium |
Changed in cloud-init (Ubuntu Xenial): | |
importance: | Undecided → Medium |
description: | updated |
tags: |
added: verification-done-xenial verification-needed-yakkety removed: verification-needed |
fwiw, if you put an executable program 'is_xen_kernel' anywhere in PATH when update- grub-legacy- ec2 is running, it will be used instead of the is_xen_kernel inside.
So, to make this work without any protection is just like:
ln -s /usr/bin/ is_xen_ kernel /bin/true