You are not logged in.
I just had a minor question about the difference between the version number shown in the package details versus the actual kernel version displayed by "uname -r". I use a small bash script that compares the version reported by pacman -Qi linux to uname -r, and if they differ it tells me i need to restart my computer to load the upgraded kernel. With the latest 6.7 release however, the output of pacman -Qi linux is "6.7.arch3-1" while the output of uname -r is "6.7.0-arch3-1". So it looks like they're effectively the same version but the versioning format is different. I mostly just want to know if this is intentional or not. If this is intentional, I'm not sure how I would parse one of or both version strings to determine if they're actually equivalent or not, but any suggestions would be greatly appreciated.
Thanks,
viperzer0
Offline
It's intentional, in the sense that this has been how previous kernels with a zero revision number have been named.
However I'd say it is a bug as it breaks versioning if a '.' is put in place of the '-'. For example, it is reasonable that 6.7.0-arch3-1 could be considered equal to 6.7-arch3-1, but when the first dash changes to a dot it completely breaks monotonic version numbering as "arch3" becomes the revision number.
Or in other words, if the `uname -r` format was used, the presence of absence of the terminal zero shouldn't matter. But in the package name format, it does.
(note: I'm using "revision number" here to refer to the third element of a version number as in Major.Minor.Revision, not the package revision number which is appended later.)
Last edited by Trilby (2024-01-18 00:46:21)
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
Definitely an interesting choice. Thanks for the clarification though, I was having a hard time finding any documentation on the Linux kernel's versioning schema, so I wasn't sure if it warranted a bug report or anything like that. I'll probably just disable the version check until another update rolls around. Thanks!
Offline
Or just write a smarter version check. You already had to account for the difference between the dot and dash, this shouldn't be any harder.
"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" - Richard Stallman
Offline
I was having a hard time finding any documentation on the Linux kernel's versioning schema, so I wasn't sure if it warranted a bug report or anything like that.
6.7 is the upstream tag https://git.kernel.org/pub/scm/linux/ke … ag/?h=v6.7 and also KERNELVERSION omits including SUBLEVEL if it is 0 https://git.kernel.org/pub/scm/linux/ke … =v6.7#n361.
Offline
I've used both pacman to list the files of linux and filter them (below), and used the find command +(lazy hack) to compare the running (uname -r) vs installed kernel versions in a script.
$ pacman -Qlq linux | awk -F/ '/usr\/lib\/modules\/[0-9]/ {print $5; exit}'
6.7.0-arch3-1
$ find /usr/lib/modules -maxdepth 1 -printf "%f\n" | grep -v modules | sort | tail -n1
6.7.0-arch3-1
$ uname -r
6.7.0-arch3-1
$ pacman -Q linux
linux 6.7.arch3-1
These may also have pitfalls, but it's only used to provide info and haven't noticed anything unusual.
Last edited by NuSkool (2024-01-21 01:20:38)
Offline