svn commit: r218018 - user/nwhitehorn/bsdinstall/scripts
Nathan Whitehorn
nwhitehorn at FreeBSD.org
Fri Jan 28 15:25:47 UTC 2011
Author: nwhitehorn
Date: Fri Jan 28 15:25:46 2011
New Revision: 218018
URL: http://svn.freebsd.org/changeset/base/218018
Log:
Allow use to revisit configuration choices and have a chroot shell in
their shiny new system before rebooting.
Modified:
user/nwhitehorn/bsdinstall/scripts/adduser
user/nwhitehorn/bsdinstall/scripts/auto
user/nwhitehorn/bsdinstall/scripts/jail
Modified: user/nwhitehorn/bsdinstall/scripts/adduser
==============================================================================
--- user/nwhitehorn/bsdinstall/scripts/adduser Fri Jan 28 14:47:09 2011 (r218017)
+++ user/nwhitehorn/bsdinstall/scripts/adduser Fri Jan 28 15:25:46 2011 (r218018)
@@ -1,13 +1,8 @@
#!/bin/sh
-dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \
- "Would you like to add users to the installed system now?" 0 0
-
-if [ $? -eq 0 ]; then
- clear
- echo "FreeBSD Installer"
- echo "========================"
- echo "Add Users"
- echo
- chroot $BSDINSTALL_CHROOT adduser
-fi
+clear
+echo "FreeBSD Installer"
+echo "========================"
+echo "Add Users"
+echo
+chroot $BSDINSTALL_CHROOT adduser
Modified: user/nwhitehorn/bsdinstall/scripts/auto
==============================================================================
--- user/nwhitehorn/bsdinstall/scripts/auto Fri Jan 28 14:47:09 2011 (r218017)
+++ user/nwhitehorn/bsdinstall/scripts/auto Fri Jan 28 15:25:46 2011 (r218018)
@@ -93,7 +93,67 @@ if [ "$NETCONFIG_DONE" != yes ]; then
fi
bsdinstall time
bsdinstall services
-bsdinstall adduser
+
+dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \
+ "Would you like to add users to the installed system now?" 0 0 && \
+ bsdinstall adduser
+
+finalconfig() {
+ exec 3>&1
+ REVISIT=$(dialog --backtitle "FreeBSD Installer" \
+ --title "Final Configuration" --no-cancel --menu \
+ "Setup of your FreeBSD system is nearly complete. You can now \
+ modify your configuration choices or apply more complex changes \
+ using a shell." 0 0 0 \
+ "Add User" "Add a user to the system" \
+ "Root Password" "Change root password" \
+ "Hostname" "Set system hostname" \
+ "Network" "Networking configuration" \
+ "Services" "Set daemons to run on startup" \
+ "Time Zone" "Set system timezone" \
+ "Shell" "Open a shell in the new system" \
+ "Reboot" "Apply configuration and reboot" 2>&1 1>&3)
+ exec 3>&-
+
+ case "$REVISIT" in
+ "Add User")
+ bsdinstall adduser
+ finalconfig
+ ;;
+ "Root Password")
+ bsdinstall rootpass
+ finalconfig
+ ;;
+ "Hostname")
+ bsdinstall hostname
+ finalconfig
+ ;;
+ "Network")
+ bsdinstall netconfig
+ finalconfig
+ ;;
+ "Services")
+ bsdinstall services
+ finalconfig
+ ;;
+ "Time Zone")
+ bsdinstall time
+ finalconfig
+ ;;
+ "Shell")
+ clear
+ echo This shell is operating in a chroot in the new system. \
+ When finished making configuration changes, type \"exit\".
+ chroot "$BSDINSTALL_CHROOT" /bin/sh
+ # Don't hose local rc.conf changes
+ cp $BSDINSTALL_CHROOT/etc/rc.conf $BSDINSTALL_TMPETC/rc.conf.manual
+ finalconfig
+ ;;
+ esac
+}
+
+# Allow user to change his mind
+finalconfig
trap error SIGINT # SIGINT is bad again
bsdinstall config || error
Modified: user/nwhitehorn/bsdinstall/scripts/jail
==============================================================================
--- user/nwhitehorn/bsdinstall/scripts/jail Fri Jan 28 14:47:09 2011 (r218017)
+++ user/nwhitehorn/bsdinstall/scripts/jail Fri Jan 28 15:25:46 2011 (r218018)
@@ -43,7 +43,10 @@ bsdinstall rootpass || error
trap true SIGINT # This section is optional
bsdinstall time
bsdinstall services
-bsdinstall adduser
+
+dialog --backtitle "FreeBSD Installer" --title "Add User Accounts" --yesno \
+ "Would you like to add users to the installed system now?" 0 0 && \
+ bsdinstall adduser
trap error SIGINT # SIGINT is bad again
bsdinstall config || error
More information about the svn-src-user
mailing list