Blame SOURCES/0003-Support-modprobe-format-names-in-uninstall.patch

576586
From 58134fd4490ebe57840762afef5d095a9a4a9771 Mon Sep 17 00:00:00 2001
576586
From: Seth Jennings <sjenning@redhat.com>
576586
Date: Wed, 27 Aug 2014 14:30:39 -0500
576586
Subject: [PATCH 3/5] Support modprobe format names in uninstall
576586
To: rhkernel-list@redhat.com
576586
576586
Signed-off-by: Seth Jennings <sjenning@redhat.com>
576586
---
576586
 kpatch/kpatch | 18 ++++++++++++++++--
576586
 1 file changed, 16 insertions(+), 2 deletions(-)
576586
576586
diff --git a/kpatch/kpatch b/kpatch/kpatch
576586
index 1d33641..1a1b1ac 100755
576586
--- a/kpatch/kpatch
576586
+++ b/kpatch/kpatch
576586
@@ -264,10 +264,24 @@ case "$1" in
576586
 		shift
576586
 	done
576586
 
576586
-	[[ ! -e $INSTALLDIR/$KVER/"$PATCH" ]] && die "$PATCH is not installed for kernel $KVER"
576586
+	MODULE=$INSTALLDIR/$KVER/"$PATCH"
576586
+	if [[ ! -f "$MODULE" ]]; then
576586
+		mod_name "$PATCH"
576586
+		PATCHNAME=$MODNAME
576586
+		for i in $INSTALLDIR/$KVER/*; do
576586
+			mod_name "$i"
576586
+			if [[ $MODNAME == $PATCHNAME ]]; then
576586
+				MODULE="$i"
576586
+				break
576586
+			fi
576586
+		done
576586
+	fi
576586
+
576586
+	[[ ! -e $MODULE ]] && die "$PATCH is not installed for kernel $KVER"
576586
+	
576586
 
576586
 	echo "uninstalling $PATCH ($KVER)"
576586
-	rm -f $INSTALLDIR/$KVER/"$PATCH" || die "failed to uninstall module $PATCH"
576586
+	rm -f $MODULE || die "failed to uninstall module $PATCH"
576586
 	if lsinitrd -k $KVER &> /dev/null; then
576586
 		echo "rebuilding $KVER initramfs"
576586
 		dracut -f --kver $KVER || die "dracut failed"
576586
-- 
576586
1.9.3
576586