Changeset 293508c


Ignore:
Timestamp:
07/20/15 07:36:55 (6 weeks ago)
Author:
Kris Moore <kris@…>
Branches:
master, releng/10.2
Children:
9392fb6
Parents:
203213c
Message:

On initial boot of installer, set all NICS to DHCP mode and
also create the various wlan[0-9] entries so the network util
can do setup of them.

Fixes bug #10635

Location:
overlays/install-overlay/root
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • overlays/install-overlay/root/PCBSDStart.sh

    ra016a66 r293508c  
    6464fi 
    6565 
    66 # Set all NICS to DHCP 
    67 NICS=`ifconfig -l` 
    68 for i in $NICS 
    69 do 
    70   if [ "$i" = "lo0" ] ; then continue ; fi 
     66# Source our functions 
     67. /root/functions.sh 
    7168 
    72   echo "Enabling networking on ${i}..." 
    73   echo "ifconfig_${i}_ipv6=\"inet6 accept_rtadv\"" >> /etc/rc.conf 
    74   echo "ifconfig_${i}=\"DHCP\"" >> /etc/rc.conf 
    75   (dhclient ${i} >/dev/null 2>/dev/null ) & 
    76 done 
     69# Set all NICS to DHCP mode 
     70enable_dhcp_all 
     71 
     72# Enable networking 
     73/etc/rc.d/netif restart 
    7774 
    7875# Check if we are booting in LIVE or INSTALL mode 
     
    9390  exit 0 
    9491fi 
    95  
    96 # Source our functions 
    97 . /root/functions.sh 
    9892 
    9993# Check if we have an auto-install directive 
  • overlays/install-overlay/root/functions.sh

    re41f3bb r293508c  
    22# Functions we source for starting the install / live mode 
    33########################################################### 
     4 
     5# Function which checks is a nic is wifi or not 
     6check_is_wifi() 
     7{ 
     8  ifconfig ${1} | grep -q "802.11" 
     9  return $? 
     10} 
     11 
     12# Function which simply enables plain dhcp on all detected nics 
     13# and creates the wlan[0-9] entries for wireless devices 
     14enable_dhcp_all() 
     15{ 
     16  WLANCOUNT="0" 
     17  for NIC in `ifconfig -l` 
     18  do 
     19    check_is_wifi ${NIC} 
     20    if [ $? -eq 0 ] 
     21    then 
     22      # We have a wifi device, setup a wlan* entry for it 
     23      WLAN="wlan${WLANCOUNT}" 
     24      cat /etc/rc.conf | grep -q "wlans_${NIC}=" 
     25      if [ $? -ne 0 ] ; then 
     26        echo "wlans_${NIC}=\"${WLAN}\"" >>/etc/rc.conf 
     27      fi 
     28      echo "ifconfig_${WLAN}=\"DHCP\"" >>/etc/rc.conf 
     29      echo "ifconfig_${WLAN}_ipv6=\"inet6 accept_rtadv\"" >> /etc/rc.conf 
     30      WLANCOUNT=$((WLANCOUNT+1)) 
     31    else 
     32      echo "ifconfig_${NIC}=\"DHCP\"" >>/etc/rc.conf 
     33      echo "ifconfig_${NIC}_ipv6=\"inet6 accept_rtadv\"" >> /etc/rc.conf 
     34    fi 
     35  done 
     36} 
    437 
    538detect_x()  
Note: See TracChangeset for help on using the changeset viewer.