diff --git a/bin/freebsd-version/freebsd-version.1 b/bin/freebsd-version/freebsd-version.1 index b9f0861f890a..82ea9c707d69 100644 --- a/bin/freebsd-version/freebsd-version.1 +++ b/bin/freebsd-version/freebsd-version.1 @@ -1,131 +1,131 @@ .\"- .\" Copyright (c) 2013 Dag-Erling Smørgrav .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .Dd October 1, 2021 .Dt FREEBSD-VERSION 1 .Os .Sh NAME .Nm freebsd-version .Nd print the version and patch level of the installed system .Sh SYNOPSIS .Nm .Op Fl kru .Op Fl j Ar jail .Sh DESCRIPTION The .Nm utility makes a best effort to determine the version and patch level of the installed kernel and / or userland. .Pp The following options are available: .Bl -tag -width Fl .It Fl k Print the version and patch level of the installed kernel. Unlike .Xr uname 1 , if a new kernel has been installed but the system has not yet rebooted, .Nm will print the version and patch level of the new kernel. .It Fl r Print the version and patch level of the running kernel. Unlike .Xr uname 1 , 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. .It Fl j Ar jail Print the version and patch level of the installed userland in the given jail specified by .Va jid or .Va name . 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. .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. .Pp To determine the name (and hence the location) of a custom kernel, the .Nm utility will attempt to parse .Pa /boot/defaults/loader.conf and .Pa /boot/loader.conf , looking for definitions of the .Va kernel and .Va bootfile variables, both with a default value of .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 . .Sh ENVIRONMENT .Bl -tag -width ROOT .It Ev ROOT Path to the root of the filesystem in which to look for .Pa loader.conf and the kernel. .El .Sh EXAMPLES To determine the version of the currently running userland: .Bd -literal -offset indent /bin/freebsd-version -u .Ed .Pp -To inspect a system being repaired using a live CD: +To inspect a system being repaired using a live system: .Bd -literal -offset indent mount -rt ufs /dev/ada0p2 /mnt env ROOT=/mnt /mnt/bin/freebsd-version -ku .Ed .Sh SEE ALSO .Xr uname 1 , .Xr loader.conf 5 .Sh HISTORY The .Nm command appeared in .Fx 10.0 . .Sh AUTHORS The .Nm utility and this manual page were written by .An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org . diff --git a/usr.sbin/bsdinstall/startbsdinstall b/usr.sbin/bsdinstall/startbsdinstall index af0fd56e73b3..63239c969ac6 100644 --- a/usr.sbin/bsdinstall/startbsdinstall +++ b/usr.sbin/bsdinstall/startbsdinstall @@ -1,111 +1,111 @@ #!/bin/sh : ${BSDDIALOG_OK=0} : ${BSDDIALOG_CANCEL=1} : ${BSDDIALOG_HELP=2} : ${BSDDIALOG_EXTRA=3} : ${BSDDIALOG_ESC=5} : ${BSDDIALOG_ERROR=255} kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs TERM=xterm # Don't send ESC on function-key 62/63 (left/right command key) kbdcontrol -f 62 '' > /dev/null 2>&1 kbdcontrol -f 63 '' > /dev/null 2>&1 if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system # goes multiuser touch /tmp/bsdinstall_log tail -f /tmp/bsdinstall_log > /dev/ttyv2 & /usr/libexec/getty autologin ttyv3 & EXTERNAL_VTY_STARTED=1 fi else # Serial or other console echo echo "Welcome to FreeBSD!" echo echo "Please choose the appropriate terminal type for your system." echo "Common console types are:" echo " ansi Standard ANSI terminal" echo " vt100 VT100 or compatible terminal" echo " xterm xterm terminal emulator (or compatible)" echo echo -n "Console type [vt100]: " read TERM TERM=${TERM:-vt100} fi export TERM # Query terminal size; useful for serial lines. resizewin -z if [ -f /etc/installerconfig ]; then if [ "$1" != "primary" ]; then bsddialog --backtitle "FreeBSD Installer" --title "Installing" --msgbox "FreeBSD is being installed from a script; please use the primary console." 0 0 . "$0" elif bsdinstall script /etc/installerconfig; then bsddialog --backtitle "FreeBSD Installer" --title "Complete" --no-cancel --ok-label "Reboot" --pause "Installation of FreeBSD complete! Rebooting in 10 seconds" 10 30 10 reboot else bsddialog --backtitle "FreeBSD Installer" --title "Error" --textbox /tmp/bsdinstall_log 0 0 fi exit fi -bsddialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live CD" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live CD?" 0 0 +bsddialog --backtitle "FreeBSD Installer" --title "Welcome" --extra-button --extra-label "Shell" --ok-label "Install" --cancel-label "Live System" --yesno "Welcome to FreeBSD! Would you like to begin an installation or use the live system?" 0 0 case $? in $BSDDIALOG_OK) # Install # If not netbooting, have the installer configure the network dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null` if [ ${dlv:=0} -eq 0 -a ! -f /etc/diskless ]; then BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT fi trap true SIGINT # Ignore cntrl-C here bsdinstall if [ $? -eq 0 ]; then - bsddialog --backtitle "FreeBSD Installer" --title "Complete" --ok-label "Reboot" --extra-button --extra-label "Shutdown" --cancel-label "Live CD" --yesno "Installation of FreeBSD complete! Would you like to reboot into the installed system now?" 0 0 + bsddialog --backtitle "FreeBSD Installer" --title "Complete" --ok-label "Reboot" --extra-button --extra-label "Shutdown" --cancel-label "Live System" --yesno "Installation of FreeBSD complete! Would you like to reboot into the installed system now?" 0 0 case $? in $BSDDIALOG_OK) # Reboot reboot ;; $BSDDIALOG_EXTRA) # Shutdown shutdown -p now # shutdown(8) daemonizes, with the actual signal to # init(8) happening in the child, but if we exit the # script then runconsoles will clean up its children # thinking we're trying to go multiuser (and if the # user has disabled multiple console support we'll # still start trying to go multi-user, which gives # confusing output on the console if the daemon is slow # to run). Thus we spin while the daemon runs. while true; do sleep 1 done ;; - $BSDDIALOG_CANCEL) # Live CD + $BSDDIALOG_CANCEL) # Live System exit 0 ;; esac else . "$0" fi ;; -$BSDDIALOG_CANCEL) # Live CD +$BSDDIALOG_CANCEL) # Live System exit 0 ;; $BSDDIALOG_EXTRA) # Shell clear echo "When finished, type 'exit' to return to the installer." /bin/sh . "$0" ;; esac