summaryrefslogtreecommitdiffstats
path: root/kernel_remove_initrd
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-07-31 13:40:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-07-31 13:40:27 +0000
commitc30a5b7b690021bc7228775dbb90ecf20e1bd9df (patch)
tree802aca388b1995d2842fb0c547e4671fffb4d8b9 /kernel_remove_initrd
downloadbootloader-utils-c30a5b7b690021bc7228775dbb90ecf20e1bd9df.tar
bootloader-utils-c30a5b7b690021bc7228775dbb90ecf20e1bd9df.tar.gz
bootloader-utils-c30a5b7b690021bc7228775dbb90ecf20e1bd9df.tar.bz2
bootloader-utils-c30a5b7b690021bc7228775dbb90ecf20e1bd9df.tar.xz
bootloader-utils-c30a5b7b690021bc7228775dbb90ecf20e1bd9df.zip
restore after the big svn loss
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