diff options
author | Jiri Kosina <jkosina@suse.cz> | 2016-04-07 09:00:54 -0400 |
---|---|---|
committer | Michal Marek <mmarek@suse.com> | 2016-04-20 04:01:30 -0400 |
commit | 27c3bffd230abd0a598586aed0fe0ba7b61e0e2e (patch) | |
tree | f1f2c3b14d6de2dd5aa8971494245b35d30ef5ff | |
parent | f931362b38191016b7a6dc31d90a515b37658e02 (diff) |
kbuild/mkspec: support 'update-bootloader'-based systems
When uninstalling kernel RPM, we're unconditionally calling
"new-kernel-pkg --remove". This is useless on systems which are based on
'update-bootloader' script instead.
Support update-bootloader removal method as well in case the script is
present; contrary to new-kernel-pkg, this needs to be done in %postun,
otherwise update-bootloader will refuse to remove entry for kernel for
which the binary still exists.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Michal Marek <mmarek@suse.com>
-rwxr-xr-x | scripts/package/mkspec | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/package/mkspec b/scripts/package/mkspec index b6de63cb3f23..57673bae5597 100755 --- a/scripts/package/mkspec +++ b/scripts/package/mkspec | |||
@@ -143,6 +143,11 @@ echo "if [ -x /sbin/new-kernel-pkg ]; then" | |||
143 | echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd --initrdfile=/boot/initramfs-$KERNELRELEASE.img" | 143 | echo "new-kernel-pkg --remove $KERNELRELEASE --rminitrd --initrdfile=/boot/initramfs-$KERNELRELEASE.img" |
144 | echo "fi" | 144 | echo "fi" |
145 | echo "" | 145 | echo "" |
146 | echo "%postun" | ||
147 | echo "if [ -x /sbin/update-bootloader ]; then" | ||
148 | echo "/sbin/update-bootloader --remove $KERNELRELEASE" | ||
149 | echo "fi" | ||
150 | echo "" | ||
146 | echo "%files" | 151 | echo "%files" |
147 | echo '%defattr (-, root, root)' | 152 | echo '%defattr (-, root, root)' |
148 | echo "/lib/modules/$KERNELRELEASE" | 153 | echo "/lib/modules/$KERNELRELEASE" |