Subversion Repositories livecd

Rev

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

Rev 147 Rev 148
Line 509... Line 509...
509
    echolog "auto-detection of network driver ..."
509
    echolog "auto-detection of network driver ..."
510
    FOUND_NICS=""
510
    FOUND_NICS=""
511
    KERNEL="`uname -r`"
511
    KERNEL="`uname -r`"
512
    NETDRIVERS="`find /lib/modules/$KERNEL/kernel/drivers/net | grep -v mii | grep .ko | cut -d"/" -f8 | cut -d"." -f1 | uniq`"
512
    NETDRIVERS="`find /lib/modules/$KERNEL/kernel/drivers/net | grep -v mii | grep .ko | cut -d"/" -f8 | cut -d"." -f1 | uniq`"
513
    for driver in $NETDRIVERS; do
513
    for driver in $NETDRIVERS; do
514
	modprobe_module $driver > /dev/null 2>&1
514
       	modprobe_module $driver > /dev/null 2>&1
515
	found_nic
515
	found_nic
516
	if [ $? -eq 0 ]; then
516
	if [ $? -eq 0 ]; then
517
	    echolog "found network card $driver"
517
	    echolog "found network card $driver"
518
	    echolog "load module $driver"
518
	    echolog "load module $driver"
519
	    FOUND_NICS="$FOUND_NICS $driver"
519
	    FOUND_NICS="$FOUND_NICS $driver"
Line 531... Line 531...
531
	do_not_remove=""
531
	do_not_remove=""
532
	for nic in $FOUND_NICS; do
532
	for nic in $FOUND_NICS; do
533
	    echo $driver | grep -q $nic 
533
	    echo $driver | grep -q $nic 
534
	    [ $? -eq 0 ] && do_not_remove="$driver"
534
	    [ $? -eq 0 ] && do_not_remove="$driver"
535
	done
535
	done
536
	[ ! $do_not_remove ] && $rmmod $driver > /dev/null 2>&1
536
	[ ! $do_not_remove ] && rmmod $driver > /dev/null 2>&1
537
    done
537
    done
538
}
538
}
539
 
539
 
540
# 3. detecting network card from pcitable list
540
# 3. detecting network card from pcitable list
541
#
541
#
Line 562... Line 562...
562
    echo "ERROR: No network card detected!"
562
    echo "ERROR: No network card detected!"
563
    echo "Type in your network card driver (e.g. tg3, e1000). "
563
    echo "Type in your network card driver (e.g. tg3, e1000). "
564
    echo "Or ask your system administrator for help."
564
    echo "Or ask your system administrator for help."
565
    echo -n "Network card driver: "
565
    echo -n "Network card driver: "
566
    read driver
566
    read driver
567
    echo "Load module $driver"
567
    echo "load module $driver"
568
    modprobe_module $driver
568
    modprobe_module $driver
569
}
569
}
570
 
570
 
571
# Try to find a network driver
571
# Try to find a network driver
572
#
572
#
Line 575... Line 575...
575
    # mii maybe need by NIC driver
575
    # mii maybe need by NIC driver
576
    modprobe_module mii
576
    modprobe_module mii
577
 
577
 
578
    FOUND_IFACE=""
578
    FOUND_IFACE=""
579
    load_network_module_nic
579
    load_network_module_nic
580
    found_nic || load_network_module_auto
580
    found_nic        || load_network_module_auto
581
    found_nic || load_network_module_pcitable
581
    [ "$FOUND_IFACE" ] || load_network_module_pcitable
582
    found_nic || load_network_module_ask
582
    [ "$FOUND_IFACE" ] || load_network_module_ask
583
 
583
 
584
    # remove mii, if not needed
584
    # remove mii, if not needed
585
    rmmod mii > /dev/null 2>&1
585
    rmmod mii > /dev/null 2>&1
586
}
586
}
587
 
587
 
Line 596... Line 596...
596
 
596
 
597
    for iface in eth0 eth1 eth2 eth3 eth4 eth5; do
597
    for iface in eth0 eth1 eth2 eth3 eth4 eth5; do
598
	# interface up ?
598
	# interface up ?
599
	ifconfig $iface > /dev/null 2>&1
599
	ifconfig $iface > /dev/null 2>&1
600
	if [ $? -eq 0 ]; then
600
	if [ $? -eq 0 ]; then
601
	    # try twice to get dhcp lease
601
	    # get dhcp lease
602
	    for i in 1 2; do
-
 
603
		echolog "${i}. Try to get DHCP lease on $iface"
602
	    echolog "try to get DHCP lease on $iface"
604
		udhcpc --now --quit --interface=$iface --script=/bin/udhcpc.script
603
	    udhcpc --now --quit --interface=$iface --script=/bin/udhcpc.script
605
		[ $? -eq 0 ] && return
604
	    [ $? -eq 0 ] && return
606
		echo "ERROR: couldn't get DHCP lease on $iface."
605
	    echo "ERROR: couldn't get DHCP lease on $iface."
607
	    done
-
 
608
	fi
606
	fi
609
    done
607
    done
610
}
608
}
611
 
609