index : archinstall32 | |
Archlinux32 installer | gitolite user |
summaryrefslogtreecommitdiff |
author | Anton Hvornum <anton.feeds+github@gmail.com> | 2020-11-11 21:37:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 21:37:40 +0000 |
commit | be8ac2558ef31bbd135ad5cea6c7f4c562061d7a (patch) | |
tree | 3ca98a8fc779aea829568b5d9b30b04532e1da1e /archinstall/lib/installer.py | |
parent | 9a1199333a0a00b74f884dfee1b324500d4b8060 (diff) | |
parent | 4dd20ae4d4abeed916c0d1271a637dcb3c80b9a6 (diff) |
-rw-r--r-- | archinstall/lib/installer.py | 26 |
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py index 775de50a..543f2ca3 100644 --- a/archinstall/lib/installer.py +++ b/archinstall/lib/installer.py @@ -6,6 +6,7 @@ from .general import * from .user_interaction import * from .profiles import Profile from .mirrors import * +from .systemd import Networkd from .output import log, LOG_LEVELS from .storage import storage @@ -149,6 +150,24 @@ class Installer(): def arch_chroot(self, cmd, *args, **kwargs): return self.run_command(cmd) + def configure_nic(self, nic, dhcp=True, ip=None, gateway=None, dns=None, *args, **kwargs): + if dhcp: + conf = Networkd(Match={"Name": nic}, Network={"DHCP": "yes"}) + else: + assert ip + + network = {"Address": ip} + if gateway: + network["Gateway"] = gateway + if dns: + assert type(dns) == list + network["DNS"] = dns + + conf = Networkd(Match={"Name": nic}, Network=network) + + with open(f"{self.mountpoint}/etc/systemd/network/10-{nic}.network", "a") as netconf: + netconf.write(str(conf)) + def minimal_installation(self): ## Add nessecary packages if encrypting the drive ## (encrypted partitions default to btrfs for now, so we need btrfs-progs) @@ -273,7 +292,8 @@ class Installer(): pass def set_keyboard_language(self, language): - with open(f'{self.mountpoint}/etc/vconsole.conf', 'w') as vconsole: - vconsole.write(f'KEYMAP={language}\n') - vconsole.write(f'FONT=lat9w-16\n') + if len(language.strip()): + with open(f'{self.mountpoint}/etc/vconsole.conf', 'w') as vconsole: + vconsole.write(f'KEYMAP={language}\n') + vconsole.write(f'FONT=lat9w-16\n') return True
\ No newline at end of file |