summaryrefslogtreecommitdiff
path: root/kernel/postrm.d/initramfs-tools
blob: 359a2263b6c8cc22a0e47accb8cf2218f6d5771b (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
#!/bin/sh

version="$1"
bootopt=""

# passing the kernel version is required
[ -z "${version}" ] && exit 0

# kernel-package passes an extra arg
if [ -n "$2" ]; then
	if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then
		${bootdir}= $(dirname "$2")
		bootopt="-b ${bootdir}"
	else
		exit 0
	fi
fi

if [ -n "$DEB_MAINT_PARAMS" ]; then
	eval set -- "$DEB_MAINT_PARAMS"
	if [ -z "$1" ] || [ "$1" != "remove" ]; then
		exit 0
	fi
fi

# delete initramfs
update-initramfs -d -t -k "${version}" ${bootopt}