diff options
author | Andy Lutomirski <luto@kernel.org> | 2016-06-24 16:03:57 -0700 |
---|---|---|
committer | Andy Lutomirski <luto@kernel.org> | 2016-06-24 16:03:57 -0700 |
commit | 4545b7c7e4c5018b2c5a0d55d7645e3587eef7d9 (patch) | |
tree | 998e4a3f2764e8ff0072c60eaffd87acc39487e0 | |
parent | 5e805f51963b98f7cf9191ea2cede31a6ed3487e (diff) | |
download | virtme-4545b7c7e4c5018b2c5a0d55d7645e3587eef7d9.tar.gz |
virtme-init: Explicitly probe for the address of the --net nic
Modern systemd renames it, so probe to find its new name.
Signed-off-by: Andy Lutomirski <luto@kernel.org>
-rwxr-xr-x | virtme/guest/virtme-init | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/virtme/guest/virtme-init b/virtme/guest/virtme-init index bd03c3b..8f37fd9 100755 --- a/virtme/guest/virtme-init +++ b/virtme/guest/virtme-init @@ -127,7 +127,10 @@ if cat /proc/cmdline |grep -q -E '(^| )virtme.dhcp($| )'; then mount --bind "$tmpfile" /etc/resolv.conf rm "$tmpfile" fi - busybox udhcpc -i eth0 -t 1 -n -q -f -s "$(dirname $0)/virtme-udhcpc-script" + + # udev is liable to rename the interface out from under us. + virtme_net=`ls "$(ls -d /sys/bus/virtio/drivers/virtio_net/virtio* |sort -g |head -n1)"/net` + busybox udhcpc -i "$virtme_net" -t 1 -n -q -f -s "$(dirname $0)/virtme-udhcpc-script" fi if [[ -x /run/virtme/data/script ]]; then |