[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#600937: marked as done (Please disable /etc/kernel postinst hook if the target kernel is non-modular)



Your message dated Wed, 1 Jun 2011 17:10:13 +0200
with message-id <20110601151012.GK5391@stro.at>
and subject line Re: Please disable /etc/kernel postinst hook if the target kernel is non-modular
has caused the Debian Bug report #600937,
regarding Please disable /etc/kernel postinst hook if the target kernel is non-modular
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
600937: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=600937
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: initramfs-tools
Version: 0.98.4
Severity: minor
Tags: patch

If I try to install a non-modular kernel
/etc/kernel/postinst.d/initramfs-tools tries to build an initrd image
and fails, because no modules are found. Please apply the attached patch
(or a similar one) to disable it for that case.

Thanks,

Guido
>From 9f638f2eabb49da543ca153f6649601630c7f478 Mon Sep 17 00:00:00 2001
From: Guido Trotter <ultrotter@debian.org>
Date: Thu, 21 Oct 2010 16:58:53 +0100
Subject: [PATCH] Don't try build initramfs on non-modular kernel

If the kernel is build without modules support (for example for a
virtual machine) then there's no point in trying to build an initrd
image.

Signed-off-by: Guido Trotter <ultrotter@debian.org>
---
 kernel/postinst.d/initramfs-tools |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/kernel/postinst.d/initramfs-tools b/kernel/postinst.d/initramfs-tools
index d4db23d..d820a55 100755
--- a/kernel/postinst.d/initramfs-tools
+++ b/kernel/postinst.d/initramfs-tools
@@ -27,5 +27,12 @@ if [ -n "$DEB_MAINT_PARAMS" ]; then
 	fi
 fi
 
+# don't run on a non-modular kernel
+if [ -f "/boot/config-$version" ]; then
+	if grep -vq "CONFIG_MODULES=y" /boot/config-$version; then
+		exit 0
+	fi
+fi
+
 # we're good - create initramfs.  update runs do_bootloader
 update-initramfs -c -t -k "${version}" ${bootopt} >&2
-- 
1.7.1


--- End Message ---
--- Begin Message ---
Version: 0.99

If INITRD is set to 'No', postinst hook just exits, thus closing.

thank you for your report.

-- 
maks


--- End Message ---

Reply to: