diff --git a/kpatch/kpatch b/kpatch/kpatch index f57afe6..214fc5f 100755 --- a/kpatch/kpatch +++ b/kpatch/kpatch @@ -86,12 +86,15 @@ 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" fi + echo "loading patch module: $1" /usr/sbin/insmod "$1" } unload_module () { + echo "unloading patch module: $1" /usr/sbin/rmmod "$(basename $1)" } @@ -136,8 +139,12 @@ case "$1" in PATCH="$2" [[ -e "$PATCH" ]] || die "$PATCH doesn't exist" [[ ${PATCH: -3} == ".ko" ]] || die "$PATCH isn't a .ko file" + + echo "installing $PATCH to $USERDIR" mkdir -p "$USERDIR" || die "failed to create install directory" cp -f "$PATCH" "$USERDIR" || die "failed to install patch $PATCH" + + echo "installing $PATCH to initramfs" dracut -f || die "dracut failed" ;; @@ -145,7 +152,11 @@ case "$1" in [[ "$#" -ne 2 ]] && usage PATCH="$2" find_module "$PATCH" || die "$PATCH is not installed" + + echo "uninstalling $PATCH from $USERDIR" rm -f "$USERDIR/$(basename $MODULE)" || die "failed to uninstall patch $PATCH" + + echo "uninstalling $PATCH from initramfs" dracut -f || die "dracut failed" ;;