All --
I know many advanced Slackware Admins don't bother with building Packages for the Kernel Components ( HUGE, GENERIC, MODULES, SOURCE ).
But I am working towards installing Slackware out in the world, replacing CentOS on 60-or-so Customer Machines.
As such, I really do want to install the Kernel Components as Slackware Packages so that they can be managed.
I have been using the Slackware Kernel SlackBuilds to make the Packages and I am getting good results now ( still working on the kernel-source-${KERNELVERSION}-noarch-1 SlackBuild ).
Anyhow ...
Below is a suggested Patch for each of the three kernel-modules.SlackBuild files that are distributed with the Slackware Source ( example: source/k/packaging-x86_64/kernel-modules/kernel-modules.SlackBuild ).
I submit this patch because by default, each of the kernel-modules SlackBuilds expects to find the Linux Kernel Modules in /lib/modules/${KERNELRELEASE}/
This is fine if one is building a new Kernel -- i.e. one that's not running when the modules are being built.
And it may be fine even if one rebuilds the Kernel Modules for the running Kernel too.
But I am not absolutely certain about that ...
OK-or-Not, it simply 'feels' scary and dangerous to overwrite /lib/modules/${KERNELVERSION}/ for the running kernel ...
The good news is that there is a solution to my concerns.
There is a pre-defined variable in the Linux Kernel Makefile: INSTALL_MOD_PATH
When `make modules-install` is invoked, the new Kernel Modules will be installed in the Directory defined by $(INSTALL_MOD_PATH}/lib/modules/${KERNELVERSION}/
I have tested `make modules-install` on the 4.4.27 kernel and it does the right thing: the new kernel modules are installed in ${INSTALL_MOD_PATH}/lib/modules/${KERNELVERSION}/
I have also tested the patched kernel-modules.SlackBuilds and they do the right thing as well: They build the Slackware kernel-modules Package from the module tree in ${INSTALL_MOD_PATH}/lib/modules/${KERNELVERSION}/
Set or Unset, the Value of INSTALL_MOD_PATH does not matter.
Comments / Suggestions / hearty guffaws
?
Thanks.
-- kjh
#
# The following patch is from source/k/packaging-x86_64/kernel-modules/kernel-modules.SlackBuild
#
Code:
-- /tmp/kernel-modules.SlackBuild.orig 2016-06-24 13:31:28.000000000 -0500
+++ /tmp/kernel-modules.SlackBuild 2016-10-26 06:10:45.299173490 -0500
@@ -33,12 +33,12 @@
rm -rf $PKG
mkdir -p $TMP $PKG
-echo "Using /lib/modules/${KERNELRELEASE}/"
+echo "Using ${INSTALL_MOD_PATH}/lib/modules/${KERNELRELEASE}/"
echo "Make sure these are *ready*... compressed, or not."
echo "However you want 'em."
sleep 5
mkdir -p $PKG/lib/modules
-cp -a /lib/modules/${KERNELRELEASE} $PKG/lib/modules
+cp -a ${INSTALL_MOD_PATH}/lib/modules/${KERNELRELEASE} $PKG/lib/modules
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc