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>
This commit is contained in:
parent
2954e4397b
commit
9f4f29bd29
|
|
@ -755,6 +755,13 @@ class Installer:
|
|||
for psk in psk_files:
|
||||
shutil.copy2(psk, f'{self.target}/var/lib/iwd/{os.path.basename(psk)}')
|
||||
|
||||
# Enable systemd-resolved by (forcefully) setting a symlink
|
||||
# For further details see https://wiki.archlinux.org/title/Systemd-resolved#DNS
|
||||
resolv_config_path = Path(f'{self.target}/etc/resolv.conf')
|
||||
if resolv_config_path.exists():
|
||||
os.unlink(resolv_config_path)
|
||||
os.symlink('/run/systemd/resolve/stub-resolv.conf', resolv_config_path)
|
||||
|
||||
# Copy (if any) systemd-networkd config files
|
||||
if netconfigurations := glob.glob('/etc/systemd/network/*'):
|
||||
if not os.path.isdir(f'{self.target}/etc/systemd/network/'):
|
||||
|
|
|
|||
Loading…
Reference in New Issue