kpatch: try to modprobe core module

Try to modprobe the core module, for systems that have the core module
properly installed with depmod.
This commit is contained in:
Josh Poimboeuf 2014-05-09 20:24:26 -05:00
parent a7dc43ab24
commit ac8a54e535
1 changed files with 7 additions and 3 deletions

View File

@ -98,10 +98,14 @@ core_module_loaded () {
load_module () { load_module () {
if ! core_module_loaded; then if ! core_module_loaded; then
if modprobe -q kpatch; then
echo "loaded core module"
else
find_core_module || die "can't find core module" find_core_module || die "can't find core module"
echo "loading core module: $COREMOD" echo "loading core module: $COREMOD"
/usr/sbin/insmod "$COREMOD" || die "failed to load core module" /usr/sbin/insmod "$COREMOD" || die "failed to load core module"
fi fi
fi
echo "loading patch module: $1" echo "loading patch module: $1"
/usr/sbin/insmod "$1" "$2" /usr/sbin/insmod "$1" "$2"
} }