Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/systemd.py
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2022-05-28 10:36:38 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2022-05-28 10:36:38 +0200
commitfaf925de1882be722d2994d697a802918282e509 (patch)
tree4856c76b10b36e94875ce3c9add961960bb23bf0 /archinstall/lib/systemd.py
parent3801bee921d22e23435c781c469d9ec0adfa00bd (diff)
parent78449f75bc44f0e2b03cb9d909b9b78e4f7ca4c8 (diff)
Merge branch 'upstreamMaster'
Diffstat (limited to 'archinstall/lib/systemd.py')
-rw-r--r--archinstall/lib/systemd.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/archinstall/lib/systemd.py b/archinstall/lib/systemd.py
index 417870da..3d2f0385 100644
--- a/archinstall/lib/systemd.py
+++ b/archinstall/lib/systemd.py
@@ -91,20 +91,25 @@ class Boot:
log(f"The error above occured in a temporary boot-up of the installation {self.instance}", level=logging.ERROR, fg="red")
shutdown = None
+ shutdown_exit_code = -1
try:
shutdown = SysCommand(f'systemd-run --machine={self.container_name} --pty shutdown now')
except SysCallError as error:
- if error.exit_code == 256:
- pass
+ shutdown_exit_code = error.exit_code
+ # if error.exit_code == 256:
+ # pass
while self.session.is_alive():
time.sleep(0.25)
- if self.session.exit_code == 0 or (shutdown and shutdown.exit_code == 0):
+ if shutdown:
+ shutdown_exit_code = shutdown.exit_code
+
+ if self.session.exit_code == 0 or shutdown_exit_code == 0:
storage['active_boot'] = None
else:
- raise SysCallError(f"Could not shut down temporary boot of {self.instance}: {shutdown}", exit_code=shutdown.exit_code)
+ raise SysCallError(f"Could not shut down temporary boot of {self.instance}: {self.session.exit_code}/{shutdown_exit_code}", exit_code=next(filter(bool, [self.session.exit_code, shutdown_exit_code])))
def __iter__(self) -> Iterator[str]:
if self.session: