Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,15 @@ def configure_nic(self, nic: Nic) -> None:
with open(f'{self.target}/etc/systemd/network/10-{nic.iface}.network', 'a') as netconf:
netconf.write(str(conf))

def systemd_resolved_stub_mode(self) -> None:
"""
Enable systemd-resolved stub mode by (forcefully) setting a symlink
For further details see https://wiki.archlinux.org/title/Systemd-resolved#DNS
"""
resolv = self.target / 'etc/resolv.conf'
resolv.unlink(missing_ok=True)
resolv.symlink_to('/run/systemd/resolve/stub-resolv.conf')

def copy_iso_network_config(self, enable_services: bool = False) -> bool:
# Copy (if any) iwd password and config files
iwd_dir = LPath('/var/lib/iwd')
Expand Down Expand Up @@ -802,11 +811,7 @@ def post_install_enable_iwd_service(*args: str, **kwargs: str) -> None:
self.pacman.strap('iwd')
self.enable_service('iwd')

# Enable systemd-resolved by (forcefully) setting a symlink
# For further details see https://wiki.archlinux.org/title/Systemd-resolved#DNS
resolv_config_path = self.target / 'etc/resolv.conf'
resolv_config_path.unlink(missing_ok=True)
resolv_config_path.symlink_to('/run/systemd/resolve/stub-resolv.conf')
self.systemd_resolved_stub_mode()

# Copy (if any) systemd-networkd config files
network_dir = LPath('/etc/systemd/network')
Expand Down
4 changes: 1 addition & 3 deletions archinstall/lib/network/network_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,4 @@ def _configure_iwd_standalone(installation: Installer) -> None:
""")
_ = wired_conf.write_text(wired_conf_content)

resolv = installation.target / 'etc/resolv.conf'
resolv.unlink(missing_ok=True)
resolv.symlink_to('/run/systemd/resolve/stub-resolv.conf')
installation.systemd_resolved_stub_mode()