Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-08-04 11:34:00 +0200
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-08-04 11:34:00 +0200
commit928654ae350b9b79062e4d0bcb18f4b6ccea3b6b (patch)
treee5b213a4f43d88933969168cde6c57c17411a957 /archinstall/lib
parent551bb438a39e26fd137af6b75e6f886a5f810141 (diff)
Added two new functions. Fixed set_locale. enable_service() was added as well as activate_ntp().
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/installer.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 3310c335..ea9a605a 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -79,9 +79,9 @@ class Installer():
if not len(locale): return True
with open(f'{self.mountpoint}/etc/locale.gen', 'a') as fh:
- fh.write(f'{locale} {encoding}\n')
+ fh.write(f'{locale}.{encoding} {encoding}\n')
with open(f'{self.mountpoint}/etc/locale.conf', 'w') as fh:
- fh.write(f'LANG={locale}\n')
+ fh.write(f'LANG={locale}.{encoding}\n')
return True if sys_command(f'/usr/bin/arch-chroot {self.mountpoint} locale-gen').exit_code == 0 else False
@@ -91,6 +91,15 @@ class Installer():
o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} ln -s /usr/share/zoneinfo/{zone} /etc/localtime'))
return True
+ def activate_ntp(self):
+ if self.pacstrap('ntp'):
+ if self.enable_service('ntpd'):
+ return True
+
+ def enable_service(self, service):
+ log(f'Enabling service {service}')
+ return self.arch_chroot(f'systemctl enable {service}').exit_code == 0
+
def run_command(self, cmd, *args, **kwargs):
return sys_command(f'/usr/bin/arch-chroot {self.mountpoint} {cmd}')