367 lines
11 KiB
Plaintext
Raw Normal View History

#!/bin/sh
#-
# Copyright (c) 2011 Nathan Whitehorn
2016-12-08 19:28:12 +00:00
# Copyright (c) 2013-2016 Devin Teske
# 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.
#
# $FreeBSD$
A series of changes tested together as a whole: + Add a `-D FILE" command-line option for overriding the path to the bsdinstall log file (BSDINSTALL_LOG env var). + Document new `-D FILE' in the man page for bsdinstall. + If FILE in `-D FILE' begins with a +, debug output goes to stdout (interleaved between dialog(1) invocations/output) as well as to FILE (minus the leading + of course). + If BSDINSTALL_LOG cannot be written, then debugging is disabled (except in the case of a leading + in the pathname, wherein debug will still be printed to stdout). + Update source code formatting style. + Fix a dangling participle ("Begun ..." -> "Began ...") + Rewrite the docsinstall script (was necessary to abate direct dependency on BSDINSTALL_LOG (instead, use fault-tolerant bsdconfig framework which displays appropriate errors for package management). NB: docsinstall is still using pkg(8) after this change. + Add additional debug output for dhclient/rtsol/wpa_cliscan + Display script errors in a textbox rather than just on stdout + Update many coments. + Add new f_show_err() API call (like f_show_msg but changes the dialog title to "Error")(see bsdconfig's `common.subr'). + Add new f_eval_catch() API call for executing a command via eval but not before logging the command to debug. Several example cases documented in API header for function in bsdconfig's `common.subr'. + Fix dialog auto-sizing when launched as an rvalue to a pipe for indirected scripts (previously would default to 24x80 sizing in this case, now it can autosize to full size even when in a pipe chain). + Fix bug in f_snprintf if $format argument began with "-"; printf would misinterpret as a flag. (this is in bsdcofig's `strings.subr'). + Add accompanying f_sprintf() and f_vsprintf() to go along with already existing f_snprintf() and f_vsnprintf() (see bsdconfig's `strings.subr'). + Remove some unnecessary default ZFS datasets from the automatic "zfsboot" script. Such as: /usr/ports/distfiles /usr/ports/packages /usr/obj /var/db /var/empty /var/mail and /var/run (these can all be created as-needed once the system is installed). + Remove setuid=off for /usr/home (as discussed from last round of CFT). + Fix some i18n string violations in "zfsboot". + Bolster debugging output in "zfsboot". + Fix some string quoting issues in "zfsboot". + Fix some variable scope issues in "zfsboot". + Change "Create" to "Install" in "zfsboot" main menu. + Increase error checking in "zfsboot" (type-check arguments and such). + Add call to "graid destroy" killing automatic metadata (part of the series of pedantic destructions we do when bootstrapping a new/naked disk). + Make judicious use of new f_eval_catch() in "zfsboot". + Fixup some variable names for consistency (zfsboot). + Fix an underride syntax parameter expansion folly (zfsboot). + Confirm layout if not explicitly chosen when blindly proceeding (no longer have to touch anything on the ZFS menu if it scares you, just choose the omnibus "Install" option at the top and you'll be prompted to select vdev type and disks in the layout confirmation dialog). + Change numbered menu items to alphabetic for more efficient navigation. + Consolidate vdev selection and disk selection into a single stateful menu which performs validation and allows backing out to each previous menu as you go deeper. + Redesign the ``Last Chance'' dialog (still using the same colors, but make it conform to a tolerable width and make disks appear in a block- quote style indented region). + Fix a bug wherein we used the a lowercase variable name by accident (actual variable name declared as all-uppercase) at the time of initializing fstab(5) (not believed to cause any issues though). + Update the geli setup infobox for each provider being initialized (not just at the onset -- since each ``geli init'' causes kernel messages to push our infobox off-screen). Reviewed by: Allan Jude <freebsd@allanjude.com> Discussed on: -current MFC after: 3 days
2013-11-08 09:57:03 +00:00
#
############################################################ INCLUDES
BSDCFG_SHARE="/usr/share/bsdconfig"
. $BSDCFG_SHARE/common.subr || exit 1
f_include $BSDCFG_SHARE/dialog.subr
2016-12-12 19:01:04 +00:00
f_dialog_backtitle "FreeBSD Installer"
A series of changes tested together as a whole: + Add a `-D FILE" command-line option for overriding the path to the bsdinstall log file (BSDINSTALL_LOG env var). + Document new `-D FILE' in the man page for bsdinstall. + If FILE in `-D FILE' begins with a +, debug output goes to stdout (interleaved between dialog(1) invocations/output) as well as to FILE (minus the leading + of course). + If BSDINSTALL_LOG cannot be written, then debugging is disabled (except in the case of a leading + in the pathname, wherein debug will still be printed to stdout). + Update source code formatting style. + Fix a dangling participle ("Begun ..." -> "Began ...") + Rewrite the docsinstall script (was necessary to abate direct dependency on BSDINSTALL_LOG (instead, use fault-tolerant bsdconfig framework which displays appropriate errors for package management). NB: docsinstall is still using pkg(8) after this change. + Add additional debug output for dhclient/rtsol/wpa_cliscan + Display script errors in a textbox rather than just on stdout + Update many coments. + Add new f_show_err() API call (like f_show_msg but changes the dialog title to "Error")(see bsdconfig's `common.subr'). + Add new f_eval_catch() API call for executing a command via eval but not before logging the command to debug. Several example cases documented in API header for function in bsdconfig's `common.subr'. + Fix dialog auto-sizing when launched as an rvalue to a pipe for indirected scripts (previously would default to 24x80 sizing in this case, now it can autosize to full size even when in a pipe chain). + Fix bug in f_snprintf if $format argument began with "-"; printf would misinterpret as a flag. (this is in bsdcofig's `strings.subr'). + Add accompanying f_sprintf() and f_vsprintf() to go along with already existing f_snprintf() and f_vsnprintf() (see bsdconfig's `strings.subr'). + Remove some unnecessary default ZFS datasets from the automatic "zfsboot" script. Such as: /usr/ports/distfiles /usr/ports/packages /usr/obj /var/db /var/empty /var/mail and /var/run (these can all be created as-needed once the system is installed). + Remove setuid=off for /usr/home (as discussed from last round of CFT). + Fix some i18n string violations in "zfsboot". + Bolster debugging output in "zfsboot". + Fix some string quoting issues in "zfsboot". + Fix some variable scope issues in "zfsboot". + Change "Create" to "Install" in "zfsboot" main menu. + Increase error checking in "zfsboot" (type-check arguments and such). + Add call to "graid destroy" killing automatic metadata (part of the series of pedantic destructions we do when bootstrapping a new/naked disk). + Make judicious use of new f_eval_catch() in "zfsboot". + Fixup some variable names for consistency (zfsboot). + Fix an underride syntax parameter expansion folly (zfsboot). + Confirm layout if not explicitly chosen when blindly proceeding (no longer have to touch anything on the ZFS menu if it scares you, just choose the omnibus "Install" option at the top and you'll be prompted to select vdev type and disks in the layout confirmation dialog). + Change numbered menu items to alphabetic for more efficient navigation. + Consolidate vdev selection and disk selection into a single stateful menu which performs validation and allows backing out to each previous menu as you go deeper. + Redesign the ``Last Chance'' dialog (still using the same colors, but make it conform to a tolerable width and make disks appear in a block- quote style indented region). + Fix a bug wherein we used the a lowercase variable name by accident (actual variable name declared as all-uppercase) at the time of initializing fstab(5) (not believed to cause any issues though). + Update the geli setup infobox for each provider being initialized (not just at the onset -- since each ``geli init'' causes kernel messages to push our infobox off-screen). Reviewed by: Allan Jude <freebsd@allanjude.com> Discussed on: -current MFC after: 3 days
2013-11-08 09:57:03 +00:00
2016-12-08 19:28:12 +00:00
############################################################ FUNCTIONS
country_set()
{
2016-12-12 18:21:56 +00:00
local error_str iface_up ifconfig_args=
2016-12-12 18:05:54 +00:00
#
# Setup what was selected
2016-12-12 18:05:54 +00:00
# NB: Do not change order of arguments (or regdomain will be ignored)
#
[ "$2" ] && ifconfig_args="$ifconfig_args country $2"
[ "$1" ] && ifconfig_args="$ifconfig_args regdomain $1"
[ "$ifconfig_args" ] || return $SUCCESS # Nothing to do
ifconfig_args="${ifconfig_args# }"
# Regdomain/country cannot be applied while interface is running
2016-12-12 22:57:07 +00:00
iface_up=$( ifconfig -lu | grep -w "$WLAN_IFACE" )
[ "$iface_up" ] && ifconfig "$WLAN_IFACE" down
f_eval_catch -dk error_str wlanconfig ifconfig "ifconfig %s %s" \
"$WLAN_IFACE" "$ifconfig_args"
error_str="${error_str#ifconfig: }"
# Restart wpa_supplicant(8) (should not fail).
[ "$iface_up" ] && f_eval_catch -d wlanconfig wpa_supplicant \
'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
"$WLAN_IFACE" "$BSDINSTALL_TMPETC"
if [ "$error_str" ]; then
$DIALOG \
2016-12-12 21:23:47 +00:00
--title "$msg_error" \
--backtitle "$DIALOG_BACKTITLE" \
--yes-label Change \
--no-label Ignore \
--yesno \
"Error while applying chosen settings ($error_str)" \
0 0 || return $SUCCESS # Skip
return $FAILURE # Restart
else
awk 'sub(/^\t\t/,"")||1' \
> "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF
create_args_$WLAN_IFACE="$ifconfig_args"
EOF
fi
return $SUCCESS
}
dialog_country_select()
{
local input regdomains countries regdomain country prompt
local no_default="<not selected>"
local default_regdomain="${1:-$no_default}"
local default_country="${2:-$no_default}"
2016-12-12 18:05:54 +00:00
#
# Parse available countries/regdomains
2016-12-12 18:05:54 +00:00
#
2016-12-12 22:57:07 +00:00
input=$( ifconfig "$WLAN_IFACE" list countries | sed -e 's/DEBUG//gi' )
regdomains=$( echo "$input" | awk '
sub(/.*domains:/, ""), /[^[:alnum:][[:space:]]/ {
n = split($0, domains)
for (i = 1; i <= n; i++)
printf "'\''%s'\'' '\'\''", domains[i]
}
2016-12-13 01:36:46 +00:00
' | sort )
countries=$( echo "$input" | awk '
sub(/Country codes:/, ""), sub(/Regulatory.*/, "") {
while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) {
country = substr($0, RSTART)
sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country)
code = substr(country, 1, 2)
desc = substr(country, 4)
sub(/[[:space:]]*$/, "", desc)
printf "'\''%s'\'' '\''%s'\''\n", code, desc
$0 = substr($0, RSTART + RLENGTH)
}
}
' | sort )
f_dialog_title "Regdomain selection"
prompt="Select your regdomain."
eval f_dialog_menu_size height width rows \
\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
\"\$prompt\" \"\" $regdomains
regdomain=$( eval $DIALOG \
2016-12-13 01:39:09 +00:00
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
--cancel-label \"\$msg_skip\" \
--default-item \"\$default_regdomain\" \
2016-12-13 01:39:09 +00:00
--menu \"\$prompt\" \
$height $width $rows \
$regdomains \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
2016-12-12 18:52:22 +00:00
)
f_dialog_data_sanitize regdomain
f_dialog_title "Country selection"
prompt="Select your country."
eval f_dialog_menu_size height width rows \
\"\$DIALOG_TITLE\" \"\$DIALOG_BACKTITLE\" \
\"\$prompt\" \"\" $countries
country=$( eval $DIALOG \
2016-12-13 01:39:09 +00:00
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
--cancel-label \"\$msg_skip\" \
--default-item \"\$default_country\" \
2016-12-13 01:39:09 +00:00
--menu \"\$prompt\" \
$height $width $rows \
$countries \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
2016-12-12 18:52:22 +00:00
)
f_dialog_data_sanitize country
country_set "$regdomain" "$country"
}
2016-12-08 19:28:12 +00:00
############################################################ MAIN
: > "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf"
2016-12-08 19:28:12 +00:00
cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1
EOF
2016-12-08 19:28:12 +00:00
2016-12-12 18:05:54 +00:00
#
2016-12-08 19:28:12 +00:00
# Try to reach wpa_supplicant. If it isn't running and we can modify the
# existing system, start it. Otherwise, fail.
2016-12-12 18:05:54 +00:00
#
if ! f_eval_catch -d wlanconfig wpa_cli "wpa_cli ping"; then
if [ ! "$BSDINSTALL_CONFIGCURRENT" ]; then
f_show_err "Wireless cannot be configured without %s" \
"making changes to the local system!"
exit 1
fi
f_eval_catch wlanconfig wpa_supplicant \
'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \
"$1" "$BSDINSTALL_TMPETC" || exit 1
2016-12-08 19:28:12 +00:00
2016-12-13 02:45:07 +00:00
# See if we succeeded
f_eval_catch wlanconfig wpa_cli "wpa_cli ping" || exit 1
2016-12-08 19:28:12 +00:00
fi
2016-12-12 18:05:54 +00:00
#
# There is no way to check country/regdomain without (possible)
# interface state modification
2016-12-12 18:05:54 +00:00
#
if [ "$BSDINSTALL_CONFIGCURRENT" ]; then
# Get current country/regdomain for selected interface
WLAN_IFACE=$( wpa_cli ifname | tail -n 1 )
INPUT=$( ifconfig "$WLAN_IFACE" list regdomain | head -n 1 )
2016-12-13 01:44:18 +00:00
DEF_REGDOMAIN=$( echo "$INPUT" | cut -w -f 2 )
DEF_COUNTRY=$( echo "$INPUT" | cut -w -f 4 )
2016-12-12 18:34:21 +00:00
[ "$DEF_REGDOMAIN" = 0 ] && DEF_REGDOMAIN="<not selected>"
[ "$DEF_COUNTRY" = 0 ] && DEF_COUNTRY="<not selected>"
f_dialog_title "Regdomain/country"
2016-12-13 02:46:36 +00:00
if f_yesno "Change regdomain/country ($DEF_REGDOMAIN/$DEF_COUNTRY)?"
then
while ! dialog_country_select "$DEF_REGDOMAIN" "$DEF_COUNTRY"
do :; done
fi
fi
2016-12-12 18:52:22 +00:00
while :; do
SCANSSID=0
f_eval_catch -d wlanconfig wpa_cli "wpa_cli scan"
f_dialog_title "Scanning"
f_dialog_pause "Waiting 5 seconds to scan for wireless networks..." 5 ||
exit 1
f_eval_catch -dk SCAN_RESULTS wlanconfig wpa_cli "wpa_cli scan_results"
NETWORKS=$( echo "$SCAN_RESULTS" | awk -F '\t' '
/..:..:..:..:..:../ && $5 { printf "\"%s\"\t\"%s\"\n", $5, $4 }
' | sort | uniq )
if [ ! "$NETWORKS" ]; then
2016-12-12 21:23:47 +00:00
f_dialog_title "$msg_error"
f_yesno "No wireless networks were found. Rescan?" && continue
exit 1
fi
f_dialog_title "Network Selection"
prompt="Select a wireless network to connect to."
f_dialog_menu_size height width rows "$DIALOG_TITLE" \
"$DIALOG_BACKTITLE" "$prompt" "" $menu_list
NETWORK=$( eval $DIALOG \
2016-12-13 02:23:48 +00:00
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
2016-12-13 02:23:48 +00:00
--extra-button \
--extra-label \"Rescan\" \
--menu \"\$prompt\" \
$height $width $rows \
$NETWORKS \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
)
retval=$?
f_dialog_data_sanitize NETWORK
case $retval in
2016-12-12 21:26:36 +00:00
$DIALOG_OK) break ;;
$DIALOG_CANCEL)
2016-12-13 02:25:23 +00:00
# Ask if the user wants to select network manually
f_dialog_title "Network Selection"
f_yesno "Do you want to select the network manually?" || exit 1
f_dialog_input NETWORK "Enter SSID" || exit 1
prompt="Select encryption type"
menu_list="
'1 WPA/WPA2 PSK' ''
'2 WPA/WPA2 EAP' ''
'3 WEP' ''
'0 None' ''
" # END-QUOTE
eval f_dialog_menu_size height width rows \"\$DIALOG_TITLE\" \
\"\$DIALOG_BACKTITLE\" \"\$prompt\" \"\" $menu_list
ENCRYPTION=$( eval $DIALOG \
2016-12-13 02:23:48 +00:00
--title \"\$DIALOG_TITLE\" \
--backtitle \"\$DIALOG_BACKTITLE\" \
2016-12-13 02:23:48 +00:00
--menu \"\$prompt\" \
$height $width $rows \
$menu_list \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exit 1
SCANSSID=1
break
;;
$DIALOG_EXTRA) # Rescan
;;
esac
done
[ "$ENCRYPTION" ] || ENCRYPTION=$( echo "$NETWORKS" |
awk -F '\t' "/^\"$NETWORK\"\t/ { print \$2 }" )
2016-12-13 02:16:00 +00:00
if echo "$ENCRYPTION" | grep -q PSK; then
PASS=$( $DIALOG \
2016-12-13 02:11:09 +00:00
--title "WPA Setup" \
--backtitle "$DIALOG_BACKTITLE" \
--insecure \
--mixedform "" \
0 0 0 \
"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
2016-12-13 02:11:09 +00:00
"Password" 2 0 "" 2 12 15 63 1 \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
awk 'sub(/^\t/,"")||1' \
>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<EOF
network={
ssid="$NETWORK"
scan_ssid=$SCANSSID
psk="$PASS"
priority=5
}
EOF
2016-12-13 02:15:36 +00:00
elif echo "$ENCRYPTION" | grep -q EAP; then
USERPASS=$( $DIALOG \
2016-12-13 02:11:09 +00:00
--title "WPA-Enterprise Setup" \
--backtitle "$DIALOG_BACKTITLE" \
--insecure \
--mixedform "" \
0 0 0 \
"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
2016-12-13 02:11:09 +00:00
"Username" 2 0 "" 2 12 25 63 0 \
"Password" 3 0 "" 3 12 25 63 1 \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
awk 'sub(/^\t/,"")||1' \
>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<EOF
network={
ssid="$NETWORK"
scan_ssid=$SCANSSID
key_mgmt=WPA-EAP$(
echo "$USERPASS" | awk '
NR == 1 { printf "\n\t\tidentity=\"%s\"", $1 }
NR == 2 { printf "\n\t\tpassword=\"%s\"", $1 }
' )
priority=5
}
EOF
2016-12-13 02:15:36 +00:00
elif echo "$ENCRYPTION" | grep -q WEP; then
WEPKEY=$( $DIALOG \
2016-12-13 02:11:09 +00:00
--title "WEP Setup" \
--backtitle "$DIALOG_BACKTITLE" \
--insecure \
--mixedform "" \
0 0 0 \
"SSID" 1 0 "$NETWORK" 1 12 0 0 2 \
2016-12-13 02:11:09 +00:00
"WEP Key 0" 2 0 "" 2 12 15 0 1 \
2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD
) || exec "$0" "$@"
awk 'sub(/^\t/,"")||1' \
>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<EOF
network={
ssid="$NETWORK"
scan_ssid=$SCANSSID
key_mgmt=NONE
wep_key0="$WEPKEY"
wep_tx_keyidx=0
priority=5
}
EOF
else # Open
awk 'sub(/^\t/,"")||1' \
>> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<EOF
network={
ssid="$NETWORK"
scan_ssid=$SCANSSID
key_mgmt=NONE
priority=5
}
EOF
fi
# Connect to any open networks policy
cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF
network={
priority=0
key_mgmt=NONE
}
EOF
# Bring up new network
2016-12-13 02:48:14 +00:00
[ "$BSDINSTALL_CONFIGCURRENT" ] &&
f_eval_catch -d wlanconfig wpa_cli "wpa_cli reconfigure"
exit $SUCCESS
A series of changes tested together as a whole: + Add a `-D FILE" command-line option for overriding the path to the bsdinstall log file (BSDINSTALL_LOG env var). + Document new `-D FILE' in the man page for bsdinstall. + If FILE in `-D FILE' begins with a +, debug output goes to stdout (interleaved between dialog(1) invocations/output) as well as to FILE (minus the leading + of course). + If BSDINSTALL_LOG cannot be written, then debugging is disabled (except in the case of a leading + in the pathname, wherein debug will still be printed to stdout). + Update source code formatting style. + Fix a dangling participle ("Begun ..." -> "Began ...") + Rewrite the docsinstall script (was necessary to abate direct dependency on BSDINSTALL_LOG (instead, use fault-tolerant bsdconfig framework which displays appropriate errors for package management). NB: docsinstall is still using pkg(8) after this change. + Add additional debug output for dhclient/rtsol/wpa_cliscan + Display script errors in a textbox rather than just on stdout + Update many coments. + Add new f_show_err() API call (like f_show_msg but changes the dialog title to "Error")(see bsdconfig's `common.subr'). + Add new f_eval_catch() API call for executing a command via eval but not before logging the command to debug. Several example cases documented in API header for function in bsdconfig's `common.subr'. + Fix dialog auto-sizing when launched as an rvalue to a pipe for indirected scripts (previously would default to 24x80 sizing in this case, now it can autosize to full size even when in a pipe chain). + Fix bug in f_snprintf if $format argument began with "-"; printf would misinterpret as a flag. (this is in bsdcofig's `strings.subr'). + Add accompanying f_sprintf() and f_vsprintf() to go along with already existing f_snprintf() and f_vsnprintf() (see bsdconfig's `strings.subr'). + Remove some unnecessary default ZFS datasets from the automatic "zfsboot" script. Such as: /usr/ports/distfiles /usr/ports/packages /usr/obj /var/db /var/empty /var/mail and /var/run (these can all be created as-needed once the system is installed). + Remove setuid=off for /usr/home (as discussed from last round of CFT). + Fix some i18n string violations in "zfsboot". + Bolster debugging output in "zfsboot". + Fix some string quoting issues in "zfsboot". + Fix some variable scope issues in "zfsboot". + Change "Create" to "Install" in "zfsboot" main menu. + Increase error checking in "zfsboot" (type-check arguments and such). + Add call to "graid destroy" killing automatic metadata (part of the series of pedantic destructions we do when bootstrapping a new/naked disk). + Make judicious use of new f_eval_catch() in "zfsboot". + Fixup some variable names for consistency (zfsboot). + Fix an underride syntax parameter expansion folly (zfsboot). + Confirm layout if not explicitly chosen when blindly proceeding (no longer have to touch anything on the ZFS menu if it scares you, just choose the omnibus "Install" option at the top and you'll be prompted to select vdev type and disks in the layout confirmation dialog). + Change numbered menu items to alphabetic for more efficient navigation. + Consolidate vdev selection and disk selection into a single stateful menu which performs validation and allows backing out to each previous menu as you go deeper. + Redesign the ``Last Chance'' dialog (still using the same colors, but make it conform to a tolerable width and make disks appear in a block- quote style indented region). + Fix a bug wherein we used the a lowercase variable name by accident (actual variable name declared as all-uppercase) at the time of initializing fstab(5) (not believed to cause any issues though). + Update the geli setup infobox for each provider being initialized (not just at the onset -- since each ``geli init'' causes kernel messages to push our infobox off-screen). Reviewed by: Allan Jude <freebsd@allanjude.com> Discussed on: -current MFC after: 3 days
2013-11-08 09:57:03 +00:00
################################################################################
# END
################################################################################