kpatch/contrib/module-setup.sh
Josh Poimboeuf ec77b26c76 kpatch: change core module path again
On RHEL I'm seeing issues with putting the core module in the "extra"
path.  On the next depmod run, it gets added to modules.dep, and on a
subsequent kpatch install I see the following errors:

    /usr/lib/dracut/modules.d/50drm/module-setup.sh: line 26: /lib/modules/3.10.0-123.4.4.el7.x86_64//weak-updates/kpatch/kpatch.ko: No such file or directory
    /usr/lib/dracut/modules.d/90kernel-modules/module-setup.sh: line 14: /lib/modules/3.10.0-123.4.4.el7.x86_64//weak-updates/kpatch/kpatch.ko: No such file or directory
    modinfo: ERROR: Module /lib/modules/3.10.0-123.4.4.el7.x86_64/weak-updates/kpatch/kpatch.ko not found.

Until the core module gets merged into Linux, I think we can put it in
/usr/lib/kpatch, which is also where the patch modules are going to be
delivered in the RHEL RPM.

Making sure the other options still work with the kpatch utility for
now, so as to keep backwards compatibility between a newer kpatch
utility and older core modules.  We can break this compatibility for
kpatch 0.2.0.
2014-07-28 20:30:20 -05:00

43 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
#
# Licensed under the GPLv2
#
# Copyright 2014 Red Hat, Inc.
# Josh Poimboeuf <jpoimboe@redhat.com>
# called by dracut
check() {
if [[ -e /var/lib/kpatch/$kernel ]]; then
return 0
else
return 1
fi
}
# called by dracut
install() {
# install kpatch script
inst_any -d /usr/sbin/kpatch /usr/local/sbin/kpatch /usr/sbin/kpatch
# install insmod (needed by kpatch script)
inst_symlink /usr/sbin/insmod
# install dirname (needed by kpatch script)
inst /usr/bin/dirname
# install core module
inst_any -d /usr/lib/modules/$kernel/extra/kpatch/kpatch.ko /usr/local/lib/modules/$kernel/extra/kpatch/kpatch.ko /usr/lib/modules/$kernel/extra/kpatch/kpatch.ko /usr/lib/kpatch/$kernel/kpatch.ko /usr/local/lib/kpatch/$kernel/kpatch.ko
# install patch modules
if [[ -e /var/lib/kpatch/$kernel ]]; then
inst_dir /var/lib/kpatch/$kernel
for i in /var/lib/kpatch/$kernel/*; do
[[ -e $i ]] || continue
inst "$i"
done
fi
# install hook script
inst_hook pre-udev 00 "$moddir/kpatch-load-all.sh"
}