Bug 1331744

Summary: kmod rpm does not directly provide /sbin/modprobe
Product: Red Hat Enterprise Linux 7 Reporter: Mickey Malone <mmalone2>
Component: kmodAssignee: David Shea <dshea>
Status: CLOSED NOTABUG QA Contact: Kernel General QE <kernel-general-qe>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.2   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-29 13:38:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Mickey Malone 2016-04-29 12:27:41 UTC
Description of problem:
/sbin/modprobe symlink is not created when installing kmod using rpm. I have seen this same issue with the bash rpm as well, but lets limit the scope to just kmod for now.
Listing the package contents does not show /sbin/modprobe, but running a query --provides against the package shows that it is supposed to provide /sbin/modprobe. 

PROVIDES:
rpm -qvp kmod-20-5.el7.x86_64.rpm  --provides
manual: /sbin/modprobe
manual: kmod = 20-5.el7
manual: kmod(x86-64) = 20-5.el7
manual: module-init-tools = 4.0-1

LISTING (no /sbin/modprobe):
rpm -qvlp kmod-20-5.el7.x86_64.rpm
drwxr-xr-x    2 root    root                        0 Jun  3  2015 /etc/depmod.d
-rw-r--r--    1 root    root                      116 Jun  3  2015 /etc/depmod.d/dist.conf
drwxr-xr-x    2 root    root                        0 Jun  3  2015 /etc/modprobe.d
-rwxr-xr-x    1 root    root                   150656 Jun  3  2015 /usr/bin/kmod
drwxr-xr-x    2 root    root                        0 Jun  3  2015 /usr/lib/modprobe.d
lrwxrwxrwx    1 root    root                       11 Jun  3  2015 /usr/sbin/depmod -> ../bin/kmod
lrwxrwxrwx    1 root    root                       11 Jun  3  2015 /usr/sbin/insmod -> ../bin/kmod
lrwxrwxrwx    1 root    root                       11 Jun  3  2015 /usr/sbin/lsmod -> ../bin/kmod
lrwxrwxrwx    1 root    root                       11 Jun  3  2015 /usr/sbin/modinfo -> ../bin/kmod
lrwxrwxrwx    1 root    root                       11 Jun  3  2015 /usr/sbin/modprobe -> ../bin/kmod
lrwxrwxrwx    1 root    root                       11 Jun  3  2015 /usr/sbin/rmmod -> ../bin/kmod
-rwxr-xr-x    1 root    root                    17087 Jun  3  2015 /usr/sbin/weak-modules
-rw-r--r--    1 root    root                     3235 Jun  3  2015 /usr/share/bash-completion/completions/kmod
drwxr-xr-x    2 root    root                        0 Jun  3  2015 /usr/share/doc/kmod-20
-rw-r--r--    1 root    root                    26432 Oct 27  2014 /usr/share/doc/kmod-20/COPYING
-rw-r--r--    1 root    root                    15829 Mar  1  2015 /usr/share/doc/kmod-20/NEWS
-rw-r--r--    1 root    root                     3522 Dec 13  2014 /usr/share/doc/kmod-20/README
-rw-r--r--    1 root    root                     1982 Mar  1  2015 /usr/share/doc/kmod-20/TODO
-rw-r--r--    1 root    root                     1606 Jun  3  2015 /usr/share/man/man5/depmod.d.5.gz
lrwxrwxrwx    1 root    root                       15 Jun  3  2015 /usr/share/man/man5/modprobe.conf.5.gz -> modprobe.d.5.gz
-rw-r--r--    1 root    root                     3122 Jun  3  2015 /usr/share/man/man5/modprobe.d.5.gz
-rw-r--r--    1 root    root                     1047 Jun  3  2015 /usr/share/man/man5/modules.dep.5.gz
-rw-r--r--    1 root    root                       38 Jun  3  2015 /usr/share/man/man5/modules.dep.bin.5.gz
-rw-r--r--    1 root    root                     2408 Jun  3  2015 /usr/share/man/man8/depmod.8.gz
-rw-r--r--    1 root    root                      930 Jun  3  2015 /usr/share/man/man8/insmod.8.gz
-rw-r--r--    1 root    root                      948 Jun  3  2015 /usr/share/man/man8/kmod.8.gz
-rw-r--r--    1 root    root                      788 Jun  3  2015 /usr/share/man/man8/lsmod.8.gz
-rw-r--r--    1 root    root                     1637 Jun  3  2015 /usr/share/man/man8/modinfo.8.gz
-rw-r--r--    1 root    root                     3580 Jun  3  2015 /usr/share/man/man8/modprobe.8.gz
-rw-r--r--    1 root    root                     1146 Jun  3  2015 /usr/share/man/man8/rmmod.8.gz

SCRIPTS (N/A):
rpm -qvp kmod-20-5.el7.x86_64.rpm  --scripts

Version-Release number of selected component (if applicable):
kmod-20-5.el7.x86_64.rpm

How reproducible:
Install kmod-20-5.el7.x86_64.rpm or use rpm2cpio kmod-20-5.el7.x86_64.rpm | cpio -id and inspect the contents. You will not find /sbin/modprobe

Steps to Reproduce:

Assuming the kmod is already installed here.

1. rm -f /sbin/modprobe
2. rpm -ivp kmod-20-5.el7.x86_64.rpm --force (or you can just rpm2cpio the thing since the rpm does not have any sciplets)
3. Verify /sbin/modprobe is there which it is not


Actual results:
rpm installs, but /sbin/modprobe is not there.

Expected results:
/sbin/modprobe is a symlink to ../bin/kmod

Additional info:
This also appears to occur with the bash rpm package as well.

Comment 1 Mickey Malone 2016-04-29 12:53:46 UTC
So it looks like the root '/' has bin, lib, and lib64 symlinked to the respective 'usr' dirs.

That is misleading... when an rpm specifically says that it provides /sbin/modprobe, but it is really providing /usr/sbin/modprobe.

Comment 3 David Shea 2016-04-29 13:38:16 UTC
One of the changes in Fedora that was included in RHEL 7 is that directories that had versions in both / and /usr (bin, sbin, lib, lib64) have been merged. https://fedoraproject.org/wiki/Features/UsrMove  /usr/sbin is now the actual directory, and is where kmod installs its files, and /sbin is a symlink to /usr/sbin.

Files are generally not listed in the Provides metadata for an rpm. Rpm instead resolves path requirements based on the file lists. The Provides: /sbin/modprobe is added for compatibility with older packages. Packages that depend on modprobe that were created before the usr merge may have used Requires: /sbin/modprobe, which is no longer part of the file list provided by the kmod package, and by explicitly adding /sbin/modprobe to the package metadata these requirements can continue to be used.