Biosias / uefi-mkconfig

grub-mkconfig inspired script for automatically managing uefi entries for booting linux kernel directly without bootloader
Apache License 2.0
7 stars 3 forks source link

Use version-sort for kernel images #2

Closed arkamar closed 5 months ago

arkamar commented 5 months ago

Regular sort works correctly only for versions with the same amount of digits in each segment. Using -V parameter ensures that versions are sorted numerically, which is more appropriate for kernel images.

For example:

$ echo kernel-6.7.{8..11}.efi | xargs -n1 | sort -r
kernel-6.7.9.efi
kernel-6.7.8.efi
kernel-6.7.11.efi
kernel-6.7.10.efi

$ echo kernel-6.7.{8..11}.efi | xargs -n1 | sort -rV
kernel-6.7.11.efi
kernel-6.7.10.efi
kernel-6.7.9.efi
kernel-6.7.8.efi
arkamar commented 5 months ago

Ah, ok, this wasn't obvious to me.

Biosias commented 5 months ago

Thanks! Will finish few more changes myself and will release new version.