FS#75301 - [linux] Matching pkgver / kernel version

Attached to Project: Arch Linux
Opened by Max Gautier (VannTen) - Monday, 11 July 2022, 15:28 GMT
Last edited by Toolybird (Toolybird) - Monday, 08 August 2022, 04:15 GMT
Task Type Feature Request
Category Kernel
Status Closed
Assigned To No-one
Architecture All
Severity Very Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Hi,

I noticed while trying to get rid of /boot/vmlinux in mkinitcpio config, and use and explicit kernel version (the point is to use unified kernel images, without the need for vmlinux in boot), that there was not an obvious way to obtain it.
The linux package pkgver does not map to the kernel version (-> by that I mean the output of uname -r or the directory under /usr/lib/modules)


[max@work-laptop-max linux]$ uname -r
5.18.10-arch1-1
[max@work-laptop-max linux]$ ls /usr/lib/modules
5.18.10-arch1-1
[max@work-laptop-max linux]$ pacman -Q linux
linux 5.18.10.arch1-1


Could we patch the PKGBUILD or is it problematic (maybe related :  FS#73354  )

I can obviously sed my way out of this, but it does not feel very clean.

Alternatively, is there a better way to obtain the installed kernel version (the uname -r one) for a pkgbase ? (this is in the context of mkinitcpio hooks so uname -r does not cut it).

Thanks a lot :)
This task depends upon

Closed by  Toolybird (Toolybird)
Monday, 08 August 2022, 04:15 GMT
Reason for closing:  Won't implement
Comment by Toolybird (Toolybird) - Monday, 08 August 2022, 04:13 GMT
> Could we patch the PKGBUILD

It's not real clear what you're asking for but I'll note from the pkgver section in [1]:

"The variable is not allowed to contain colons, forward slashes, hyphens or whitespace."

so I don't think your request is feasible. sed is your best option.

[1] https://man.archlinux.org/man/PKGBUILD.5

Loading...