Bug 432959 - weak-modules --remove-modules does not remove soft links
weak-modules --remove-modules does not remove soft links
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: module-init-tools (Show other bugs)
5.1
All Linux
low Severity medium
: rc
: ---
Assigned To: Jon Masters
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-15 08:26 EST by Charles Rose
Modified: 2010-10-22 18:31 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 15:54:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Charles Rose 2008-02-15 08:26:30 EST
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 08:58:38 EST
Created attachment 295005 [details]
Possible fix

This worked for me, but not tried many scenarios.
Comment 3 Jon Masters 2008-02-28 15:29:28 EST
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 04:05:19 EST
(In reply to comment #3)
> for an alternative option here. How about --delete-modules?
Yes, this would be a good addition.
Comment 8 RHEL Product and Program Management 2008-07-21 19:06:35 EDT
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 Product and Program Management 2008-07-28 15:52:26 EDT
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-17 20:43:10 EDT
In module-init-tools-3_3-0_pre3_1_39_el5
Comment 15 errata-xmlrpc 2009-01-20 15:54:11 EST
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.