summaryrefslogtreecommitdiff
path: root/kernel/postinst.d/initramfs-tools
diff options
context:
space:
mode:
authormaximilian attems <maks@debian.org>2009-09-25 02:34:14 +0200
committermaximilian attems <maks@debian.org>2009-09-25 07:54:24 +0200
commit072ad3179c526b90b57719e127de851182b04c4c (patch)
treecc831350f6c32e87c1d24da7121163af21fcd706 /kernel/postinst.d/initramfs-tools
parent919c099e12308729a9a6bc141eab1f05532c93f8 (diff)
downloadinitramfs-tools-072ad3179c526b90b57719e127de851182b04c4c.tar.gz
initramfs-tools-072ad3179c526b90b57719e127de851182b04c4c.zip
/etc/kernel hook script support newer kernel-package
k-p no longer generates initramfs by itself, so do it for it. (closes: #523735)
Diffstat (limited to 'kernel/postinst.d/initramfs-tools')
-rwxr-xr-xkernel/postinst.d/initramfs-tools25
1 files changed, 21 insertions, 4 deletions
diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools
index 1cb72a8..b389921 100755
--- a/kernel/postinst.d/initramfs-tools
+++ b/kernel/postinst.d/initramfs-tools
@@ -1,10 +1,27 @@
#!/bin/sh
+version="$1"
+bootopt=""
+
# passing the kernel version is required
-[ -z "$1" ] && exit 0
+[ -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
-# kernel-package passes an extra arg; hack to not run under kernel-package
-[ -z "$2" ] || exit 0
+if [ -n "$DEB_MAINT_PARAMS" ]; then
+ eval set -- "$DEB_MAINT_PARAMS"
+ if [ -z "$1" ] || [ "$1" != "configure" ]; then
+ exit 0
+ fi
+fi
# we're good - create initramfs. update runs do_bootloader
-update-initramfs -c -t -k "$1"
+update-initramfs -c -t -k "${version}" ${bootopt}