From 21ab9e1f34e32b0db65d33d8a9ccf88fe17144e1 Mon Sep 17 00:00:00 2001 From: Isaac True Date: Fri, 17 Jan 2025 13:50:11 +0100 Subject: [PATCH 1/3] boxes: ubuntu: switch to using systemd-networkd for networking --- boxes/ubuntu/appliance.kiwi | 1 - boxes/ubuntu/config.sh | 5 +++++ boxes/ubuntu/root/etc/network/interfaces.d/lan0 | 3 --- boxes/ubuntu/root/etc/systemd/network/lan0.network | 5 +++++ 4 files changed, 10 insertions(+), 4 deletions(-) delete mode 100644 boxes/ubuntu/root/etc/network/interfaces.d/lan0 create mode 100644 boxes/ubuntu/root/etc/systemd/network/lan0.network diff --git a/boxes/ubuntu/appliance.kiwi b/boxes/ubuntu/appliance.kiwi index 9066786..831140b 100644 --- a/boxes/ubuntu/appliance.kiwi +++ b/boxes/ubuntu/appliance.kiwi @@ -70,7 +70,6 @@ - diff --git a/boxes/ubuntu/config.sh b/boxes/ubuntu/config.sh index b068ee7..6accfe7 100644 --- a/boxes/ubuntu/config.sh +++ b/boxes/ubuntu/config.sh @@ -37,3 +37,8 @@ systemctl mask lvm2-lvmetad.socket # Enable firstboot resolv.conf setting #-------------------------------------- baseInsertService symlink-resolvconf + +#====================================== +# Enable systemd networking services +#-------------------------------------- +baseInsertService systemd-networkd diff --git a/boxes/ubuntu/root/etc/network/interfaces.d/lan0 b/boxes/ubuntu/root/etc/network/interfaces.d/lan0 deleted file mode 100644 index 3f2547a..0000000 --- a/boxes/ubuntu/root/etc/network/interfaces.d/lan0 +++ /dev/null @@ -1,3 +0,0 @@ -auto lan0 -allow-hotplug lan0 -iface lan0 inet dhcp diff --git a/boxes/ubuntu/root/etc/systemd/network/lan0.network b/boxes/ubuntu/root/etc/systemd/network/lan0.network new file mode 100644 index 0000000..0736919 --- /dev/null +++ b/boxes/ubuntu/root/etc/systemd/network/lan0.network @@ -0,0 +1,5 @@ +[Match] +Name=lan0 + +[Network] +DHCP=Yes From 6256210839f2982c68734b472b40d760a9ee9fbe Mon Sep 17 00:00:00 2001 From: Isaac True Date: Fri, 17 Jan 2025 13:50:15 +0100 Subject: [PATCH 2/3] boxes: ubuntu: use systemd-resolved for DNS resolution --- boxes/ubuntu/appliance.kiwi | 1 + boxes/ubuntu/config.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/boxes/ubuntu/appliance.kiwi b/boxes/ubuntu/appliance.kiwi index 831140b..7c85865 100644 --- a/boxes/ubuntu/appliance.kiwi +++ b/boxes/ubuntu/appliance.kiwi @@ -64,6 +64,7 @@ + diff --git a/boxes/ubuntu/config.sh b/boxes/ubuntu/config.sh index 6accfe7..9c5bb0a 100644 --- a/boxes/ubuntu/config.sh +++ b/boxes/ubuntu/config.sh @@ -42,3 +42,4 @@ baseInsertService symlink-resolvconf # Enable systemd networking services #-------------------------------------- baseInsertService systemd-networkd +baseInsertService systemd-resolved From 8303d937656a5fdb5ad2b6981d05864a7854fda5 Mon Sep 17 00:00:00 2001 From: Isaac True Date: Fri, 17 Jan 2025 14:00:29 +0100 Subject: [PATCH 3/3] boxes: ubuntu: remove service to set the resolv.conf symlink This step is performed automatically by the installation process of systemd-resolved. --- boxes/ubuntu/config.sh | 5 ----- .../etc/systemd/system/symlink-resolvconf.service | 12 ------------ 2 files changed, 17 deletions(-) delete mode 100644 boxes/ubuntu/root/etc/systemd/system/symlink-resolvconf.service diff --git a/boxes/ubuntu/config.sh b/boxes/ubuntu/config.sh index 9c5bb0a..98196b5 100644 --- a/boxes/ubuntu/config.sh +++ b/boxes/ubuntu/config.sh @@ -33,11 +33,6 @@ systemctl mask lvm2-lvmetad systemctl disable lvm2-lvmetad.socket systemctl mask lvm2-lvmetad.socket -#====================================== -# Enable firstboot resolv.conf setting -#-------------------------------------- -baseInsertService symlink-resolvconf - #====================================== # Enable systemd networking services #-------------------------------------- diff --git a/boxes/ubuntu/root/etc/systemd/system/symlink-resolvconf.service b/boxes/ubuntu/root/etc/systemd/system/symlink-resolvconf.service deleted file mode 100644 index b7ada88..0000000 --- a/boxes/ubuntu/root/etc/systemd/system/symlink-resolvconf.service +++ /dev/null @@ -1,12 +0,0 @@ -[Unit] -Description=Make the resolv.conf symlink during first boot -ConditionPathExists=!/etc/resolv.conf -ConditionPathExists=/etc/firstboot - -[Service] -Type=oneshot -ExecStart=/bin/ln -s /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf -ExecStartPost=/bin/rm /etc/firstboot - -[Install] -WantedBy=multi-user.target