freebsd-version and uname discrepancies after freebsd-update 12.2



Reaction score: 3
Messages: 30

I have a number of system recently update (via source) to 12.2 p10 (amd64). uname -a and freebsd-version -rku all agree the system is 12.2-RELEASE-p10. I've been trying to force myself to use freebsd-update (with boot environments) to simplify and speed-up upgrading. After updating to p11 using freebsd-update uname -a reports I've regressed to 12.2-RELEASE-p7 and freebsd-version -rku reports 12.2-RELEASE-p7, 12.2-RELEASE-p7, 12.2-RELEASE-p11.

I've read the man pages of both uname() and freebsd-version() I am none the wiser. How can a boot environment derived from 12.2 p10 now report as 12.2 p7? How does one know (definitely) what one is running? I thought that's what freebsd-version is for? These systems run in a heterogeneous *nix environment and uname is used by monitoring / reporting agents and now apparently report misleading/erroneous information.

Thanks in advance!



Reaction score: 515
Messages: 1,040

for binary upgrades 7,7,11 is ok
for source upgrade /sys/conf/ it seems to create a patch level string as the userland version
so it seems PL for userland and kernel are synced for source upgrades and not for binary upgrades


Staff member

Reaction score: 13,071
Messages: 39,685

The binary update didn't include a rebuild kernel, so that still has the 'old' p7 version string baked in. The version string is set at compile time, if you rebuild your kernel (for whatever reason) the version from sys/conf/ is compiled in. It would then show a p11 kernel. A p7 kernel is fine, the last couple of security and errata updates only involved the userland.