Third party kernel modules are loaded from the weak-updates directory and not from the extra directory

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Third party kernel modules installed

Issue

  • Kernel modules in the weak-updates directory loaded rather than modules in extra directory.
  • Third party kernel modules are loaded from the wrong location.
  • Third party kernel modules are loaded from the weak-updates directory and not from the extra directory.

Resolution

  • Please run depmod -a and reboot the system to solve this issue.

Root Cause

  • After updating the kernel package, the third party modules package has also been updated.
  • This package does not execute depmod -a.

Diagnostic Steps

  • Before updating the kernel, check where third party modules are installed:

    # ls -l /lib/modules/2.6.32-696*/{extra,weak-updates}/
    /lib/modules/2.6.32-696.10.2.el6.x86_64/extra:
    total 3460
    -r-x------ 1 root root 2930329 Oct  5  2017 module1.ko
    -r-x------ 1 root root  534596 Oct  5  2017 module2.ko
    -r-x------ 1 root root   69727 Oct  5  2017 module3.ko
    
    /lib/modules/2.6.32-696.10.2.el6.x86_64/weak-updates:
    total 0
    
  • Update the kernel and check both locations for modules:

    # ls -l /lib/modules/2.6.32-696*/{extra,weak-updates}/
    /lib/modules/2.6.32-696.10.2.el6.x86_64/extra:
    total 3460
    -r-x------ 1 root root 2930329 Oct  5  2017 module1.ko
    -r-x------ 1 root root  534596 Oct  5  2017 module2.ko
    -r-x------ 1 root root   69727 Oct  5  2017 module3.ko
    
    /lib/modules/2.6.32-696.10.2.el6.x86_64/weak-updates:
    total 0
    
    /lib/modules/2.6.32-696.10.2.el6.x86_64/extra:
    total 0
    
    /lib/modules/2.6.32-696.16.1.el6.x86_64/weak-updates:
    total 0
    lrwxrwxrwx 1 root root 55 Jul 12 11:15 module1.ko -> /lib/modules/2.6.32-696.10.2.el6.x86_64/extra/module1.ko
    lrwxrwxrwx 1 root root 58 Jul 12 11:15 module2.ko -> /lib/modules/2.6.32-696.10.2.el6.x86_64/extra/module2.ko
    lrwxrwxrwx 1 root root 57 Jul 12 11:15 module3.ko -> /lib/modules/2.6.32-696.10.2.el6.x86_64/extra/module3.ko
    
  • Notice that the new kernel has only links for the third party modules which point to the extra directory at the old kernel directory.

  • Update the third party modules package
  • Check again where modules reside:

    # ls -l /lib/modules/2.6.32-696*/{extra,weak-updates}/
    /lib/modules/2.6.32-696.10.2.el6.x86_64/extra:
    total 3460
    -r-x------ 1 root root 2930329 Oct  5  2017 module1.ko
    -r-x------ 1 root root  534596 Oct  5  2017 module2.ko
    -r-x------ 1 root root   69727 Oct  5  2017 module3.ko
    
    /lib/modules/2.6.32-696.10.2.el6.x86_64/weak-updates:
    total 0
    
    /lib/modules/2.6.32-696.16.1.el6.x86_64/extra:
    total 3460
    -r-x------ 1 root root 2930329 Dec 12  2017 module1.ko
    -r-x------ 1 root root  534596 Dec 12  2017 module2.ko
    -r-x------ 1 root root   69727 Dec 12  2017 module3.ko
    
    /lib/modules/2.6.32-696.16.1.el6.x86_64/weak-updates:
    total 0
    lrwxrwxrwx 1 root root 55 Jul 12 11:15 module1.ko -> /lib/modules/2.6.32-696.10.2.el6.x86_64/extra/module1.ko
    lrwxrwxrwx 1 root root 58 Jul 12 11:15 module2.ko -> /lib/modules/2.6.32-696.10.2.el6.x86_64/extra/module2.ko
    lrwxrwxrwx 1 root root 57 Jul 12 11:15 module3.ko -> /lib/modules/2.6.32-696.10.2.el6.x86_64/extra/module3.ko
    
  • Notice that now there are “old” and “new” modules installed.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments