From c1d11098c2aa98722e48d1ab5e8b9e3c6fd13f02 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sun, 19 May 2013 10:08:12 +0200 Subject: Switch to iproute and dhcpcd and drop ifconfig/route/udhcpc. --- installer.sh.in | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/installer.sh.in b/installer.sh.in index 309df72..3f3afdd 100644 --- a/installer.sh.in +++ b/installer.sh.in @@ -452,7 +452,7 @@ configure_eth() { } iface_setup() { - ifconfig $1|grep -q 'inet addr:' + ip addr show dev $1|grep -q 'inet ' return $? } @@ -461,7 +461,7 @@ configure_net_dhcp() { iface_setup $dev if [ $? -eq 1 ]; then - udhcpc -q -t 10 -n -i $dev 2>&1 | tee $LOG | \ + dhcpcd -t 10 -w -4 -L $dev 2>&1 | tee $LOG | \ DIALOG --progressbox "Initializing $dev via DHCP..." ${WIDGET_SIZE} if [ $? -ne 0 ]; then DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} failed to run udhcpc. See $LOG for details." ${MSGBOXSIZE} @@ -490,13 +490,19 @@ configure_net_static() { set -- $(cat $ANSWER) ip=$1; gw=$2; dns1=$3; dns2=$4 - echo "running: ifconfig $dev $IPADDR up" >$LOG - ifconfig $dev $ip up >$LOG 2>&1 + echo "running: ip link set dev $dev up" >$LOG + ip link set dev $dev up >$LOG 2>&1 if [ $? -ne 0 ]; then - DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} Failed to setup $dev interface." ${MSGBOXSIZE} + DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} Failed to bring $dev interface." ${MSGBOXSIZE} return 1 fi - route add default gw $gw >$LOG 2>&1 + echo "running: ip addr add $ip dev $dev" + ip addr add $ip dev $dev >$LOG 2>&1 + if [ $? -ne 0 ]; then + DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} Failed to set ip to the $dev interface." ${MSGBOXSIZE} + return 1 + fi + ip route add $gw dev $dev >$LOG 2>&1 if [ $? -ne 0 ]; then DIALOG --msgbox "${BOLD}${RED}ERROR:${RESET} failed to setup your gateway." ${MSGBOXSIZE} return 1 @@ -851,7 +857,7 @@ menu() { "Partition" "Partition disk(s)" \ "Filesystems" "Configure filesystems and mount points" \ "Install" "Start installation with saved settings" \ - "Exit" "Exit installation" + "Exit" "Exit installation" if [ $? -eq 3 ]; then # Show settings -- cgit 1.4.1