diff options
| author | An-Cheng Huang <ancheng@vyatta.com> | 2010-09-09 17:12:53 -0700 |
|---|---|---|
| committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-09-09 17:12:53 -0700 |
| commit | 573e21e410934f2293d5ac4c738af5f77083b43b (patch) | |
| tree | 006a2586447b7f2e9353556f74633db605436777 /kernel | |
| parent | 0de1ad17c333d645774ac3b48d652ccd4ecd6900 (diff) | |
| parent | 7a6f9e972def00f7f0435d9f2616bcb79dc619b7 (diff) | |
| download | initramfs-tools-573e21e410934f2293d5ac4c738af5f77083b43b.tar.gz initramfs-tools-573e21e410934f2293d5ac4c738af5f77083b43b.zip | |
Merge branch 'upstream' (0.98.2) into mendocino
Conflicts:
debian/changelog
debian/compat
debian/control
debian/rules
hook-functions
mkinitramfs
Diffstat (limited to 'kernel')
| -rwxr-xr-x | kernel/postinst.d/initramfs-tools | 31 | ||||
| -rwxr-xr-x | kernel/postrm.d/initramfs-tools | 29 |
2 files changed, 60 insertions, 0 deletions
diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools new file mode 100755 index 0000000..d4db23d --- /dev/null +++ b/kernel/postinst.d/initramfs-tools @@ -0,0 +1,31 @@ +#!/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 + # exit if custom kernel does not need an initramfs + [ "$INITRD" = 'No' ] && exit 0 + bootdir=$(dirname "$2") + bootopt="-b ${bootdir}" + else + # official Debian 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" != "configure" ]; then + exit 0 + fi +fi + +# we're good - create initramfs. update runs do_bootloader +update-initramfs -c -t -k "${version}" ${bootopt} >&2 diff --git a/kernel/postrm.d/initramfs-tools b/kernel/postrm.d/initramfs-tools new file mode 100755 index 0000000..4e8f73b --- /dev/null +++ b/kernel/postrm.d/initramfs-tools @@ -0,0 +1,29 @@ +#!/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 |
