Red Hat Bugzilla – Bug 509568
/sbin/weak-modules erroneously creates a multiboot grub entry for domU
Last modified: 2010-03-30 04:25:06 EDT
Created attachment 350445 [details]
A patch to fix this problem.
Description of problem:
Version-Release number of selected component (if applicable): 3.3-0.pre3.1.53.el5
How reproducible: every time
Steps to Reproduce:
1. either create a kmod rpm that will install modules that belong in the initrd
or arrange for /sbin/weak-modules to believe that it needs to update the
initrd by removing it (for example).
2. When /sbin/weak-modules is run from the post-install kmod rpm script it will
correctly decide that the initrd needs to be rebuilt but will incorrectly
detect a xen domU as needing a multiboot grub entry
Actual results: As above
Expected results: A domU that will boot :-)
The problem is that the "kernel_is_xen" test in /sbin/weak-modules assumes that if the kernel version ends with "xen" this this is a xen kernel and needs a multiboot grub entry. The inference is wrong: the same xen kernel is used for both dom0 and domU. The fix (attached) augments the kernel_is_xen test with the same test that kernel-xen's post install script uses.
Of course, you don't need a kmod rpm to trigger this problem -- any out of date or missing initrd will cause the initrd to be re-created and a new grub entry written. I originally reproduced the problem by installing a kmod for fuse having deliberately made the current initrd out of date by changing modprobe.conf.
The same patch will also fix the same bug in RHEL 5.3.
I've changed the priority to "high" -- it occurs to me that a machine suddenly becoming unbootable is pretty serious to some people.
It would be nice if this relatively simple fix made it into 5.4.
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.