mirror of
https://github.com/dynup/kpatch
synced 2025-01-27 07:12:53 +00:00
kpatch: print status messages
Print status messages for load/unload/install/uninstall to give the user a better idea of what's going on.
This commit is contained in:
parent
ff2b545f04
commit
b487be539c
@ -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"
|
||||
;;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user