From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from metis.ext.pengutronix.de ([92.198.50.35]:46972 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936302Ab0B0WDn (ORCPT ); Sat, 27 Feb 2010 17:03:43 -0500 Date: Sat, 27 Feb 2010 23:03:42 +0100 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: failure to remove+purge debian package generated by make deb-pkg Message-ID: <20100227220342.GC5760@pengutronix.de> References: <20100225213610.GA30380@pengutronix.de> <201002252329.12338.elendil@planet.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <201002252329.12338.elendil@planet.nl> Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Frans Pop Cc: linux-kbuild@vger.kernel.org, debian-kernel@lists.debian.org On Thu, Feb 25, 2010 at 11:29:11PM +0100, Frans Pop wrote: > Uwe Kleine-König wrote: > > I created and successfully installed a custom kernel package using > > $(make deb-pkg). > > > > Then after a failed boot test I removed it and then thought that I > > actually want to purge it. > > > > Cannot delete /boot/initrd.img-2.6.33-rc8-rt, doesn't exist. > > run-parts: /etc/kernel/postrm.d/initramfs-tools exited with return code 1 > > It has nothing to do with the kernel package itself. The problem is in the > maintainer scripts that are run as hooks from /etc/kernel/*.d. > > The kernel package built by deb-pkg does not have any maintainer scripts of > itself. All it does is run whatever is in the hooks. As custom kernels may > have other requirements than distro ones it's not surprising that the > distro hooks can throw errors [1]. > > Personally I use a set of custom hook scripts with my deb-pkg kernels. > Simply because I don't want to have to fix issues that are the result of > the distro hook scripts in /etc/kernel. > > You can simply use custom hook scripts by doing e.g: > export KDEB_HOOKDIR=/etc/kernel.custom > before calling 'make deb-pkg'. You can then create your own hook scripts > in /etc/kernel.custom/{pre,post}{inst,rm}.d/. Actually I think it would be nice if the default configuration just works. I did some research and I concluded it's the fault of /etc/kernel/postrm.d/initramfs-tools. I think it should have the following lines: # skip on purge [ "$DEB_MAINT_PARAMS" = "remove" ] || exit 0 I will report a bug against initramfs-tools. > [1] Although in this case I would say that the initrd could also simply be > removed using 'rm -f' so it does not fail if it does not exist. > You could file a BR against the package that installed that particular hook > script, probably initramfs-tools. Actually this is my problem, the hook fails because the initrd is missing. Best regards and thanks Uwe -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | http://www.pengutronix.de/ |