diff --git a/kpatch/kpatch b/kpatch/kpatch index 358f53a..370d66c 100755 --- a/kpatch/kpatch +++ b/kpatch/kpatch @@ -31,15 +31,14 @@ usage () { echo "usage: kpatch []" >&2 echo >&2 echo "Valid commands:" >&2 - printf ' %-20s %s\n' "install " "install patch module to the kpatch DB" >&2 - printf ' %-20s %s\n' "uninstall " "uninstall patch module from the kpatch DB" >&2 + printf ' %-20s %s\n' "install " "install patch module to the initrd to be loaded at boot" >&2 + printf ' %-20s %s\n' "uninstall " "uninstall patch module from the initrd" >&2 echo >&2 printf ' %-20s %s\n' "load --all" "load all installed patch modules into the running kernel" >&2 - printf ' %-20s %s\n' "load " "load installed patch module into the running kernel" >&2 - printf ' %-20s %s\n' "unload " "unload patch module from the running kernel" >&2 + printf ' %-20s %s\n' "load " "load patch module into the running kernel" >&2 + printf ' %-20s %s\n' "unload " "unload patch module from the running kernel" >&2 echo >&2 - echo >&2 - printf ' %-20s %s\n' "info " "show information about an installed patch module" >&2 + printf ' %-20s %s\n' "info " "show information about a patch module" >&2 echo >&2 printf ' %-20s %s\n' "list" "list installed patch modules" >&2 exit 1 @@ -55,6 +54,9 @@ die() { } __find_module () { + MODULE="$1" + [[ -f "$MODULE" ]] && return + MODULE="$USERDIR/$1" [[ -f "$MODULE" ]] && return @@ -121,7 +123,7 @@ case "$1" in ;; *) PATCH="$2" - find_module "$PATCH" || die "$PATCH is not installed" + find_module "$PATCH" || die "can't find $PATCH" load_module "$MODULE" || die "failed to load patch $PATCH" ;; esac @@ -130,7 +132,7 @@ case "$1" in "unload") [[ "$#" -ne 2 ]] && usage PATCH="$2" - find_module "$PATCH" || die "$PATCH is not installed" + find_module "$PATCH" || die "can't find $PATCH" unload_module "$MODULE" || die "failed to unload patch $PATCH" ;; @@ -179,7 +181,7 @@ case "$1" in "info") [[ "$#" -ne 2 ]] && usage PATCH="$2" - find_module "$PATCH" || die "$PATCH is not installed" + find_module "$PATCH" || die "can't find $PATCH" echo "Patch information for $PATCH:" /usr/sbin/modinfo "$MODULE" || die "failed to get info for patch $PATCH" ;; diff --git a/man/kpatch.1 b/man/kpatch.1 index a51eb72..fc0af62 100644 --- a/man/kpatch.1 +++ b/man/kpatch.1 @@ -11,23 +11,23 @@ displaying information about kernel patch modules installed on the system. .SH OPTIONS -install - install patch module to the kpatch DB +install + install patch module to the initrd to be loaded at boot -uninstall - uninstall patch module from the kpatch DB +uninstall + uninstall patch module from the initrd load --all load all installed patch modules into the running kernel -load - load installed patch module into the running kernel +load + load patch module into the running kernel -unload +unload unload patch module from the running kernel -info - show information about an installed patch module +info + show information about a patch module list list installed patch modules