Skip to content

Commit

Permalink
Merge pull request #100 from grazzolini/fix_enable_services
Browse files Browse the repository at this point in the history
installer: Make sure networkd and resolved are enabled
  • Loading branch information
Torxed authored Jan 26, 2021
2 parents 4678788 + 66293c1 commit b2edfa4
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions archinstall/lib/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,17 +224,13 @@ def copy_ISO_network_config(self, enable_services=False):
# base is not installed yet.
def post_install_enable_iwd_service(*args, **kwargs):
self.enable_service('iwd')
self.enable_service('systemd-networkd')
self.enable_service('systemd-resolved')

self.post_base_install.append(post_install_enable_iwd_service)
# Otherwise, we can go ahead and add the required package
# and enable it's service:
else:
self.pacstrap('iwd')
self.enable_service('iwd')
self.enable_service('systemd-networkd')
self.enable_service('systemd-resolved')

for psk in psk_files:
shutil.copy2(psk, f"{self.mountpoint}/var/lib/iwd/{os.path.basename(psk)}")
Expand All @@ -247,6 +243,19 @@ def post_install_enable_iwd_service(*args, **kwargs):
for netconf_file in netconfigurations:
shutil.copy2(netconf_file, f"{self.mountpoint}/etc/systemd/network/{os.path.basename(netconf_file)}")

if enable_services:
# If we haven't installed the base yet (function called pre-maturely)
if self.helper_flags.get('base', False) is False:
def post_install_enable_networkd_resolved(*args, **kwargs):
self.enable_service('systemd-networkd')
self.enable_service('systemd-resolved')

self.post_base_install.append(post_install_enable_networkd_resolved)
# Otherwise, we can go ahead and enable the services
else:
self.enable_service('systemd-networkd')
self.enable_service('systemd-resolved')

return True

def minimal_installation(self):
Expand Down

0 comments on commit b2edfa4

Please sign in to comment.