Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2020-07-21 19:03:24 +0000
committerAnton Hvornum <anton.feeds+github@gmail.com>2020-07-21 19:03:24 +0000
commitc884a2523746892d15257b68f6f3681119681cf3 (patch)
tree602b33f0a841c838f1597e4c8a1335ca6caa170e /archinstall/lib/installer.py
parent06f8c46b3daaf0730a094c4cca26bd1fab6822af (diff)
Added a set_timezone() and fixed set_locale() in the Installer() class. Also added a mirrors.py helper to rudimentary set mirror data on the installer host
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 7f9aba71..90849bf2 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -70,17 +70,26 @@ class Installer():
raise RequirementError(f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n{o}')
return True
- def set_hostname(self, hostname=None):
+ def set_hostname(self, hostname=None, *args, **kwargs):
if not hostname: hostname = self.hostname
with open(f'{self.mountpoint}/etc/hostname', 'w') as fh:
fh.write(self.hostname + '\n')
- def set_locale(self, locale, encoding='UTF-8'):
+ def set_locale(self, locale, encoding='UTF-8', *args, **kwargs):
+ if not len(locale): return True
+
with open(f'{self.mountpoint}/etc/locale.gen', 'a') as fh:
fh.write(f'{locale} {encoding}\n')
with open(f'{self.mountpoint}/etc/locale.conf', 'w') as fh:
fh.write(f'LANG={locale}\n')
- sys_command(f'/usr/bin/arch-chroot {self.mountpoint} locale-gen')
+
+ return True if sys_command(f'/usr/bin/arch-chroot {self.mountpoint} locale-gen').exit_code == 0 else False
+
+ def set_timezone(self, zone, *args, **kwargs):
+ if not len(zone): return True
+
+ o = b''.join(sys_command(f'/usr/bin/arch-chroot {self.mountpoint} ln -s /usr/share/zoneinfo/{zone} /etc/localtime'))
+ return True
def minimal_installation(self):
self.pacstrap('base base-devel linux linux-firmware btrfs-progs efibootmgr nano'.split(' '))