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"