Bug 677313 - Weak modules in initrd break on kernel updates
Summary: Weak modules in initrd break on kernel updates
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.6
Hardware: All
OS: Linux
medium
high
Target Milestone: rc
: ---
Assignee: Red Hat Kernel Manager
QA Contact: Red Hat Kernel QE team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-02-14 10:38 UTC by Pierre Carrier
Modified: 2018-11-27 21:49 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-08 10:15:17 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 702276 1 None None None 2021-01-20 06:05:38 UTC

Internal Links: 702276

Description Pierre Carrier 2011-02-14 10:38:11 UTC
Description of problem:
- When weak-modules are used in the initrd, they are dropped on kernel updates

- Version-Release number of selected component (if applicable):
All RHEL5 kernels

Additional info:
- Caused by:
$ rpm -q --scripts kernel
postinstall scriptlet (using /bin/sh):
[...]
/sbin/new-kernel-pkg --package kernel --mkinitrd --depmod --install 2.6.18-194.3.1.el5 || exit $?
if [ -x /sbin/weak-modules ]
then
    /sbin/weak-modules --add-kernel 2.6.18-194.3.1.el5 || exit $?
fi
- AFAICT could be changed with little to no impact

Comment 1 Pierre Carrier 2011-02-14 10:40:47 UTC
The only issue I can think of is that /sbin/new-kernel-pkg is already called in /sbin/weak-modules...

Comment 4 Pierre Carrier 2011-02-21 12:41:18 UTC
Adding the following to the SPEC would answer this need and many others:

%posttrans
/sbin/new-kernel-pkg --rpmposttrans %{KVERREL}

%posttrans smp
/sbin/new-kernel-pkg --rpmposttrans %{KVERREL}smp

%posttrans PAE
/sbin/new-kernel-pkg --rpmposttrans %{KVERREL}PAE

%posttrans debug
/sbin/new-kernel-pkg --rpmposttrans %{KVERREL}debug

%posttrans xen
/sbin/new-kernel-pkg --rpmposttrans %{KVERREL}xen

%posttrans kdump
/sbin/new-kernel-pkg --rpmposttrans %{KVERREL}kdump

Comment 5 Jarod Wilson 2011-02-21 13:08:05 UTC
Definitely want jcm's input on what to do here, he's our weak-modules guru.

Comment 6 Jon Masters 2011-02-23 04:19:43 UTC
Er...I'm still interested in getting an actual bug report. The above isn't really very clear at all. Something about drivers "updated" in an initrd not being picked up, but what exactly?

1). What driver was installed, or upgraded?
2). Why do you think the weak-modules script is not working?
3). In what way is the initrd not working as desired?

Jon.

Comment 7 Jarod Wilson 2011-02-23 16:20:31 UTC
As I understand it, there's some module from weak-modules that is supposed to be included in the initrd, but its not being included, as the initrd is created before weak-modules has been run, and thus for the new kernel, nothing is known about that module.

Comment 8 Pierre Carrier 2011-03-01 13:17:48 UTC
Sorry if I wasn't clear in the bug description.

1) Install weak modules.
2) Get them in the initrd because they're needed to boot.
3) Update your kernel.
4) No more weak modules in the initrd.

Why? Because we put he weak modules in place *after* building the new initrd.

What can we do for our customers who want weak modules in their initrd? Either:

1) (I don't like) Nothing. Ask them to manually regenerate the initrd each time they update their kernel.

2) (involves a risk as we reorder stuff in our package, fixes the bug directly) Put the weak modules in place before rebuilding the initrd in %postinst
3) (Allows customers to work around the bug, and do many other stuff if they want to) Use "new-kernel-pkg --rpmposttrans" in %posttrans and let users rebuild the initrd themselves after weak-modules handling, by adding the appropriate script in /etc/kernel/postinst.d/
4) Both 2) and 3)

Comment 9 Jon Masters 2011-03-08 06:42:30 UTC
We call /sbin/weak-modules during the kernel transaction, which tests and rebuilds the initrd for any kernel images that need changing. There isn't a bug here that I am aware of. What can happen, though, is that you install a driver update ("weak module") that is not compatible with all kernels and is not retained. Can you please:

1). File a bug report that includes exactly which driver(s) you are trying to install.

2). Detail where these driver(s) came from, and in what form, package name, etc.

3). Attach the driver(s) or a link to them.

Jon.

Comment 12 Pierre Carrier 2011-05-03 12:18:15 UTC
Turns out the current behaviour is correct. Ticket was closed as NOTABUG. Opening an Request For Enhancement for 'new-kernel-pkg --rpmposttrans'.


Yours sincerely,

-- 
Pierre Carrier


Note You need to log in before you can comment on or make changes to this bug.