Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754155AbcCBPJa (ORCPT ); Wed, 2 Mar 2016 10:09:30 -0500 Received: from mail-ob0-f174.google.com ([209.85.214.174]:34924 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751205AbcCBPJ2 (ORCPT ); Wed, 2 Mar 2016 10:09:28 -0500 MIME-Version: 1.0 In-Reply-To: <56D6FAD3.3000208@stressinduktion.org> References: <56D6FAD3.3000208@stressinduktion.org> Date: Wed, 2 Mar 2016 10:09:27 -0500 X-Google-Sender-Auth: cPaz3wXG0BiBWrn00DBylSx08uI Message-ID: Subject: Re: [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal From: Josh Boyer To: Hannes Frederic Sowa Cc: Paolo Abeni , "Linux-Kernel@Vger. Kernel. Org" , "linux-kbuild@vger.kernel.org" , Michal Marek Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1615 Lines: 45 On Wed, Mar 2, 2016 at 9:38 AM, Hannes Frederic Sowa wrote: > 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? new-kernel-pkg probably shouldn't be used here either. The installkernel binary is the distro agnostic kernel installation tool and the various distros provide that as either the tool they use or as a wrapper. Switching to new-kernel-pkg implies this would only be viable on grubby based distros, and using kernel-install would require systemd. josh