diff options
author | Karsten Hopp <karsten@redhat.de> | 2004-11-02 13:09:47 +0000 |
---|---|---|
committer | Karsten Hopp <karsten@redhat.de> | 2004-11-02 13:09:47 +0000 |
commit | 3f0aaef656c86146a0a273604dddf9147fc430bf (patch) | |
tree | 58e1ef05271c6c63f208fad4643f31d144829521 /loader2 | |
parent | d34292a6e6c2142a1097ea4fd02b059378c5c4b9 (diff) | |
download | anaconda-3f0aaef656c86146a0a273604dddf9147fc430bf.tar.gz anaconda-3f0aaef656c86146a0a273604dddf9147fc430bf.tar.xz anaconda-3f0aaef656c86146a0a273604dddf9147fc430bf.zip |
jump through some hoops to find out the LCS interface name
Diffstat (limited to 'loader2')
-rw-r--r-- | loader2/linuxrc.s390 | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/loader2/linuxrc.s390 b/loader2/linuxrc.s390 index 6cd344cff..a0727865d 100644 --- a/loader2/linuxrc.s390 +++ b/loader2/linuxrc.s390 @@ -55,6 +55,32 @@ sysecho () { [ -f $file ] && echo $* > $file } +# jump through some hoops to find out the LCS interface name +getlcsifname() { + local dirs driver readport ifname + ifname="" + dirs=`/bin/ls -d /sys/class/net/eth* /sys/class/net/tr* 2>/dev/null` + for i in $dirs; do + driver=`readlink $i/driver` + driver=`basename $driver` + if [ "$driver" == "lcs" ]; then + readport=`readlink $i/device` + readport=`basename $readport` + if [ "$readport" == "$1" ]; then + ifname=`basename $i` + break + fi + fi + done + if [ -n "$ifname" ]; then + DEVICE=$ifname + else + echo "Could not detect LCS interface, aborting..." + exit + fi +} + + startinetd() { echo @@ -293,10 +319,9 @@ elif [ "$NETTYPE" = "lcs" ]; then insmod cu3088$LO insmod lcs$LO setupdevice -# KH FIXME: Workaround for missing sysfs interface, hardcode it to -# eth0 for now, ignore TokenRing +# KH FIXME: Workaround for missing sysfs interface # DEVICE=`cat /sys/devices/lcs/${SUBCHANNELS//,*/}/if_name` - DEVICE=eth0 + getlcsifname ${SUBCHANNELS//,*/} ifconfig $DEVICE $IPADDR $MMTU netmask $NETMASK broadcast $BROADCAST route add -net $NETWORK netmask $NETMASK dev $DEVICE 2>/dev/null echo "alias $DEVICE lcs" >> /tmp/modprobe.conf |