Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Hvornum <anton.feeds+github@gmail.com>2019-11-29 12:47:17 +0100
committerAnton Hvornum <anton.feeds+github@gmail.com>2019-11-29 12:47:17 +0100
commit4652a3eee483fa4e565a48c2b6ed531b8c46ffc4 (patch)
tree98d94a1fe4b241d7753584bb0f31a4083d62a3e0
parent829a51a045e9cf5af2dce2f0c481cdda51c428ff (diff)
Fixing #24 and #12
-rw-r--r--archinstall.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/archinstall.py b/archinstall.py
index a7d46211..5dd57667 100644
--- a/archinstall.py
+++ b/archinstall.py
@@ -365,6 +365,9 @@ class sys_command():#Thread):
else:
self.exit_code = 0
+ if 'ignore_error' in self.kwargs:
+ self.exit_code = 0
+
if self.exit_code != 0:
log(f"{self.cmd[0]} did not exit gracefully, exit code {self.exit_code}.", origin='spawn', level=3)
log(self.trace_log.decode('UTF-8'), origin='spawn', level=3)
@@ -1102,7 +1105,7 @@ def run_post_install_steps(*positionals, **kwargs):
o = simple_command("cd /mnt; mount -t proc /proc proc")
o = simple_command("cd /mnt; mount --make-rslave --rbind /sys sys")
o = simple_command("cd /mnt; mount --make-rslave --rbind /dev dev")
- o = simple_command('chroot /mnt /bin/bash -c "{c}"'.format(c=command), opts=opts)
+ o = simple_command('chroot /mnt /bin/bash -c "{c}"'.format(c=command), events=opts)
o = simple_command("cd /mnt; umount -R dev")
o = simple_command("cd /mnt; umount -R sys")
o = simple_command("cd /mnt; umount -R proc")
@@ -1124,16 +1127,16 @@ def run_post_install_steps(*positionals, **kwargs):
## "<hostname> login" followed by "Passwodd" in case it's been set in a previous step.. usually this shouldn't be nessecary
## since we set the password as the last step. And then the command itself which will be executed by looking for:
## [root@<hostname> ~]#
- o = b''.join(sys_command('/usr/bin/systemd-nspawn -D /mnt -b --machine temporary', opts={'triggers' : {
- bytes(f'login:', 'UTF-8') : b'root\n',
- #b'Password:' : bytes(args['password']+'\n', 'UTF-8'),
- bytes(f'[root@{args["hostname"]} ~]#', 'UTF-8') : bytes(command+'\n', 'UTF-8'),
- }, **opts}))
+ o = b''.join(sys_command('/usr/bin/systemd-nspawn -D /mnt -b --machine temporary', events={
+ bytes(f'login:', 'UTF-8') : b'root\n',
+ #b'Password:' : bytes(args['password']+'\n', 'UTF-8'),
+ bytes(f'[root@{args["hostname"]} ~]#', 'UTF-8') : bytes(command+'\n', 'UTF-8'),
+ }, **opts))
## Not needed anymore: And cleanup after out selves.. Don't want to leave any residue..
# os.remove('/mnt/etc/systemd/system/console-getty.service.d/override.conf')
else:
- o = b''.join(sys_command('/usr/bin/systemd-nspawn -D /mnt --machine temporary {c}'.format(c=command), opts=opts))
+ o = b''.join(sys_command('/usr/bin/systemd-nspawn -D /mnt --machine temporary {c}'.format(c=command), **opts))
if type(conf[title][raw_command]) == bytes and len(conf[title][raw_command]) and not conf[title][raw_command] in o:
print('[W] Post install command failed: {}'.format(o.decode('UTF-8')))
#print(o)