From ac8a54e535e9b6d6cbaa407a2370f507adf2d4fd Mon Sep 17 00:00:00 2001 From: Josh Poimboeuf Date: Fri, 9 May 2014 20:24:26 -0500 Subject: [PATCH] kpatch: try to modprobe core module Try to modprobe the core module, for systems that have the core module properly installed with depmod. --- kpatch/kpatch | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/kpatch/kpatch b/kpatch/kpatch index 814bfe0..86a91af 100755 --- a/kpatch/kpatch +++ b/kpatch/kpatch @@ -98,9 +98,13 @@ core_module_loaded () { load_module () { if ! core_module_loaded; then - find_core_module || die "can't find core module" - echo "loading core module: $COREMOD" - /usr/sbin/insmod "$COREMOD" || die "failed to load core module" + if modprobe -q kpatch; then + echo "loaded core module" + else + find_core_module || die "can't find core module" + echo "loading core module: $COREMOD" + /usr/sbin/insmod "$COREMOD" || die "failed to load core module" + fi fi echo "loading patch module: $1" /usr/sbin/insmod "$1" "$2"