diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 71e90ef97..c8597c1b4 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -20,6 +20,7 @@ RUN \ rc-update add vsudd boot && \ rc-update add sysklogd boot && \ rc-update add hwclock boot && \ + rc-update add tap-vsockd boot && \ rc-update add networking boot && \ rc-update add acpid default && \ rc-update add chronyd default && \ diff --git a/alpine/etc/network/interfaces b/alpine/etc/network/interfaces index 448065704..16bf29af8 100644 --- a/alpine/etc/network/interfaces +++ b/alpine/etc/network/interfaces @@ -4,10 +4,3 @@ iface lo inet loopback auto eth0 iface eth0 inet dhcp udhcpc_opts -T 3 -A 3 -t 20 -O search - -auto eth1 -iface eth1 inet dhcp - udhcpc_opts -T 1 -A 3 - metric 199 - pre-up service tap-vsockd start - post-down service tap-vsockd stop diff --git a/alpine/etc/network/interfaces.template b/alpine/etc/network/interfaces.template deleted file mode 100644 index a8c2edd82..000000000 --- a/alpine/etc/network/interfaces.template +++ /dev/null @@ -1,9 +0,0 @@ -auto lo -iface lo inet loopback - -auto eth1 -iface eth1 inet dhcp - udhcpc_opts -T 1 -A 3 - metric 199 - pre-up service tap-vsockd start - post-down service tap-vsockd stop diff --git a/alpine/packages/hostsettings/etc/init.d/hostsettings b/alpine/packages/hostsettings/etc/init.d/hostsettings index f2f9a44e0..a502b6216 100755 --- a/alpine/packages/hostsettings/etc/init.d/hostsettings +++ b/alpine/packages/hostsettings/etc/init.d/hostsettings @@ -13,27 +13,24 @@ start() { mobyconfig exists etc/sysfs.conf && mobyconfig get etc/sysfs.conf > /etc/sysfs.conf mobyconfig exists etc/resolv.conf && mobyconfig get etc/resolv.conf > /etc/resolv.conf mobyconfig exists random-seed && mobyconfig get random-seed > /dev/urandom - mobyconfig exists etc/hosts && mobyconfig get etc/hosts >> /etc/hosts - # handle static network config if configured - mobyconfig exists net/config && NETCONFIG=`mobyconfig get net/config` - if [ "${NETCONFIG}" = "static" ]; then - # assume that the other configsDB entries exist - IP=`mobyconfig get net/address` - MASK=`mobyconfig get net/netmask` - GW=`mobyconfig get net/gateway` - - cp /etc/network/interfaces.template /etc/network/interfaces - echo >> /etc/network/interfaces - echo "auto eth0" >> /etc/network/interfaces - echo "iface eth0 inet static" >> /etc/network/interfaces - echo " address ${IP}" >> /etc/network/interfaces - echo " netmask ${MASK}" >> /etc/network/interfaces - echo " gateway ${GW}" >> /etc/network/interfaces - echo " metric 200" >> /etc/network/interfaces + if [ "$(mobyplatform)" = "windows" ]; then + # We have two network interfaces. The Hyper-V interface + # comes up as eth0. Rename and configure it. + ip link set eth0 down + ip link set eth0 name hvint0 + + mobyconfig exists net/config && NETCONFIG=`mobyconfig get net/config` + if [ "${NETCONFIG}" = "static" ]; then + # assume that the other configsDB entries exist + IP=`mobyconfig get net/address` + MASK=`mobyconfig get net/netmask` + ip addr add ${IP}/${MASK} dev hvint0 + ip link set hvint0 up + fi fi - + mobyconfig exists etc/ssl/certs/ca-certificates.crt && mobyconfig get etc/ssl/certs/ca-certificates.crt >> /etc/ssl/certs/ca-certificates.crt eend 0 diff --git a/alpine/packages/tap-vsockd/etc/init.d/tap-vsockd b/alpine/packages/tap-vsockd/etc/init.d/tap-vsockd index 6a71dfb2c..0886276ed 100755 --- a/alpine/packages/tap-vsockd/etc/init.d/tap-vsockd +++ b/alpine/packages/tap-vsockd/etc/init.d/tap-vsockd @@ -23,6 +23,7 @@ start() --background \ --pidfile ${PIDFILE} \ -- \ + --tap eth0 \ --pidfile "${PIDFILE}" \ --listen