summaryrefslogtreecommitdiffstats
path: root/kernel_remove_initrd
diff options
context:
space:
mode:
Diffstat (limited to 'kernel_remove_initrd')
-rw-r--r--kernel_remove_initrd37
1 files changed, 37 insertions, 0 deletions
diff --git a/kernel_remove_initrd b/kernel_remove_initrd
new file mode 100644
index 0000000..8ce8d8b
--- /dev/null
+++ b/kernel_remove_initrd
@@ -0,0 +1,37 @@
+#!/bin/sh
+#--------------------------------------------------------------------
+# Copyright (C) 2003 by Mandriva,
+# Juan Quintela <quintela@mandriva.com>,
+# Redistribution of this file is permitted under the terms of the GNU
+# Public License (GPL)
+#--------------------------------------------------------------------
+# $Id: kernel_remove_initrd 31366 2006-05-11 12:45:38Z tvignaud $
+#--------------------------------------------------------------------
+## description:
+# Remove initrd at uninstall time
+
+function usage () {
+cat << EOF >&2
+Usage: ${0##*/} KERNEL_VERSION [BOOTDIR]
+
+ removes initrd for that kernel version if it exists.
+EOF
+exit 2
+}
+
+
+version=$1
+
+if [[ -z "$version" ]];then
+ usage;
+fi
+
+[[ -n $2 ]] && boot=$2 || boot=/boot
+
+cd $boot
+
+if [ -f initrd-${version}.img ];then
+ rm -f initrd-${version}.img
+fi
+
+exit 0