kpatch: consistent naming: module vs patch

Try to be more consistent with the naming of patch modules.  They are
patch modules, where patch is the adjective and module is the noun.  So
calling them patches is confusing.
This commit is contained in:
Josh Poimboeuf 2014-06-03 13:09:38 -05:00
parent 22f0d38f86
commit d2b765fea5

View File

@ -151,7 +151,7 @@ case "$1" in
*) *)
PATCH="$2" PATCH="$2"
find_module "$PATCH" || die "can't find $PATCH" find_module "$PATCH" || die "can't find $PATCH"
load_module "$MODULE" || die "failed to load patch $PATCH" load_module "$MODULE" || die "failed to load module $PATCH"
;; ;;
esac esac
;; ;;
@ -160,14 +160,14 @@ case "$1" in
[[ "$#" -ne 2 ]] && usage [[ "$#" -ne 2 ]] && usage
PATCH="$2" PATCH="$2"
find_module "$PATCH" || die "can't find $PATCH" find_module "$PATCH" || die "can't find $PATCH"
load_module "$MODULE" replace=1 || die "failed to load patch $PATCH" load_module "$MODULE" replace=1 || die "failed to load module $PATCH"
unload_disabled_modules || die "failed to unload old modules" unload_disabled_modules || die "failed to unload old modules"
;; ;;
"unload") "unload")
[[ "$#" -ne 2 ]] && usage [[ "$#" -ne 2 ]] && usage
[[ $2 =~ ^- ]] && usage [[ $2 =~ ^- ]] && usage
unload_module "$2" || die "failed to unload patch $2" unload_module "$2" || die "failed to unload module $2"
;; ;;
"install") "install")
@ -182,7 +182,7 @@ case "$1" in
shift shift
;; ;;
--) --)
[[ -z "$2" ]] && die "no patch file specified" [[ -z "$2" ]] && die "no module file specified"
PATCH="$2" PATCH="$2"
;; ;;
esac esac
@ -199,7 +199,7 @@ case "$1" in
echo "installing $PATCH ($KVER)" echo "installing $PATCH ($KVER)"
mkdir -p $INSTALLDIR/$KVER || die "failed to create install directory" mkdir -p $INSTALLDIR/$KVER || die "failed to create install directory"
cp -f "$PATCH" $INSTALLDIR/$KVER || die "failed to install patch $PATCH" cp -f "$PATCH" $INSTALLDIR/$KVER || die "failed to install module $PATCH"
if lsinitrd -k $KVER &> /dev/null; then if lsinitrd -k $KVER &> /dev/null; then
echo "rebuilding $KVER initramfs" echo "rebuilding $KVER initramfs"
@ -219,7 +219,7 @@ case "$1" in
shift shift
;; ;;
--) --)
[[ -z "$2" ]] && die "no patch file specified" [[ -z "$2" ]] && die "no module file specified"
PATCH="$2" PATCH="$2"
[[ "$PATCH" != $(basename "$PATCH") ]] && die "please supply patch module name without path" [[ "$PATCH" != $(basename "$PATCH") ]] && die "please supply patch module name without path"
;; ;;
@ -230,7 +230,7 @@ case "$1" in
[[ ! -e $INSTALLDIR/$KVER/"$PATCH" ]] && die "$PATCH is not installed for kernel $KVER" [[ ! -e $INSTALLDIR/$KVER/"$PATCH" ]] && die "$PATCH is not installed for kernel $KVER"
echo "uninstalling $PATCH ($KVER)" echo "uninstalling $PATCH ($KVER)"
rm -f $INSTALLDIR/$KVER/"$PATCH" || die "failed to uninstall patch $PATCH" rm -f $INSTALLDIR/$KVER/"$PATCH" || die "failed to uninstall module $PATCH"
if lsinitrd -k $KVER &> /dev/null; then if lsinitrd -k $KVER &> /dev/null; then
echo "rebuilding $KVER initramfs" echo "rebuilding $KVER initramfs"
dracut -f --kver $KVER || die "dracut failed" dracut -f --kver $KVER || die "dracut failed"
@ -261,7 +261,7 @@ case "$1" in
PATCH="$2" PATCH="$2"
find_module "$PATCH" || die "can't find $PATCH" find_module "$PATCH" || die "can't find $PATCH"
echo "Patch information for $PATCH:" echo "Patch information for $PATCH:"
/usr/sbin/modinfo "$MODULE" || die "failed to get info for patch $PATCH" /usr/sbin/modinfo "$MODULE" || die "failed to get info for module $PATCH"
;; ;;
"help"|"-h"|"--help") "help"|"-h"|"--help")