Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freebsd-version.1: corrections and suggested improvements #1319

Closed
55 changes: 32 additions & 23 deletions bin/freebsd-version/freebsd-version.1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd October 1, 2021
.Dd July 6, 2024
.Dt FREEBSD-VERSION 1
.Os
.Sh NAME
Expand All @@ -37,10 +37,10 @@
The
.Nm
utility makes a best effort to determine the version and patch level
of the installed kernel and / or userland.
of the kernel and / or userland.
.Pp
The following options are available:
.Ss Options
.Bl -tag -width Fl

Check warning on line 43 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
.It Fl k
Print the version and patch level of the installed kernel.
Unlike
Expand All @@ -56,9 +56,7 @@
this is unaffected by environment variables.
.It Fl u
Print the version and patch level of the installed userland.
These are hardcoded into
.Nm
during the build.
The same information will be printed if no option is specified.
.It Fl j Ar jail
Print the version and patch level of the installed userland in the
given jail specified by
Expand All @@ -68,25 +66,30 @@
This option can be specified multiple times.
.El
.Pp
If several of the above options are specified,
.Nm
will print the installed kernel version first, then the running kernel
version, next the userland version, and finally the userland version
of the specified jails, on separate lines.
If neither is specified, it will print the userland version only.
If multiple options are specified, information will be in a preset
order (regardless of user-specified order):
.Pp
.Bl -dash -compact
.It

Check warning on line 73 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
installed kernel
.It
running kernel
.It
userland
.It
jail userland.
.El
.Sh IMPLEMENTATION NOTES
The
.Nm
utility should provide the correct answer in the vast majority of
cases, including on systems kept up-to-date using
.Xr freebsd-update 8 ,
which does not update the kernel version unless the kernel itself was
affected by the latest patch.
should provide the correct answer in the vast majority of cases,

Check warning on line 84 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
including those where
.Xr freebsd-update 8
changes the patch level of the kernel but not userland (or vice versa).
.Pp

Check failure on line 88 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

trailing whitespace
To determine the name (and hence the location) of a custom kernel, the
To determine the name (and hence the location) of a custom kernel,
.Nm
utility will attempt to parse
will attempt to parse
.Pa /boot/defaults/loader.conf

Check warning on line 92 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
and
.Pa /boot/loader.conf ,
looking for definitions of the
Expand All @@ -97,8 +100,12 @@
.Dq kernel .
It may however fail to locate the correct kernel if either or both of
these variables are defined in a non-standard location, such as in
.Pa /boot/loader.rc .

Check warning on line 103 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
.Pp
Userland information is hardcoded into
.Nm
at build time.
.Sh ENVIRONMENT

Check warning on line 108 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
.Bl -tag -width ROOT
.It Ev ROOT
Path to the root of the filesystem in which to look for
Expand All @@ -106,25 +113,27 @@
and the kernel.
.El
.Sh EXAMPLES
To determine the version of the currently running userland:
Show userland information alone, without specifying option
.Fl u :
.Bd -literal -offset indent
/bin/freebsd-version -u
freebsd-version
.Ed
.Pp

Check warning on line 121 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
To inspect a system being repaired using a live system:
.Bd -literal -offset indent

Check warning on line 123 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
mount -rt ufs /dev/ada0p2 /mnt
env ROOT=/mnt /mnt/bin/freebsd-version -ku
.Ed
.Sh SEE ALSO
.Xr uname 1 ,
.Xr freebsd-update 8 ,
.Xr loader.conf 5
.Sh HISTORY
The
.Nm

Check warning on line 133 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
command appeared in
utility first appeared in
.Fx 10.0 .
.Sh AUTHORS

Check warning on line 136 in bin/freebsd-version/freebsd-version.1

View workflow job for this annotation

GitHub Actions / Style Checker

Missing Signed-off-by: line
The
.Nm
utility and this manual page were written by
Expand Down
Loading