From 7d1b9e39f7b1dac4c2ed6e3771585548ccd9e2d4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 5 Aug 2017 14:30:48 +0200 Subject: [PATCH] inst: don't hardcode /net/ether0, might have usb ethernet --- rc/bin/inst/confignet | 11 +++++++---- rc/bin/inst/ndbsetup | 2 +- rc/bin/inst/startether | 8 ++++---- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/rc/bin/inst/confignet b/rc/bin/inst/confignet index b6b738fa8..5eb581b5f 100755 --- a/rc/bin/inst/confignet +++ b/rc/bin/inst/confignet @@ -4,9 +4,12 @@ switch($1){ case checkready checkdone + netdev=/net/ether* + netdev=$netdev(1) if(~ $netisfrom none){ + netdev=/dev/null confignet=done - export confignet + export confignet netdev exit } if(~ $netisfrom ether){ @@ -14,15 +17,15 @@ case checkready checkdone $x=done ./config$netisfrom checkdone confignet=$$x - export confignet + export confignet netdev exit } confignet=ready - export confignet + export confignet netdev exit case go - if(! test -d /net/ether0 >[2]/dev/null){ + if(! test -d $netdev >[2]/dev/null){ echo echo 'Could not find ethernet card.' echo diff --git a/rc/bin/inst/ndbsetup b/rc/bin/inst/ndbsetup index 6824c9192..8c72076ef 100755 --- a/rc/bin/inst/ndbsetup +++ b/rc/bin/inst/ndbsetup @@ -3,7 +3,7 @@ # desc: setup network configuration # prereq: confignet copydist -etheraddr=`{cat /net/ether0/addr >[2]/dev/null} +etheraddr=`{cat $netdev/addr >[2]/dev/null} switch($1){ case checkready checkdone diff --git a/rc/bin/inst/startether b/rc/bin/inst/startether index 2580add19..cb38e6dbd 100755 --- a/rc/bin/inst/startether +++ b/rc/bin/inst/startether @@ -5,25 +5,25 @@ switch($1) { case checkready - if(isipdevup /net/ether0) { + if(isipdevup $netdev) { startether=done export startether } case go - if(isipdevup /net/ether0) + if(isipdevup $netdev) exit log starting ethernet $ethermethod config switch($ethermethod) { case manual - ip/ipconfig -g $gwaddr ether /net/ether0 $ipaddr $ipmask >>[2]/srv/log + ip/ipconfig -g $gwaddr ether $netdev $ipaddr $ipmask >>[2]/srv/log case dhcp ip/ipconfig >>[2]/srv/log } case checkdone - if(! isipdevup /net/ether0) { + if(! isipdevup $netdev) { startether=notdone export startether }