From 521b7ea84a080dc477c420b2374b54f2894caba2 Mon Sep 17 00:00:00 2001 From: Gardouille Date: Fri, 5 Apr 2019 13:36:52 +0200 Subject: [PATCH] Chroot: Now use a network unit for systemd-networkd --- debian/chroot.install | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/debian/chroot.install b/debian/chroot.install index 72eb93e..07d13da 100755 --- a/debian/chroot.install +++ b/debian/chroot.install @@ -201,28 +201,31 @@ sed -i 's;target;;g' /target/etc/fstab sed -i 's;//;;g' /target/etc/fstab ## }}} ## Network {{{ +### Get all informations from current network configuration in rescue mode net_device=$(ip r | grep "^default" | head -1 | cut -d" " -f5) net_address=$(ip r | grep -vE "(^default|metric)" | grep "${net_device}.*src" | head -1 | awk -F" " '{print $NF}') +read -r net_mac_address /target/etc/systemd/network/50-default.network -source-directory /etc/network/interfaces.d" > /target/etc/network/interfaces +### Ensure to enable systemd-networkd at startup +chroot /target systemctl enable systemd-networkd ## }}} ## Ensure to remount device {{{