svn commit: r217258 - in user/nwhitehorn/bsdinstall: . scripts
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Tue Jan 11 05:49:03 UTC 2011
Author: nwhitehorn
Date: Tue Jan 11 05:49:03 2011
New Revision: 217258
URL: http://svn.freebsd.org/changeset/base/217258
Log:
Provide a little bit friendlier error handling. Instead of just blocking
SIGINT, catch it and provide an error message in critical steps. In
skippable steps, allow the user to skip them cleanly by application of
cntrl-C.
Modified:
user/nwhitehorn/bsdinstall/rc.local
user/nwhitehorn/bsdinstall/scripts/auto
Modified: user/nwhitehorn/bsdinstall/rc.local
==============================================================================
--- user/nwhitehorn/bsdinstall/rc.local Tue Jan 11 05:22:31 2011 (r217257)
+++ user/nwhitehorn/bsdinstall/rc.local Tue Jan 11 05:49:03 2011 (r217258)
@@ -14,7 +14,7 @@ cdialog --backtitle "FreeBSD Installer"
case $? in
$DIALOG_OK) # Install
BSDINSTALL_CONFIGCURRENT=yes; export BSDINSTALL_CONFIGCURRENT
- trap "" SIGINT # Ignore cntrl-C here
+ trap true SIGINT # Ignore cntrl-C here
bsdinstall
reboot
;;
Modified: user/nwhitehorn/bsdinstall/scripts/auto
==============================================================================
--- user/nwhitehorn/bsdinstall/scripts/auto Tue Jan 11 05:22:31 2011 (r217257)
+++ user/nwhitehorn/bsdinstall/scripts/auto Tue Jan 11 05:49:03 2011 (r217258)
@@ -2,8 +2,6 @@
echo "Begun Installation at $(date)" > $BSDINSTALL_LOG
-trap "" SIGINT # Ignore cntrl-C here
-
error() {
cdialog --backtitle "FreeBSD Installer" --title "Abort" \
--no-label "Exit" --yes-label "Restart" --yesno \
@@ -15,6 +13,8 @@ error() {
fi
}
+trap error SIGINT # Catch cntrl-C here
+
rm -rf $BSDINSTALL_TMPETC
mkdir $BSDINSTALL_TMPETC
bsdinstall hostname || error
@@ -44,13 +44,17 @@ if [ ! -z $FETCH_DISTRIBUTIONS ]; then
fi
bsdinstall distextract || error
-bsdinstall rootpass
+bsdinstall rootpass || error
+
+trap true SIGINT # This section is optional
if [ "$NETCONFIG_DONE" != yes ]; then
bsdinstall netconfig # Don't check for errors -- the user may cancel
fi
bsdinstall time
bsdinstall services
bsdinstall adduser
+
+trap error SIGINT # SIGINT is bad again
bsdinstall config || error
cdialog --backtitle "FreeBSD Installer" --title "Complete" --msgbox "Installation of FreeBSD complete!" 0 0
More information about the svn-src-user
mailing list