Bug 432959 - weak-modules --remove-modules does not remove soft links
Summary: weak-modules --remove-modules does not remove soft links
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: module-init-tools
Version: 5.1
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Jon Masters
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-02-15 13:26 UTC by Charles Rose
Modified: 2018-10-20 01:19 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-01-20 20:54:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Possible fix (636 bytes, patch)
2008-02-15 13:58 UTC, Charles Rose
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0093 0 normal SHIPPED_LIVE module-init-tools bug fix and enhancement update 2009-01-20 16:04:29 UTC

Description Charles Rose 2008-02-15 13:26:30 UTC
Description of problem:
I have a RHEL5 box with the default 2.6.18-8.el5 kernel and RHEL 5.1's
2.6.18-53.el5 kernels installed.

With 2.6.18-8.el5 as the running kernel, I installed (via DKMS) a newer version
of megaraid_sas.ko. The driver was installed in /lib/modules/2.6.18-8.el5/extra.
This also creates the weak-modules link for 2.6.18-53.el5: 
/lib/modules/2.6.18-53.el5/weak-updates/megaraid_sas.ko ->
/lib/modules/2.6.18-8.el5/extra/megaraid_sas.ko

I then tried to remove the weak-module for 2.6.18-53.el5 :

# echo "/lib/modules/2.6.18-8.el5/extra/megaraid_sas.ko" |weak-modules --verbose
--remove-modules
rm -f /lib/modules/2.6.18-53.el5/weak-updates/megaraid_sas.ko
Module megaraid_sas.ko from kernel 2.6.18-8.el5 is compatible with kernel
2.6.18-53.el5
Adding compatible module megaraid_sas.ko from kernel 2.6.18-8.el5 instead
ln -s /lib/modules/2.6.18-8.el5/extra/megaraid_sas.ko
/lib/modules/2.6.18-53.el5/weak-updates/megaraid_sas.ko
rmdir --parents --ignore-fail-on-non-empty /lib/modules/2.6.18-53.el5/weak-updates
/sbin/depmod -ae -F /boot/System.map-2.6.18-53.el5 2.6.18-53.el5
/sbin/depmod -ae -F /boot/System.map-2.6.18-8.el5 2.6.18-8.el5

Here, "rm -f" and "ln -s" in effect, re-create the link. Net result is after
running weak-modules --remove-modules,
/lib/modules/2.6.18-53.el5/weak-updates/megaraid_sas.ko continues to exist.

This breaks "dkms remove" which invokes "weak-modules --remove-modules" and then
removes the original driver module from /lib/modules/2.6.18-8.el5/extra , but
since weak-modules recreated the link in
/lib/modules/2.6.18-53.el5/weak-modules, we are left with a broken link here.

Version-Release number of selected component (if applicable):
module-init-tools-3.3-0.pre3.1.34.el5

How reproducible:
Always

Steps to Reproduce:
1. Install RHEL5, install 2.6.18-53.el5 kernel
2. Install megaraid_sas DKMS driver package
3. # echo "/lib/modules/2.6.18-8.el5/extra/megaraid_sas.ko" |weak-modules
--verbose --remove-modules
  
Actual results:
weak-modules --remove-modules does not remove the soft link in
/lib/modules/2.6.18-53.el5/weak-modules

Expected results:
weak-modules --remove-modules removes the soft link in
/lib/modules/2.6.18-53.el5/weak-modules

Additional info:
Megaraid_sas DKMS driver package:
ftp://ftp.us.dell.com/SAS-RAID/megaraid_sas-v00.00.03.16.tgz

Comment 1 Charles Rose 2008-02-15 13:58:38 UTC
Created attachment 295005 [details]
Possible fix

This worked for me, but not tried many scenarios.

Comment 3 Jon Masters 2008-02-28 20:29:28 UTC
The thing is, the intended functionality of this option is to remove a module
and then replace the removed module with whatever older release is available -
it's behaving as designed. However, I can see that you have a legitimate need
for an alternative option here. How about --delete-modules?

Jon.


Comment 4 Charles Rose 2008-03-03 09:05:19 UTC
(In reply to comment #3)
> for an alternative option here. How about --delete-modules?
Yes, this would be a good addition.

Comment 8 RHEL Program Management 2008-07-21 23:06:35 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 10 RHEL Program Management 2008-07-28 19:52:26 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 11 Jon Masters 2008-09-18 00:43:10 UTC
In module-init-tools-3_3-0_pre3_1_39_el5

Comment 15 errata-xmlrpc 2009-01-20 20:54:11 UTC
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.

http://rhn.redhat.com/errata/RHBA-2009-0093.html


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