base-files: vkpurge: fix for empty /boot

On system with empty /boot (example: /boot on external device and not
mounted:
* `vkpurge list` reports `*`, which is incorrect, and
* `vkpurge rm all` run `remove_kernel` for all file names in $PWD,
  this will normally harmless except when efibootmgr is used and some
  files with special name, let's say "V" "o" "i" "d" in $PWD, then,
  efibootmgr will remove all boot entries.

Fix it by checking for `vmlinu[xz]-*` explicitly.
A sane system shouldn't have that file.
This commit is contained in:
Đoàn Trần Công Danh 2020-04-05 13:33:50 +07:00 committed by Juan RP
parent 7dc957f419
commit b650ceec66
2 changed files with 3 additions and 2 deletions

View file

@ -29,6 +29,7 @@ list_kernels() {
kver=${k##*-} kver=${k##*-}
case "$kver" in case "$kver" in
"$running") ;; "$running") ;;
"*") ;; # /boot isn't mounted -> no vmlinu[xz]
$pattern) printf "%s\n" "$kver" ;; $pattern) printf "%s\n" "$kver" ;;
esac esac
done done

View file

@ -1,7 +1,7 @@
# Template file for 'base-files' # Template file for 'base-files'
pkgname=base-files pkgname=base-files
version=0.140 version=0.141
revision=12 revision=1
bootstrap=yes bootstrap=yes
depends="xbps-triggers" depends="xbps-triggers"
short_desc="Void Linux base system files" short_desc="Void Linux base system files"