Your IP : 216.73.216.170


Current Path : /etc/kernel/postrm.d/
Upload File :
Current File : //etc/kernel/postrm.d/initramfs-tools

#!/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
		# official linux-images take care themself
		exit 0
	fi
fi

# avoid running multiple times
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} >&2