Subversion Repositories livecd

Rev

Rev 205 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 205 Rev 241
Line 20... Line 20...
20
# - better detection of network card in case of diskless client
20
# - better detection of network card in case of diskless client
21
# - add sg, sata_nv module
21
# - add sg, sata_nv module
22
# - to allow LiveCD mounted over CIFS (for diskless client)
22
# - to allow LiveCD mounted over CIFS (for diskless client)
23
# - add function find_changes
23
# - add function find_changes
24
# - add sata_svw
24
# - add sata_svw
-
 
25
# - add $DHCPDELAY parameter
25
#
26
#
26
 
27
 
27
# ===========================================================
28
# ===========================================================
28
# user interface functions
29
# user interface functions
29
# ===========================================================
30
# ===========================================================
Line 549... Line 550...
549
    found="1"
550
    found="1"
550
    for iface in eth0 eth1 eth2 eth3 eth4 eth5; do
551
    for iface in eth0 eth1 eth2 eth3 eth4 eth5; do
551
	# nic already found ?
552
	# nic already found ?
552
	echo $FOUND_IFACE | grep -q $iface 
553
	echo $FOUND_IFACE | grep -q $iface 
553
	if [ $? -ne 0 ]; then
554
	if [ $? -ne 0 ]; then
554
	    ifconfig $iface > /dev/null 2>&1
555
	    ifconfig $iface up > /dev/null 2>&1
555
	    if [ $? -eq 0 ]; then 
556
	    if [ $? -eq 0 ]; then 
556
		FOUND_IFACE="$FOUND_IFACE $iface"
557
		FOUND_IFACE="$FOUND_IFACE $iface"
557
		found="0"
558
		found="0"
558
	    fi
559
	    fi
559
	fi
560
	fi
Line 664... Line 665...
664
#
665
#
665
get_dhcp_lease()
666
get_dhcp_lease()
666
{
667
{
667
    # create /dev/urandom (needed by udhcpc)
668
    # create /dev/urandom (needed by udhcpc)
668
    mknod /dev/urandom c 1 9
669
    mknod /dev/urandom c 1 9
669
 
670
    
-
 
671
    # wait for interface coming up
-
 
672
    if [ $DHCPDELAY -gt 0 ]; then 
-
 
673
        echolog "delaying DHCP for $DHCPDELAY seconds (dhcpdelay=$DHCPDELAY) ..."
-
 
674
        sleep $DHCPDELAY
-
 
675
        echolog "if getting dhcp lease freezes, try define a higher dhcpdelay value as boot parameter."
-
 
676
    fi
670
    for iface in eth0 eth1 eth2 eth3 eth4 eth5; do
677
    for iface in eth0 eth1 eth2 eth3 eth4 eth5; do
671
	# interface up ?
678
	# interface up ?
672
	ifconfig $iface > /dev/null 2>&1
679
	ifconfig $iface > /dev/null 2>&1
673
	if [ $? -eq 0 ]; then
680
	if [ $? -eq 0 ]; then
674
	    # get dhcp lease
681
	    # get dhcp lease
675
	    echolog "try to get DHCP lease on $iface"
682
	    echolog "try to get DHCP lease on $iface"
676
	    udhcpc --now --quit --interface=$iface --script=/bin/udhcpc.script
683
	    udhcpc --now --quit --interface=$iface --script=/bin/udhcpc.script
677
	    [ $? -eq 0 ] && return
684
	    [ $? -eq 0 ] && return
678
	    echo "ERROR: couldn't get DHCP lease on $iface."
685
	    echolog "ERROR: couldn't get DHCP lease on $iface."
679
	fi
686
	fi
680
    done
687
    done
681
}
688
}