Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scripts/prune-kernel: Use kernel-install if available

If the new-kernel-pkg utility isn't present, try using kernel-install.
This is what the %preun scriptlet in scripts/package/mkspec does too.

Signed-off-by: Reza Arbab <arbab@linux.ibm.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Reza Arbab and committed by
Masahiro Yamada
5d53508d f774f5bb

+5 -1
+5 -1
scripts/prune-kernel
··· 16 16 rm -f "/boot/initramfs-$f.img" "/boot/System.map-$f" 17 17 rm -f "/boot/vmlinuz-$f" "/boot/config-$f" 18 18 rm -rf "/lib/modules/$f" 19 - new-kernel-pkg --remove $f 19 + if [ -x "$(command -v new-kernel-pkg)" ]; then 20 + new-kernel-pkg --remove $f 21 + elif [ -x "$(command -v kernel-install)" ]; then 22 + kernel-install remove $f 23 + fi 20 24 fi 21 25 done