End users often want to know what version of FreeBSD they are running. But understanding what version is being used is quite hard once you’ve used freebsd-update, as the documentation and tooling is inconsistent and/or has gaps: - The uname(1) man page represents that the “-r” argument will "Write the current release level of the operating system to standard output.”. However, that is actually the value of the OS version returned by kern.osrelease, which may not be the version you have installed via freebsd-update. - The freebsd-version(1) command will tell you the version you have installed. But it is not cross-referenced from uname(1), even thought freebsd-version(1) cross references uname(1). - The freebsd-update(8) command has no way to print the current version -- e.g., “status” or “version” that I can find, and it would be the most obvious place to look to find out the installed version. It cross references neither uname(1) nor freebsd-version(1). Obviously, the notion of “version” is complex, but some effort has been gone to to neatly hide the complexity of that idea in the freebsd-version(1) command. It seems like it would be good to: 1. Make sure freebsd-version(1) is well cross referenced from other tools that relate to OS version (e.g., uname(1), freebsd-update(8)). 2. To make that version information easy to get via update management tools, such as freebsd-update(8), which might ideally wrap freebsd-version(1) to provide a “version” or “status” mode. 3. To slightly clarify in uname(1) that “-r” is not exactly the “current release level” as most users would imagine such a term to mean.
would that help us a little bit? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251316 (Reported: 2020-11-22 16:59 UTC)
(In reply to Robert Watson from comment #0) NAME freebsd-update – fetch and install binary updates to FreeBSD … DESCRIPTION The freebsd-update tool is used to fetch, install, and rollback binary updates to the FreeBSD base system. … Given the name and description (above), I think that telling the version alone – _without_ any update-related action – is out of scope for freebsd-update(8). > … no way to print the current version … The version and patch level can be found in response to: freebsd-update fetch ---- root@fuji:~ # freebsd-update fetch Looking up update.FreeBSD.org mirrors... 2 mirrors found. Fetching metadata signature for 13.1-RELEASE from update1.freebsd.org... done. Fetching metadata index... done. Inspecting system... done. Preparing to download files... done. No updates needed to update system to 13.1-RELEASE-p0. root@fuji:~ # freebsd-version -kru 13.1-RELEASE 13.1-RELEASE 13.1-RELEASE root@fuji:~ #
FYI: we are just waiting for an Approval from 'src' to commit that revision tracked under https://reviews.freebsd.org/D27318
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=8f98a937ed726399b89e87e95769a9adc809281a commit 8f98a937ed726399b89e87e95769a9adc809281a Author: Gordon Bergling <gbe@FreeBSD.org> AuthorDate: 2022-09-16 11:27:54 +0000 Commit: Gordon Bergling <gbe@FreeBSD.org> CommitDate: 2022-09-16 11:27:54 +0000 uname.1: Clarify the -r option It is some times hard to understand the difference between kernel version and userland version. So clarify the -r option of uname(1) in terms of a printed kernel version. While here, add some cross references: - cross reference freebsd-version(1) in uname(1) - cross reference freebsd-version(1) and uname(1) in freebsd-update(8) PR: 265594 Reported by: rwatson Reviewed by: gbe, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36516 usr.bin/uname/uname.1 | 7 +++++-- usr.sbin/freebsd-update/freebsd-update.8 | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=e267c40181bf71927bd9df8ee6f3019e8ffd8743 commit e267c40181bf71927bd9df8ee6f3019e8ffd8743 Author: Gordon Bergling <gbe@FreeBSD.org> AuthorDate: 2022-09-16 11:27:54 +0000 Commit: Gordon Bergling <gbe@FreeBSD.org> CommitDate: 2022-09-24 07:57:44 +0000 uname.1: Clarify the -r option It is some times hard to understand the difference between kernel version and userland version. So clarify the -r option of uname(1) in terms of a printed kernel version. While here, add some cross references: - cross reference freebsd-version(1) in uname(1) - cross reference freebsd-version(1) and uname(1) in freebsd-update(8) PR: 265594 Reported by: rwatson Reviewed by: gbe, imp Differential Revision: https://reviews.freebsd.org/D36516 (cherry picked from commit 8f98a937ed726399b89e87e95769a9adc809281a) usr.bin/uname/uname.1 | 7 +++++-- usr.sbin/freebsd-update/freebsd-update.8 | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-)
A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=893f5116171817998264d29dc3dd31325bcb8483 commit 893f5116171817998264d29dc3dd31325bcb8483 Author: Gordon Bergling <gbe@FreeBSD.org> AuthorDate: 2022-09-16 11:27:54 +0000 Commit: Gordon Bergling <gbe@FreeBSD.org> CommitDate: 2022-09-24 08:00:19 +0000 uname.1: Clarify the -r option It is some times hard to understand the difference between kernel version and userland version. So clarify the -r option of uname(1) in terms of a printed kernel version. While here, add some cross references: - cross reference freebsd-version(1) in uname(1) - cross reference freebsd-version(1) and uname(1) in freebsd-update(8) PR: 265594 Reported by: rwatson Reviewed by: gbe, imp Differential Revision: https://reviews.freebsd.org/D36516 (cherry picked from commit 8f98a937ed726399b89e87e95769a9adc809281a) usr.bin/uname/uname.1 | 7 +++++-- usr.sbin/freebsd-update/freebsd-update.8 | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-)