linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal
@ 2016-03-02 14:28 Paolo Abeni
  2016-03-02 14:38 ` Hannes Frederic Sowa
  2016-03-04 21:59 ` Michal Marek
  0 siblings, 2 replies; 6+ messages in thread
From: Paolo Abeni @ 2016-03-02 14:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-kbuild, Michal Marek, Hannes Frederic Sowa

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 <pabeni@redhat.com>
---
 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"
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-03-04 21:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-02 14:28 [PATCH] kbuild/mkspec: clean boot loader configuration on rpm removal Paolo Abeni
2016-03-02 14:38 ` Hannes Frederic Sowa
2016-03-02 15:09   ` Josh Boyer
2016-03-03  9:09     ` Paolo Abeni
2016-03-04 21:55       ` Michal Marek
2016-03-04 21:59 ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).