Bug 265594 - It’s hard to know what version of FreeBSD you are running (primarily a documentation issue)
Summary: It’s hard to know what version of FreeBSD you are running (primarily a docume...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: Gordon Bergling
URL:
Keywords:
Depends on:
Blocks: 265808
  Show dependency treegraph
 
Reported: 2022-08-03 10:41 UTC by Robert Watson
Modified: 2022-09-24 08:03 UTC (History)
7 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Watson freebsd_committer freebsd_triage 2022-08-03 10:41:40 UTC
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.
Comment 1 Vinícius Zavam freebsd_committer freebsd_triage 2022-08-04 12:01:33 UTC
would that help us a little bit? https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=251316 (Reported: 2020-11-22 16:59 UTC)
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2022-08-05 06:13:14 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:~ #
Comment 3 Vinícius Zavam freebsd_committer freebsd_triage 2022-08-14 08:19:45 UTC
FYI: we are just waiting for an Approval from 'src' to commit that revision tracked under https://reviews.freebsd.org/D27318
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-09-16 11:29:19 UTC
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(-)
Comment 5 commit-hook freebsd_committer freebsd_triage 2022-09-24 07:58:44 UTC
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(-)
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-09-24 08:00:46 UTC
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(-)