Leave a plain resolv.conf for NetworkManager in the base image
provision.sh deleted the cloud image's link to systemd-resolved's resolv.conf, but systemd's tmpfiles put it back at the next boot. With systemd-resolved off the link led nowhere, NetworkManager won't replace a link it didn't make, and the VM had no DNS, so install.sh couldn't reach archlinux.org. An empty file stops tmpfiles, and NetworkManager fills it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-2
@@ -40,9 +40,11 @@ echo LANG=en_US.UTF-8 > /etc/locale.conf
|
|||||||
|
|
||||||
echo "== NetworkManager instead of systemd-networkd"
|
echo "== NetworkManager instead of systemd-networkd"
|
||||||
systemctl disable systemd-networkd.service systemd-networkd.socket systemd-resolved.service || true
|
systemctl disable systemd-networkd.service systemd-networkd.socket systemd-resolved.service || true
|
||||||
# NetworkManager writes its own resolv.conf; the cloud image's points at
|
# The cloud image's resolv.conf links to systemd-resolved's. NetworkManager
|
||||||
# systemd-resolved
|
# only writes a plain file, and systemd's tmpfiles puts the link back at boot
|
||||||
|
# if the file is missing, so leave an empty one for NetworkManager to fill.
|
||||||
rm -f /etc/resolv.conf
|
rm -f /etc/resolv.conf
|
||||||
|
touch /etc/resolv.conf
|
||||||
systemctl enable NetworkManager.service gdm.service sshd.service
|
systemctl enable NetworkManager.service gdm.service sshd.service
|
||||||
# Arch's cloud image makes boot wait until the clock has synced, and sshd
|
# Arch's cloud image makes boot wait until the clock has synced, and sshd
|
||||||
# waits for that. Without systemd-networkd, systemd-timesyncd thinks it's
|
# waits for that. Without systemd-networkd, systemd-timesyncd thinks it's
|
||||||
|
|||||||
Reference in New Issue
Block a user