Redhat: correct path to kernel module in dkms.config

This fix corrects some annoying error and warning messages during
dkms install or uninstall.

Install:
DKMS: build completed.

	openafs:
	Running module version sanity check.
	ERROR: modinfo: could not open /lib/modules/2.6.32-754.6.3.el6.x
	86_64/weak-updates/openafs.ko: No such file or directory
	 - Original module
	   - No original module exists within this kernel
	 - Installation
	   - Installing to /lib/modules/2.6.32-754.6.3.el6.x86_64/extra/
	Adding any weak-modules
	WARNING: Can't read module /lib/modules/2.6.32-754.6.3.el6.x86_6
	4/weak-updates/openafs.ko: No such file or directory
	egrep: /lib/modules/2.6.32-754.6.3.el6.x86_64//weak-updates/open
	afs.ko: No such file or directory

Remove
	Status: Before uninstall, this module version was ACTIVE on this
	kernel.
	Removing any linked weak-modules
	rmdir: failed to remove `.': Invalid argument
	WARNING: Can't read module /lib/modules/2.6.32-754.6.3.el6.x86_6
	4/weak-updates/openafs.ko: No such file or directory
	egrep: /lib/modules/2.6.32-754.6.3.el6.x86_64//weak-updates/open
	afs.ko: No such file or directory

	openafs.ko:
	 - Uninstallation
	   - Deleting from:/lib/modules/2.6.32-754.6.3.el6.x86_64/extra/
	 - Original module
	   - No original module was found for this module on this kernel
	   - Use the dkms install command to reinstall any previous
	   module version.

Background:

Commit 1c96127e37c0ec41c7a30ea3e4aa68f3cc8a24f6 standardized the
location where the openafs.ko module is installed (from
/kernel/3rdparty to /extra/).  The RPM Spec file was not updated to
build the dkms.conf file with the corrected location.

From the documentation for dkms

 DEST_MODULE_LOCATION is ignored on Fedora Core 6 and higher, Red Hat
 Enterprise Linux 5 and higher, Novell SuSE Linux Enterprise Server 10
 and higher, Novell SuSE Linux 10.0 and higher, and Ubuntu.  Instead,
 the proper distribution-specific directory is used.

However the DEST_MODULE_LOCATION is still used saving and restoring old
copies of the module.

The NO_WEAK_MODULES parameter prevents dkms from creating a symlink into
weak-updates directory, which can lead to broken symlinks when
dkms-openafs is removed.  The weak modules facility was designed to
eliminate the need to rebuild kernel modules when kernel upgrades occur
and relies on the symbols within the kABI.  Openafs uses symbols that
are outside the kABI, and therefor is not a candidate for a weak module.

Reviewed-on: https://gerrit.openafs.org/13404
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Marcio Brito Barbosa <mbarbosa@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit a28f9d28aef18936eb0ea02491ce64c72eeb1fe9)

Reviewed-on: https://gerrit.openafs.org/13438
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
(cherry picked from commit 53515f40f3dc980cc2c1afd369207617b88e93d1)

Change-Id: I47237bcd40f96d75886207f3cd6f61f15a0e4805
Reviewed-on: https://gerrit.openafs.org/13450
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
This commit is contained in:
Cheyenne Wills 2018-11-28 15:45:20 -07:00 committed by Stephan Wiesand
parent fe6fb38b3d
commit e0a200a65c

View File

@ -1109,9 +1109,10 @@ MAKE[0]='./configure --with-linux-kernel-headers=${kernel_source_dir} --with-lin
CLEAN="make -C src/libafs clean" CLEAN="make -C src/libafs clean"
BUILT_MODULE_NAME[0]="$PACKAGE_NAME" BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
DEST_MODULE_LOCATION[0]="/kernel/3rdparty/$PACKAGE_NAME/" DEST_MODULE_LOCATION[0]="/extra/$PACKAGE_NAME/"
STRIP[0]=no STRIP[0]=no
AUTOINSTALL=yes AUTOINSTALL=yes
NO_WEAK_MODULES="true"
EOF EOF