
Originally Posted by
deano_ferrari
This did the job (for a while)
Code:
OUT=`udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null | grep ID_NET_NAME_ONBOARD`
EXITCODE=$?
if [ $EXITCODE -eq 0 ]; then
NEWETH0=`echo $OUT | cut -d = -f 2`
else
OUT=`udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null | grep ID_NET_NAME_SLOT`
EXITCODE=$?
if [ $EXITCODE -eq 0 ]; then
NEWETH0=`echo $OUT | cut -d = -f 2`
else
OUT=`udevadm test-builtin net_id /sys/class/net/eth0 2> /dev/null | grep ID_NET_NAME_PATH`
EXITCODE=$?
if [ $EXITCODE -eq 0 ]; then
NEWETH0=`echo $OUT | cut -d = -f 2`
fi
fi
fi
echo Will configure predicted network interface name $NEWETH0
But now I see that this not works always: The same udevadm version give on the same machine different answers in different environments
On a Ubuntu precise based system with kernel 3.15.1 I get:
Code:
#udevadm --version
208
#udevadm test-builtin net_id /sys/class/net/eth0
calling: test-builtin
=== trie on-disk ===
tool version: 208
file size: 5866515 bytes
header size 80 bytes
strings 1296323 bytes
nodes 4570112 bytes
load module index
ID_NET_NAME_MAC=enx000c29a7b286
ID_OUI_FROM_DATABASE=VMware, Inc.
ID_NET_NAME_PATH=enp2s0
unload module index
So the predicted network interface name is enp2s0
But in fact a suse 13.1 system with kernel 3.11.6-4 renames this interface to ens32:
Code:
# udevadm --version
208
# udevadm test-builtin net_id /sys/class/net/ens32
calling: test-builtin
=== trie on-disk ===
tool version: 208
file size: 5866515 bytes
header size 80 bytes
strings 1296323 bytes
nodes 4570112 bytes
load module index
ID_NET_NAME_MAC=enx000c29a7b286
ID_OUI_FROM_DATABASE=VMware, Inc.
ID_NET_NAME_PATH=enp2s0
ID_NET_NAME_SLOT=ens32
unload module index
So again I have the problem to predict the name of the Interface while installing Suse 13.1 from a non Suse bootimage.
Has anybody an Idea how to solve this problem ?
Thanks in advance
d.oertel
Bookmarks