Permalink
Browse files

Update text-installer with a more fleshed out menu, letting us do

some new things such as:

 * go back and change disk parameters before installation.
 * View install script
 * Edit install script
  • Loading branch information...
1 parent 59d5019 commit 26d931b52c22d539c095f1e4806aa7b4a9c8f7c9 @kmoore134 kmoore134 committed Oct 16, 2013
Showing with 69 additions and 48 deletions.
  1. +1 −35 overlays/install-overlay/root/PCBSDtext.sh
  2. +68 −13 src-sh/pc-installdialog/pc-installdialog.sh
@@ -7,40 +7,6 @@
. /root/functions.sh
-text_install_menu()
-{
-
- while :
- do
- if [ -e "/tmp/sys-install.cfg" ] ; then
- dialog --title "PC-BSD Text Install" --menu "Please select from the following options:" 20 55 15 wizard "Re-Run install wizard" edit "Edit install script" install "Start installation" back "Return to previous menu" 2>/tmp/answer
- else
- dialog --title "PC-BSD Text Install" --menu "Please select from the following options:" 20 55 15 wizard "Run install wizard" back "Return to previous menu" 2>/tmp/answer
- fi
-
- ANS="`cat /tmp/answer`"
-
- case $ANS in
- wizard) pc-installdialog
- rtn
- ;;
- edit) vi /tmp/sys-install.cfg
- rtn
- ;;
- install) echo "This will begin the installation, continue?"
- echo -e "(y/n)\c"
- read tmp
- if [ "$tmp" = "y" -o "$tmp" = "Y" ] ; then
- pc-sysinstall -c /tmp/sys-install.cfg
- rtn
- fi
- ;;
- back) break ;;
- *) ;;
- esac
- done
-}
-
DRES="1024x768"
while
@@ -52,7 +18,7 @@ dialog --title "PC-BSD Installation Menu" --menu "Please select from the followi
ANS="`cat /tmp/answer`"
case $ANS in
- install) text_install_menu ;;
+ install) /usr/local/bin/pc-installdialog ;;
xinstall) echo "Starting PC-BSD System Installer.. Please wait.."
startx 2>/tmp/Xerrors ;;
vesa) echo "Starting PC-BSD System Installer.. Please wait.."
@@ -44,6 +44,7 @@ get_sys_type()
get_target_disk()
{
# Now we prompt for the disk to install on
+ dOpts=""
pc-sysinstall disk-list > /tmp/.dList.$$
while read i
do
@@ -239,19 +240,73 @@ gen_pc-sysinstall_cfg()
}
-# Start the wizard
-get_sys_type
-get_target_disk
-get_target_part
-
-# If doing a server setup, need to prompt for some more details
-if [ "$SYSTYPE" = "server" ] ; then
- get_root_pw
- get_user_name
- get_user_pw
- get_user_realname
- get_user_shell
+change_disk_selection() {
+ get_target_disk
+ get_target_part
+ gen_pc-sysinstall_cfg
+}
+
+start_full_wizard()
+{
+ # Start the wizard
+ get_sys_type
+ get_target_disk
+ get_target_part
+
+ # If doing a server setup, need to prompt for some more details
+ if [ "$SYSTYPE" = "server" ] ; then
+ get_root_pw
+ get_user_name
+ get_user_pw
+ get_user_realname
+ get_user_shell
+ fi
+ gen_pc-sysinstall_cfg
+}
+
+start_menu_loop()
+{
+
+ while :
+ do
+ dialog --title "PC-BSD Text Install" --menu "Please select from the following options:" 15 40 10 wizard "Run install wizard" disk "Change disk ($SYSDISK)" view "View install script" edit "Edit install script" install "Start the installation" quit "Quit install wizard" 2>/tmp/answer
+ if [ $? -ne 0 ] ; then break ; fi
+
+ ANS="`cat /tmp/answer`"
+
+ case $ANS in
+ wizard) start_full_wizard
+ rtn
+ ;;
+ disk) change_disk_selection
+ rtn
+ ;;
+ view) more ${CFGFILE}
+ rtn
+ ;;
+ edit) vi ${CFGFILE}
+ rtn
+ ;;
+ install) echo "This will begin the installation, continue?"
+ echo -e "(y/n)\c"
+ read tmp
+ if [ "$tmp" = "y" -o "$tmp" = "Y" ] ; then
+ pc-sysinstall -c ${CFGFILE}
+ rtn
+ fi
+ ;;
+ quit) break ;;
+ *) ;;
+ esac
+ done
+
+}
+
+if [ ! -e "$CFGFILE" ] ; then
+ start_full_wizard
+ start_menu_loop
+else
+ start_menu_loop
fi
-gen_pc-sysinstall_cfg
exit 0

0 comments on commit 26d931b

Please sign in to comment.