Bug#582776: initramfs-tools: pointless generation of an initrd for initrd-free custom kernels
Package: initramfs-tools
Version: 0.94.4
While installing a locally-built kernel (which doesn't require an initrd), I
found that /etc/kernel/postinst.d/initramfs-tools was nevertheless generating
an initrd for that kernel.
This causes breakage here. I'm using lilo and a slightly-modified
version of the example symlink_hook script provided by kernel-package; if an
initrd is present, the symlink name is different. (I'm using the symlinks so
that I don't have to edit lilo.conf.)
(I also have a stock kernel installed for occasional testing purposes.
Mostly, I just use my custom kernels.)
I find this sufficient to handle packages generated by kernel-package:
--- /etc/kernel/postinst.d/initramfs-tools~ 2010-04-08 04:53:09.000000000 +0100
+++ /etc/kernel/postinst.d/initramfs-tools 2010-05-23 15:06:44.114662432 +0100
@@ -11,6 +11,10 @@
if [ -n "${KERNEL_PACKAGE_VERSION}" ]; then
bootdir=$(dirname "$2")
bootopt="-b ${bootdir}"
+ # check whether an initrd is needed
+ if ! grep -q '^CONFIG_BLK_DEV_INITRD=y$' /boot/config-"$1"; then
+ exit 0
+ fi
else
# official Debian linux-images take care themself
exit 0
--
| Darren Salt | linux at youmustbejoking | nr. Ashington, | Toon
| using Debian GNU/Linux | or ds ,demon,co,uk | Northumberland | back!
| + http://www.youmustbejoking.demon.co.uk/ & http://tartarus.org/ds/
If you cast your bread upon the waters, it will return soggy.
Reply to: