]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
archlinux: Do DHCP on eth0
authorStéphane Graber <stgraber@ubuntu.com>
Thu, 13 Oct 2016 18:32:03 +0000 (14:32 -0400)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 18 Nov 2016 01:32:02 +0000 (20:32 -0500)
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-archlinux.in

index 6ea80a788319920e8fa25a6b447367e7184c250d..c2e24e3e26784cf39352881a007ecd2bf0b5f558 100755 (executable)
@@ -97,6 +97,15 @@ EOF
        [ "${r#nameserver}" = "$r" ] || echo "$r"
     done < /etc/resolv.conf > "${rootfs_path}/etc/resolv.conf"
 
+    # network configuration
+    cat > "${rootfs_path}/etc/systemd/network/eth0.network" << EOF
+[Match]
+Name=eth0
+
+[Network]
+DHCP=ipv4
+EOF
+
     # chroot and configure system
     arch-chroot "${rootfs_path}" /bin/bash -s << EOF
 mkdir /run/lock
@@ -120,6 +129,9 @@ sed -e 's/^ConditionPathIsReadWrite=\/proc\/sys\/$/ConditionPathIsReadWrite=\/pr
 # initialize pacman keyring
 pacman-key --init
 pacman-key --populate archlinux
+
+# enable networkd
+systemctl enable systemd-networkd
 EOF
     return 0
 }