Skip to content

Commit

Permalink
scripts/prune-kernel: Use kernel-install if available
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Reza Arbab authored and Masahiro Yamada committed May 11, 2022
1 parent f774f5b commit 5d53508
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/prune-kernel
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ do
rm -f "/boot/initramfs-$f.img" "/boot/System.map-$f"
rm -f "/boot/vmlinuz-$f" "/boot/config-$f"
rm -rf "/lib/modules/$f"
new-kernel-pkg --remove $f
if [ -x "$(command -v new-kernel-pkg)" ]; then
new-kernel-pkg --remove $f
elif [ -x "$(command -v kernel-install)" ]; then
kernel-install remove $f
fi
fi
done

0 comments on commit 5d53508

Please sign in to comment.