Skip to content

libalpm/scripts: Fix some issues with `kernellist`

Luke Shumaker requested to merge lukeshu/mkinitcpio:lukeshu/uki into master

An mkinitcpio .preset file's kver setting may either be a filepath to the kernel file or a kernel version number.

The libalpm hook script makes two mistakes there:

  • It assumes that it is always a filepath, and does not handle the case of it being a version number.

  • It assumes that it isn't just the pre-existing /usr/lib/modules/*/vmlinuz file (which is what the appropriate value to feed to mkinitcpio to build a UKI without having extra copies of the kernel sitting around).

So, before treating a kver value as a file that the script needs to do something with, first check that it's both an absolute path, and isn't the original /usr/lib/modules/*/vmlinuz file.

This will help folks who are only interested in UKI-based boot.

Signed-off-by: Luke T. Shumaker

Merge request reports