Changeset 9855292


Ignore:
Timestamp:
10/23/13 09:41:27 (10 months ago)
Author:
Kris Moore <kris@…>
Branches:
master, 9.2-release, releng/10.0, releng/10.0.1, releng/10.0.2, releng/10.0.3
Children:
4f9718b
Parents:
07eb74c
Message:

Update text-installer, add option to change boot-loader.

In addition do some cleanup, and prompt the user if they want to cancel,
in case they hit Cancel by mistake

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src-sh/pc-installdialog/pc-installdialog.sh

    rc7ff3941 r9855292  
    1919    if [ -e "$TANS" ] ; then rm ${TANS}; fi 
    2020    if [ -e "$TANS.dlg" ] ; then rm ${TANS}.dlg; fi 
    21     echo "dialog --title \"$TITLE\" ${@}" >${TANS}.dlg 
    22     sh ${TANS}.dlg 2>${TANS} 
    23     exit=$? 
    24     if [ ! -e "$TANS" ] ; then 
    25        ANS="" 
    26        return $exit 
    27     fi 
    28     ANS=`cat ${TANS}` 
    29     return $exit 
     21    while : 
     22    do 
     23      echo "dialog --title \"$TITLE\" ${@}" >${TANS}.dlg 
     24      sh ${TANS}.dlg 2>${TANS} 
     25      if [ $? -ne 0 ] ; then 
     26        dialog --title "$TITLE" --yesno 'Exit the installer?' 8 30 
     27        if [ $? -eq 0 ] ; then exit_err "User canceled install" ; fi 
     28        continue 
     29      fi 
     30 
     31      if [ ! -e "$TANS" ] ; then 
     32         ANS="" 
     33         return 
     34      fi 
     35      ANS=`cat ${TANS}` 
     36      return 
     37    done 
    3038} 
    3139 
     
    4654} 
    4755 
     56get_sys_bootmanager() 
     57{ 
     58  # Ask the boot-manager 
     59  get_dlg_ans "--radiolist \"Boot Manager\" 12 50 5 GRUB \"GRUB - Recommended\" on BSD \"FreeBSD Boot-Loader\" off none \"No boot-loader\" off" 
     60  if [ -z "$ANS" ] ; then 
     61     exit_err "Invalid bootmanager type" 
     62  fi 
     63  SYSBOOTMANAGER="$ANS" 
     64} 
    4865 
    4966get_target_disk() 
     
    115132    ROOTPWCONFIRM="$ANS" 
    116133    if [ "$ROOTPWCONFIRM" = "$ROOTPW" ] ; then break; fi 
    117     get_dlg_ans "--yesno 'Password Mismatch, try again?' 8 30" 
     134    dialog --title "$TITLE" --yesno 'Password Mismatch, try again?' 8 30 
    118135    if [ $? -eq 0 ] ; then continue ; fi 
    119136    exit_err "Failed setting root password!" 
     
    136153    USERPWCONFIRM="$ANS" 
    137154    if [ "$USERPWCONFIRM" = "$USERPW" ] ; then break; fi 
    138     get_dlg_ans "--yesno 'Password Mismatch, try again?' 8 30" 
     155    dialog --title "$TITLE" --yesno 'Password Mismatch, try again?' 8 30 
    139156    if [ $? -eq 0 ] ; then continue ; fi 
    140157    exit_err "Failed setting password!" 
     
    181198{ 
    182199  SYSSSHD="" 
    183   get_dlg_ans "--yesno 'Enable SSH?' 8 30" 
     200  dialog --title "$TITLE" --yesno 'Enable SSH?' 8 30 
    184201  if [ $? -ne 0 ] ; then return ; fi 
    185202  SYSSSHD="YES" 
     
    194211  SYSNICROUTE="" 
    195212 
    196   get_dlg_ans "--yesno 'Enable networking?' 6 30" 
     213  dialog --title "$TITLE" --yesno 'Enable networking?' 6 30 
    197214  if [ $? -ne 0 ] ; then return ; fi 
    198215 
     
    283300   echo "disk0=$SYSDISK" >> ${CFGFILE} 
    284301   echo "partition=$DISKPART" >> ${CFGFILE} 
    285    echo "bootManager=GRUB" >> ${CFGFILE} 
     302   echo "bootManager=${SYSBOOTMANAGER}" >> ${CFGFILE} 
    286303   echo "partscheme=$DISKFORMAT" >> ${CFGFILE} 
    287304   echo "commitDiskPart" >> ${CFGFILE} 
     
    339356  get_target_disk 
    340357  get_target_part 
     358  get_sys_bootmanager 
    341359  gen_pc-sysinstall_cfg 
    342360} 
     
    348366  get_target_disk 
    349367  get_target_part 
     368  get_sys_bootmanager 
    350369 
    351370  # If doing a server setup, need to prompt for some more details 
Note: See TracChangeset for help on using the changeset viewer.