diff --git a/usr.sbin/bsdinstall/scripts/auto b/usr.sbin/bsdinstall/scripts/auto --- a/usr.sbin/bsdinstall/scripts/auto +++ b/usr.sbin/bsdinstall/scripts/auto @@ -160,7 +160,7 @@ if [ -n "$DISTMENU" ]; then exec 5>&1 - EXTRA_DISTS=$( eval bsddialog \ + EXTRA_DISTS=$( eval $DIALOG \ --backtitle \"$OSNAME Installer\" \ --title \"Distribution Select\" --nocancel --separate-output \ --checklist \"Choose optional system components to install:\" \ @@ -180,7 +180,7 @@ done if [ -n "$FETCH_DISTRIBUTIONS" -a -n "$BSDINSTALL_CONFIGCURRENT" ]; then - bsddialog --backtitle "$OSNAME Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 + $DIALOG --backtitle "$OSNAME Installer" --title "Network Installation" --msgbox "Some installation files were not found on the boot volume. The next few screens will allow you to configure networking so that they can be downloaded from the Internet." 0 0 bsdinstall netconfig || error NETCONFIG_DONE=yes fi @@ -305,7 +305,7 @@ esac exec 5>&1 - PARTMODE=`echo $PMODES | xargs -o bsddialog --backtitle "$OSNAME Installer" \ + PARTMODE=`echo $PMODES | xargs -o $DIALOG --backtitle "$OSNAME Installer" \ --title "Partitioning" \ --item-help \ --menu "How would you like to partition your disk?" \ @@ -369,7 +369,7 @@ [ -z "$BSDINSTALL_SKIP_SERVICES" ] && bsdinstall services [ -z "$BSDINSTALL_SKIP_HARDENING" ] && bsdinstall hardening -[ -z "$BSDINSTALL_SKIP_USERS" ] && bsddialog --backtitle "$OSNAME Installer" \ +[ -z "$BSDINSTALL_SKIP_USERS" ] && $DIALOG --backtitle "$OSNAME Installer" \ --title "Add User Accounts" --yesno \ "Would you like to add users to the installed system now?" 0 0 && \ bsdinstall adduser @@ -387,7 +387,7 @@ [ -f /usr/libexec/bsdinstall/local.post-configure ] && f_dprintf "Running local.post-configure" && sh /usr/libexec/bsdinstall/local.post-configure "$BSDINSTALL_CHROOT" if [ -z "$BSDINSTALL_SKIP_MANUAL" ]; then - bsddialog --backtitle "$OSNAME Installer" --title "Manual Configuration" \ + $DIALOG --backtitle "$OSNAME Installer" --title "Manual Configuration" \ --default-no --yesno \ "The installation is now finished. Before exiting the installer, would you like to open a shell in the new system to make any final manual modifications?" 0 0 if [ $? -eq 0 ]; then diff --git a/usr.sbin/bsdinstall/scripts/checksum b/usr.sbin/bsdinstall/scripts/checksum --- a/usr.sbin/bsdinstall/scripts/checksum +++ b/usr.sbin/bsdinstall/scripts/checksum @@ -30,6 +30,8 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +: ${DIALOG="bsddialog"} + dist_to_statusvar() { printf 'status_' @@ -45,7 +47,7 @@ for i in $DISTRIBUTIONS; do items="$items $i `eval echo \\\${$(dist_to_statusvar $i):--11}`" done - bsddialog --backtitle "$OSNAME Installer" --title "Checksum Verification" \ + $DIALOG --backtitle "$OSNAME Installer" --title "Checksum Verification" \ --mixedgauge "\nVerifying checksums of selected distributions.\n" \ 0 0 $percentage -- $items @@ -72,11 +74,11 @@ eval "$statusvar=-2" case $(/bin/freebsd-version -u) in *-ALPHA*|*-CURRENT|*-STABLE|*-PRERELEASE) - bsddialog --backtitle "$OSNAME Installer" --title "Error" \ + $DIALOG --backtitle "$OSNAME Installer" --title "Error" \ --msgbox "The checksum for $dist does not match. It may have become corrupted, or it may be from a newer version of $OSNAME. Please check for a newer snapshot." 0 0 ;; *) - bsddialog --backtitle "$OSNAME Installer" --title "Error" \ + $DIALOG --backtitle "$OSNAME Installer" --title "Error" \ --msgbox "The checksum for $dist does not match. It may have become corrupted, and should be redownloaded." 0 0 ;; esac diff --git a/usr.sbin/bsdinstall/scripts/fetchmissingdists b/usr.sbin/bsdinstall/scripts/fetchmissingdists --- a/usr.sbin/bsdinstall/scripts/fetchmissingdists +++ b/usr.sbin/bsdinstall/scripts/fetchmissingdists @@ -30,9 +30,11 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +: ${DIALOG="bsddialog"} + error() { - bsddialog --backtitle "$OSNAME Installer" --title "Error" --msgbox "$1" 0 0 + $DIALOG --backtitle "$OSNAME Installer" --title "Error" --msgbox "$1" 0 0 exit 1 } @@ -81,7 +83,7 @@ VERIFY_MANIFEST_SIG=1 # XXX actually verify signature on manifest - bsddialog --backtitle "$OSNAME Installer" --title "Warning" --msgbox "Manifest not found on local disk and will be fetched from an unverified source. This is a potential security risk. If you do not wish to proceed, press control-C now." 0 0 + $DIALOG --backtitle "$OSNAME Installer" --title "Warning" --msgbox "Manifest not found on local disk and will be fetched from an unverified source. This is a potential security risk. If you do not wish to proceed, press control-C now." 0 0 fi if [ ! -z "$LOCAL_DISTRIBUTIONS" ]; then diff --git a/usr.sbin/bsdinstall/scripts/finalconfig b/usr.sbin/bsdinstall/scripts/finalconfig --- a/usr.sbin/bsdinstall/scripts/finalconfig +++ b/usr.sbin/bsdinstall/scripts/finalconfig @@ -31,10 +31,11 @@ . $BSDCFG_SHARE/common.subr || exit 1 : ${BSDDIALOG_OK=0} +: ${DIALOG="bsddialog"} while true; do exec 5>&1 - REVISIT=$(bsddialog --backtitle "$OSNAME Installer" \ + REVISIT=$($DIALOG --backtitle "$OSNAME Installer" \ --title "Final Configuration" --ok-label "Select" \ --cancel-label "Finish" --default-no --menu \ "Setup of your $OSNAME system is nearly complete. You can now modify your configuration choices. After this screen, you will have an opportunity to make more complex changes using a shell." 0 0 0 \ diff --git a/usr.sbin/bsdinstall/scripts/hardening b/usr.sbin/bsdinstall/scripts/hardening --- a/usr.sbin/bsdinstall/scripts/hardening +++ b/usr.sbin/bsdinstall/scripts/hardening @@ -29,13 +29,14 @@ . $BSDCFG_SHARE/common.subr || exit 1 : ${BSDDIALOG_OK=0} +: ${DIALOG="bsddialog"} echo -n > $BSDINSTALL_TMPETC/rc.conf.hardening echo -n > $BSDINSTALL_TMPETC/sysctl.conf.hardening echo -n > $BSDINSTALL_TMPBOOT/loader.conf.hardening exec 5>&1 -FEATURES=$( bsddialog --backtitle "$OSNAME Installer" \ +FEATURES=$( $DIALOG --backtitle "$OSNAME Installer" \ --title "System Hardening" --nocancel --separate-output \ --checklist "Choose system security hardening options:" \ 0 0 0 \ diff --git a/usr.sbin/bsdinstall/scripts/jail b/usr.sbin/bsdinstall/scripts/jail --- a/usr.sbin/bsdinstall/scripts/jail +++ b/usr.sbin/bsdinstall/scripts/jail @@ -34,6 +34,7 @@ ############################################################ MAIN : ${BSDDIALOG_OK=0} +: ${DIALOG="bsddialog"} f_dprintf "Began Installation at %s" "$( date )" @@ -42,7 +43,7 @@ if [ -n "$1" ]; then msg="$1\n\n" fi - bsddialog --backtitle "$OSNAME Installer" --title "Abort" \ + $DIALOG --backtitle "$OSNAME Installer" --title "Abort" \ --no-label "Exit" --yes-label "Restart" --yesno \ "${msg}An installation step has been aborted. Would you like to restart the installation or exit the installer?" 0 0 if [ $? -ne $BSDDIALOG_OK ]; then @@ -92,7 +93,7 @@ if [ ! "$nonInteractive" == "YES" ] then exec 5>&1 - EXTRA_DISTS=$(echo $DISTMENU | xargs -o bsddialog \ + EXTRA_DISTS=$(echo $DISTMENU | xargs -o $DIALOG \ --backtitle "$OSNAME Installer" \ --title "Distribution Select" --no-cancel --separate-output \ --checklist "Choose optional system components to install:" \ @@ -139,7 +140,7 @@ then bsdinstall services - bsddialog --backtitle "$OSNAME Installer" --title "Add User Accounts" --yesno \ + $DIALOG --backtitle "$OSNAME Installer" --title "Add User Accounts" --yesno \ "Would you like to add users to the installed system now?" 0 0 && \ bsdinstall adduser fi diff --git a/usr.sbin/bsdinstall/scripts/mirrorselect b/usr.sbin/bsdinstall/scripts/mirrorselect --- a/usr.sbin/bsdinstall/scripts/mirrorselect +++ b/usr.sbin/bsdinstall/scripts/mirrorselect @@ -34,9 +34,10 @@ : ${BSDDIALOG_EXTRA=3} : ${BSDDIALOG_ESC=5} : ${BSDDIALOG_ERROR=255} +: ${DIALOG="bsddialog"} exec 5>&1 -MIRROR=`bsddialog --backtitle "$OSNAME Installer" \ +MIRROR=`$DIALOG --backtitle "$OSNAME Installer" \ --title "Mirror Selection" --extra-button --extra-label "Other" \ --menu "Please select the best suitable site for you or \"other\" if you want to specify a different choice. The \"Main Site\" directs users to the nearest project managed mirror via GeoDNS (they carry the full range of possible distributions and support both IPv4 and IPv6). All other sites are known as \"Community Mirrors\"; not every site listed here carries more than the base distribution kits. Select a site!" \ 0 0 16 \ @@ -113,7 +114,7 @@ ;; $BSDDIALOG_EXTRA) exec 5>&1 - BSDINSTALL_DISTSITE=`bsddialog --backtitle "$OSNAME Installer" \ + BSDINSTALL_DISTSITE=`$DIALOG --backtitle "$OSNAME Installer" \ --title "Mirror Selection" \ --inputbox "Please enter the URL to an alternate $OSNAME mirror:" \ 0 74 "$BSDINSTALL_DISTSITE" 2>&1 1>&5` diff --git a/usr.sbin/bsdinstall/scripts/mount b/usr.sbin/bsdinstall/scripts/mount --- a/usr.sbin/bsdinstall/scripts/mount +++ b/usr.sbin/bsdinstall/scripts/mount @@ -28,6 +28,8 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +: ${DIALOG="bsddialog"} + TMP_FSTAB=${TMPDIR:-"/tmp"}/bsdinstall-tmp-fstab cat $PATH_FSTAB | awk -v BSDINSTALL_CHROOT=$BSDINSTALL_CHROOT '{ @@ -46,7 +48,7 @@ mkdir -p $i 2>/dev/null MNTERROR=`mount -F $TMP_FSTAB $i 2>&1` if [ $? -ne 0 ]; then - bsddialog --backtitle "$OSNAME Installer" --title "Error" \ + $DIALOG --backtitle "$OSNAME Installer" --title "Error" \ --msgbox "Error mounting partition $i:\n$MNTERROR" 0 0 exit 1 fi diff --git a/usr.sbin/bsdinstall/scripts/netconfig b/usr.sbin/bsdinstall/scripts/netconfig --- a/usr.sbin/bsdinstall/scripts/netconfig +++ b/usr.sbin/bsdinstall/scripts/netconfig @@ -42,6 +42,7 @@ : ${BSDDIALOG_EXTRA=3} : ${BSDDIALOG_ESC=5} : ${BSDDIALOG_ERROR=255} +: ${DIALOG="bsddialog"} for IF in `ifconfig -l`; do test "$IF" = "lo0" && continue @@ -66,19 +67,19 @@ done if [ -z "$INTERFACES" ]; then - bsddialog --backtitle "$OSNAME Installer" \ + $DIALOG --backtitle "$OSNAME Installer" \ --title 'Network Configuration' \ --msgbox 'No network interfaces present to configure.' 0 0 exit 1 fi exec 5>&1 -INTERFACE=$(echo $BSDDIALOG_ITEMS | xargs -o bsddialog \ +INTERFACE=$(echo $BSDDIALOG_ITEMS | xargs -o $DIALOG \ --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --ok-label 'Auto' --extra-button --extra-label 'Manual' \ --menu 'Please select a network interface and configuration mode:' 0 0 0 2>&1 1>&5) # xargs collapses exit codes to 0/1 (ignoring signals and 255), so exploit -# bsddialog output being empty when cancelling to distinguish Manual (Extra) +# $DIALOG output being empty when cancelling to distinguish Manual (Extra) # from Cancel. if [ $? -eq $BSDDIALOG_OK ]; then AUTO=auto @@ -118,7 +119,7 @@ AUTO_FAIL= if [ ${IPV4_AVAIL} -eq 1 -a -z "$AUTO" ]; then - bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ + $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --yesno 'Would you like to configure IPv4 for this interface?' 0 0 if [ $? -ne $BSDDIALOG_OK ]; then IPV4_AVAIL=0 @@ -140,7 +141,7 @@ sysrc -f $BSDINSTALL_TMPETC/._rc.conf.net ifconfig_$INTERFACE="${IFCONFIG_PREFIX}" fi if [ ${IPV6_AVAIL} -eq 1 -a -z "$AUTO" ]; then - bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ + $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --yesno 'Would you like to configure IPv6 for this interface?' 0 0 if [ $? -ne $BSDDIALOG_OK ]; then IPV6_AVAIL=0 @@ -210,7 +211,7 @@ 'IPv4 DNS #2' 3 1 \"${IP4_2}\" 3 16 16 16 0" else if [ -n "$AUTO_FAIL" ]; then - bsddialog --backtitle "$OSNAME Installer" \ + $DIALOG --backtitle "$OSNAME Installer" \ --msgbox "Failed to automatically configure interface (tried $AUTO_FAIL)." 0 0 exec $0 fi @@ -220,11 +221,11 @@ # Auto only guaranteed to have IPv4 and/or IPv6 address; may not have # nameserver available if [ -n "$AUTO" ] && [ -n "${IP4_1}" -o -n "${IP6_1}" ]; then - # Convert from bsddialog arguments to default output + # Convert from $DIALOG arguments to default output RESOLV=$(echo "${RESOLV}" | xargs -n9 sh -c 'echo "$4"' '') else exec 5>&1 - RESOLV=$(echo "${RESOLV}" | xargs -o bsddialog --backtitle "$OSNAME Installer" \ + RESOLV=$(echo "${RESOLV}" | xargs -o $DIALOG --backtitle "$OSNAME Installer" \ --title 'Network Configuration' \ --mixedform 'Resolver Configuration' 0 0 0 \ 2>&1 1>&5) diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 b/usr.sbin/bsdinstall/scripts/netconfig_ipv4 --- a/usr.sbin/bsdinstall/scripts/netconfig_ipv4 +++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv4 @@ -43,7 +43,7 @@ AUTO="${3:-}" test -z "$IFCONFIG_PREFIX" || IFCONFIG_PREFIX="$2 " case "${INTERFACE}" in -"") bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ +"") $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --msgbox 'No interface specified for IPv4 configuration.' 0 0 exit 1 ;; @@ -52,7 +52,7 @@ ""|auto) ;; *) - bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ + $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --msgbox "Bad auto option '$AUTO'." 0 0 exit 1 ;; @@ -61,7 +61,7 @@ if [ -n "$AUTO" ]; then DHCP=1 else - bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 + $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' --yesno 'Would you like to use DHCP to configure this interface?' 0 0 if [ $? -eq $BSDDIALOG_OK ]; then DHCP=1 else @@ -74,14 +74,14 @@ # dhclient does not build a new resolv.conf (see PR262262). ifconfig $INTERFACE down ifconfig $INTERFACE up - bsddialog --backtitle "$OSNAME Installer" --infobox "Acquiring DHCP lease..." 0 0 + $DIALOG --backtitle "$OSNAME Installer" --infobox "Acquiring DHCP lease..." 0 0 err=$( pkill -F /var/run/dhclient/dhclient.${INTERFACE}.pid; dhclient $INTERFACE 2>&1 ) if [ $? -ne 0 ]; then f_dprintf "%s" "$err" if [ -n "$AUTO" ]; then exit 1 fi - bsddialog --backtitle "$OSNAME Installer" --msgbox "DHCP lease acquisition failed." 0 0 + $DIALOG --backtitle "$OSNAME Installer" --msgbox "DHCP lease acquisition failed." 0 0 exec $0 ${INTERFACE} "${IFCONFIG_PREFIX}" fi fi @@ -94,7 +94,7 @@ ROUTER=`netstat -rn -f inet | awk '/default/ {printf("%s\n", $2);}'` exec 5>&1 -IF_CONFIG=$(bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' --form 'Static Network Interface Configuration' 0 0 0 \ +IF_CONFIG=$($DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' --form 'Static Network Interface Configuration' 0 0 0 \ 'IP Address' 1 1 "$IP_ADDRESS" 1 20 16 0 \ 'Subnet Mask' 2 1 "$NETMASK" 2 20 16 0 \ 'Default Router' 3 1 "$ROUTER" 3 20 16 0 \ diff --git a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 b/usr.sbin/bsdinstall/scripts/netconfig_ipv6 --- a/usr.sbin/bsdinstall/scripts/netconfig_ipv6 +++ b/usr.sbin/bsdinstall/scripts/netconfig_ipv6 @@ -50,7 +50,7 @@ INTERFACE=$1 AUTO="${2:-}" case "${INTERFACE}" in -"") bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ +"") $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --msgbox 'No interface specified for IPv6 configuration.' 0 0 exit 1 ;; @@ -59,7 +59,7 @@ ""|auto) ;; *) - bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ + $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --msgbox "Bad auto option '$AUTO'." 0 0 exit 1 ;; @@ -71,7 +71,7 @@ SLAAC=1 else MSG="Would you like to try stateless address autoconfiguration (SLAAC)${AGAIN}?" - bsddialog --backtitle "$OSNAME Installer" --title 'Network Configuration' \ + $DIALOG --backtitle "$OSNAME Installer" --title 'Network Configuration' \ --yesno "${MSG}" 0 0 if [ $? -eq $BSDDIALOG_OK ]; then SLAAC=1 @@ -81,7 +81,7 @@ fi if [ $SLAAC -eq 1 ]; then if [ ! -z $BSDINSTALL_CONFIGCURRENT ]; then - bsddialog --backtitle "$OSNAME Installer" \ + $DIALOG --backtitle "$OSNAME Installer" \ --infobox "Sending Router Solicitation ..." 0 0 ifconfig ${INTERFACE} inet6 -ifdisabled accept_rtadv up err=$( rtsol -F $INTERFACE 2>&1 ) @@ -90,7 +90,7 @@ if [ -n "$AUTO" ]; then exit 1 fi - bsddialog --backtitle "$OSNAME Installer" --msgbox "SLAAC failed." 0 0 + $DIALOG --backtitle "$OSNAME Installer" --msgbox "SLAAC failed." 0 0 AGAIN=" again" continue fi @@ -130,7 +130,7 @@ }'` exec 5>&1 -IF_CONFIG=$(echo ${ADDRS} | xargs -o bsddialog --backtitle "$OSNAME Installer" \ +IF_CONFIG=$(echo ${ADDRS} | xargs -o $DIALOG --backtitle "$OSNAME Installer" \ --title 'Network Configuration' \ --mixedform 'Static IPv6 Network Interface Configuration' 0 0 0 \ 2>&1 1>&5) diff --git a/usr.sbin/bsdinstall/scripts/services b/usr.sbin/bsdinstall/scripts/services --- a/usr.sbin/bsdinstall/scripts/services +++ b/usr.sbin/bsdinstall/scripts/services @@ -29,6 +29,7 @@ . $BSDCFG_SHARE/common.subr || exit 1 : ${BSDDIALOG_OK=0} +: ${DIALOG="bsddialog"} if [ -f $BSDINSTALL_TMPETC/rc.conf.services ]; then eval "$( sed -E -e 's/\<(YES|AUTO)\>/on/i' -e 's/\/off/i' \ @@ -41,7 +42,7 @@ echo -n > $BSDINSTALL_TMPETC/rc.conf.services exec 5>&1 -DAEMONS=$( bsddialog --backtitle "$OSNAME Installer" \ +DAEMONS=$( $DIALOG --backtitle "$OSNAME Installer" \ --title "System Configuration" --no-cancel --separate-output \ --checklist "Choose the services you would like to be started at boot:" \ 0 0 0 \ diff --git a/usr.sbin/bsdinstall/scripts/time b/usr.sbin/bsdinstall/scripts/time --- a/usr.sbin/bsdinstall/scripts/time +++ b/usr.sbin/bsdinstall/scripts/time @@ -28,6 +28,8 @@ BSDCFG_SHARE="/usr/share/bsdconfig" . $BSDCFG_SHARE/common.subr || exit 1 +: ${DIALOG="bsddialog"} + # Switch to target timezone saved_TZ="$TZ" TZ="${BSDINSTALL_CHROOT}/etc/localtime" @@ -35,7 +37,7 @@ # Set date exec 5>&1 -DATE=$(bsddialog --backtitle "$OSNAME Installer" \ +DATE=$($DIALOG --backtitle "$OSNAME Installer" \ --title 'Time & Date' \ --ok-label 'Set Date' \ --cancel-label 'Skip' \ @@ -47,7 +49,7 @@ # Set time exec 5>&1 -TIME=$(bsddialog --backtitle "$OSNAME Installer" \ +TIME=$($DIALOG --backtitle "$OSNAME Installer" \ --title 'Time & Date' \ --ok-label 'Set Time' \ --cancel-label 'Skip' \