Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLord Anton Hvornum <anton.feeds@gmail.com>2018-04-11 23:20:56 +0200
committerLord Anton Hvornum <anton.feeds@gmail.com>2018-04-11 23:21:16 +0200
commit1e9e091a7eef140a71344d3384201fd580c76ed6 (patch)
tree2f523136f9265765f68e1c7c2f87a48ebc3b33b7
parent8535c1035371f8d148c3770226139823fb1d25ec (diff)
Testing pre-steps
-rw-r--r--archinstall.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/archinstall.py b/archinstall.py
index df857a87..9c22e680 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -237,6 +237,29 @@ if __name__ == '__main__':
o = run("sed -i 's/#Server/Server/' /root/mirrorlist")
o = run('rankmirrors -n 6 /root/mirrorlist > /etc/pacman.d/mirrorlist')
+ pre_conf = {}
+ if 'pre' in instructions:
+ pre_conf = instructions['pre']
+ elif 'prerequisits' in instructions:
+ pre_conf = instructions['prerequisits']
+
+ ## Prerequisit steps needs to NOT be executed in arch-chroot.
+ ## Mainly because there's no root structure to chroot into.
+ ## But partly because some configurations need to be done against the live CD.
+ ## (For instance, modifying mirrors are done on LiveCD and replicated intwards)
+ for title in pre_conf:
+ print('[N] Network prerequisit step: {}'.format(title))
+ for command in pre_conf[title]:
+ opts = pre_conf[title][command] if type(pre_conf[title][command]) in (dict, oDict) else {}
+ if len(opts):
+ print('[-] Options: {}'.format(opts))
+
+ #print('[N] Command: {} ({})'.format(command, opts))
+ o = run('{c}'.format(c=command), opts)
+ if type(conf[title][command]) == bytes and len(conf[title][command]) and not conf[title][command] in o:
+ print('[W] Prerequisit step failed: {}'.format(o.decode('UTF-8')))
+ #print(o)
+
print('[N] Straping in packages.')
o = run('pacman -Syy')
o = run('pacstrap /mnt base base-devel btrfs-progs efibootmgr nano wpa_supplicant dialog {packages}'.format(**args))