Skip to content

Commit 9f4f29b

Browse files
wahrwolfVincent Dahmen
andauthored
lib/network: adds symlink to configure systemd-resovled properly (#4052)
* lib/network: adds symlink to configure systemd-resovled properly * lib/network: adds overwrite mechanism to enforce resolved symlink --------- Co-authored-by: Vincent Dahmen <wahrwolf@wolfpit.net>
1 parent 2954e43 commit 9f4f29b

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

archinstall/lib/installer.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,13 @@ def post_install_enable_iwd_service(*args: str, **kwargs: str) -> None:
755755
for psk in psk_files:
756756
shutil.copy2(psk, f'{self.target}/var/lib/iwd/{os.path.basename(psk)}')
757757

758+
# Enable systemd-resolved by (forcefully) setting a symlink
759+
# For further details see https://wiki.archlinux.org/title/Systemd-resolved#DNS
760+
resolv_config_path = Path(f'{self.target}/etc/resolv.conf')
761+
if resolv_config_path.exists():
762+
os.unlink(resolv_config_path)
763+
os.symlink('/run/systemd/resolve/stub-resolv.conf', resolv_config_path)
764+
758765
# Copy (if any) systemd-networkd config files
759766
if netconfigurations := glob.glob('/etc/systemd/network/*'):
760767
if not os.path.isdir(f'{self.target}/etc/systemd/network/'):

0 commit comments

Comments
 (0)