Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753986AbcCBOiQ (ORCPT ); Wed, 2 Mar 2016 09:38:16 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:55191 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752379AbcCBOiO (ORCPT ); Wed, 2 Mar 2016 09:38:14 -0500 X-Sasl-enc: wa4YBVCdFQecSFN43IK7vPRsjk9wuYD8KYltICVXbdUK 1456929493 Subject: Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal To: Paolo Abeni , linux-kernel@vger.kernel.org References: Cc: linux-kbuild@vger.kernel.org, Michal Marek From: Hannes Frederic Sowa Message-ID: <56D6FAD3.3000208@stressinduktion.org> Date: Wed, 2 Mar 2016 15:38:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1144 Lines: 33 On 02.03.2016 15:28, Paolo Abeni wrote: > This patch add a rpm preuninstall scriptlet to cleanup the > boot loader configuration on kernel package uninstall. > The initrd for the to-be-removed kernel is deleted, too. > > Signed-off-by: Paolo Abeni > --- > scripts/package/mkspec | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/scripts/package/mkspec b/scripts/package/mkspec > index fe44d68..b6de63c 100755 > --- a/scripts/package/mkspec > +++ b/scripts/package/mkspec > @@ -138,6 +138,11 @@ echo "/sbin/installkernel $KERNELRELEASE /boot/.vmlinuz-$KERNELRELEASE-rpm /boot > echo "rm -f /boot/.vmlinuz-$KERNELRELEASE-rpm /boot/.System.map-$KERNELRELEASE-rpm" > echo "fi" > echo "" > +echo "%preun" > +echo "if [ -x /sbin/new-kernel-pkg ]; then" > +echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd --initrdfile=/boot/initramfs-$KERNELRELEASE.img" > +echo "fi" > +echo "" > echo "%files" > echo '%defattr (-, root, root)' > echo "/lib/modules/$KERNELRELEASE" > Maybe we should also switch to new-kernel-pkg for the postinstall call? How about switching to kernel-install? Thanks, Hannes