Changeset f64970c5


Ignore:
Timestamp:
10/21/13 13:19:18 (11 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:
95edabc
Parents:
c7ff3941 (diff), b15a1b6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of github.com:pcbsd/pcbsd

File:
1 edited

Legend:

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

    r29e292f rc7ff3941  
    3939  fi 
    4040  SYSTYPE="$ANS" 
     41 
     42  # If on a desktop, lets just set DHCP 
     43  if [ "$SYSTYPE" = "desktop" ] ; then 
     44     SYSNIC="AUTO-DHCP-SLAAC" 
     45  fi 
    4146} 
    4247 
     
    164169} 
    165170 
     171get_hostname() 
     172{ 
     173    get_dlg_ans "--inputbox 'Enter a system Hostname' 8 40" 
     174    if [ -z "$ANS" ] ; then 
     175       exit_err "Invalid hostname entered!" 
     176    fi 
     177    SYSHOSTNAME="$ANS" 
     178} 
     179 
     180get_sshd() 
     181{ 
     182  SYSSSHD="" 
     183  get_dlg_ans "--yesno 'Enable SSH?' 8 30" 
     184  if [ $? -ne 0 ] ; then return ; fi 
     185  SYSSSHD="YES" 
     186} 
     187 
     188get_netconfig() 
     189{ 
     190  SYSNIC="" 
     191  SYSNICIP="" 
     192  SYSNICDNS="" 
     193  SYSNICMASK="" 
     194  SYSNICROUTE="" 
     195 
     196  get_dlg_ans "--yesno 'Enable networking?' 6 30" 
     197  if [ $? -ne 0 ] ; then return ; fi 
     198 
     199  dOpts="auto \"Automatic DHCP\" on" 
     200  pc-sysinstall detect-nics > /tmp/.dList.$$ 
     201  while read i 
     202  do 
     203     d="`echo $i | cut -d ':' -f 1`" 
     204     desc="`echo $i | cut -d '<' -f 2 | cut -d '>' -f 1`" 
     205     dOpts="$dOpts $d \"$desc\" off" 
     206  done < /tmp/.dList.$$ 
     207  rm /tmp/.dList.$$ 
     208  get_dlg_ans "--radiolist \"Select network card to configure\" 12 50 5 ${dOpts}" 
     209  if [ -z "$ANS" ] ; then 
     210     exit_err "Invalid NIC selected!" 
     211  fi 
     212  SYSNIC="$ANS" 
     213  if [ "$SYSNIC" = "auto" ] ; then 
     214     SYSNIC="AUTO-DHCP-SLAAC" 
     215     return 
     216  fi 
     217 
     218  get_dlg_ans "--inputbox \"Enter the IP address for $SYSNIC\" 8 40" 
     219  if [ -z "$ANS" ] ; then 
     220     exit_err "Invalid IP entered!" 
     221  fi 
     222  SYSNICIP="$ANS" 
     223 
     224  get_dlg_ans "--inputbox \"Enter the Netmask for $SYSNIC\" 8 40" 
     225  if [ -z "$ANS" ] ; then 
     226     exit_err "Invalid real name entered!" 
     227  fi 
     228  SYSNICMASK="$ANS" 
     229 
     230  get_dlg_ans "--inputbox \"Enter the DNS address for $SYSNIC\" 8 40" 
     231  if [ -z "$ANS" ] ; then 
     232     exit_err "Invalid real name entered!" 
     233  fi 
     234  SYSNICDNS="$ANS" 
     235 
     236  get_dlg_ans "--inputbox \"Enter the Gateway address for $SYSNIC\" 8 40" 
     237  if [ -z "$ANS" ] ; then 
     238     exit_err "Invalid real name entered!" 
     239  fi 
     240  SYSNICROUTE="$ANS" 
     241 
     242} 
     243 
    166244gen_pc-sysinstall_cfg() 
    167245{ 
     
    172250   if [ "$SYSTYPE" = "desktop" ] ; then 
    173251     echo "installType=PCBSD" >>${CFGFILE} 
    174      echo "netSaveDev=AUTO-DHCP-SLAAC" >> ${CFGFILE} 
    175252   else 
    176253     echo "installType=FreeBSD" >>${CFGFILE} 
     
    184261   echo "installMedium=local" >>${CFGFILE} 
    185262   echo "localPath=/dist" >>${CFGFILE} 
     263 
     264   if [ -n "$SYSHOSTNAME" ] ; then 
     265      echo "" >> ${CFGFILE} 
     266      echo "hostname=$SYSHOSTNAME" >> ${CFGFILE} 
     267   fi 
     268   if [ -n "$SYSNIC" ] ; then 
     269      echo "" >> ${CFGFILE} 
     270      echo "netSaveDev=$SYSNIC" >> ${CFGFILE} 
     271      if [ "$SYSNIC" != "AUTO-DHCP-SLAAC" ] ; then 
     272        echo "netSaveIP_${SYSNIC}=$SYSNICIP" >> ${CFGFILE} 
     273        echo "netSaveMask_${SYSNIC}=$SYSNICMASK" >> ${CFGFILE} 
     274        echo "netSaveNameServer_${SYSNIC}=$SYSNICDNS" >> ${CFGFILE} 
     275        echo "netSaveDefaultRouter_${SYSNIC}=$SYSNICROUTE" >> ${CFGFILE} 
     276      fi 
     277   fi 
     278 
    186279 
    187280   # Now do the disk block 
     
    229322     echo "userGroups=wheel,operator" >> ${CFGFILE} 
    230323     echo "commitUser" >> ${CFGFILE} 
    231  
    232      # KPM - TODO, add blocks to create network config, hostname / ssh settings 
    233324   fi 
    234325 
     
    237328   echo "runExtCmd=/root/save-config.sh" >> ${CFGFILE} 
    238329   echo "runCommand=newaliases" >> ${CFGFILE} 
    239    
    240   
     330 
     331   # Are we enabling SSHD? 
     332   if [ "$SYSSSHD" = "YES" ] ; then 
     333     echo "runCommand=echo 'sshd_enable=\"YES\"' >> /etc/rc.conf" >> ${CFGFILE} 
     334   fi 
     335 
    241336} 
    242337 
     
    265360} 
    266361 
     362# Adjust network options 
     363change_networking() { 
     364  get_hostname 
     365  get_netconfig 
     366  get_sshd 
     367  gen_pc-sysinstall_cfg 
     368} 
     369 
    267370start_menu_loop() 
    268371{ 
     
    270373  while : 
    271374  do 
    272     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 
     375    dialog --title "PC-BSD Text Install" --menu "Please select from the following options:" 15 40 10 wizard "Run install wizard" disk "Change disk ($SYSDISK)" network "Change networking" view "View install script" edit "Edit install script" install "Start the installation" quit "Quit install wizard" 2>/tmp/answer 
    273376    if [ $? -ne 0 ] ; then break ; fi 
    274377 
     
    282385             rtn 
    283386             ;; 
     387    network) change_networking  
     388             ;; 
    284389       view) more ${CFGFILE} 
    285390             rtn 
Note: See TracChangeset for help on using the changeset viewer.