summaryrefslogtreecommitdiffstats
path: root/kernel_remove_initrd
blob: 8ce8d8ba639dc88ec9e3236fe3c60d62dd8c35be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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