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:
authorAnton Hvornum <anton@hvornum.se>2022-05-26 18:46:10 +0200
committerGitHub <noreply@github.com>2022-05-26 18:46:10 +0200
commitc93482a8b943a593608d8bae7156e357ed0002d5 (patch)
treeba86096368c74ae48212ed4751d06e7883b229e6 /archinstall/lib/systemd.py
parentf1608e76647578c731e51a7c1303656519aa2e5e (diff)
Rework btrfs handling (#1234)
* Restructuring btrfs.py into lib/btrfs/*.py * Reworking how BTRFS subvolumes get represented, and worked with. Subvolumes are now their own entity which can be used to access it's information, parents or mount location. * Added BtrfsSubvolume.partition and other stuff. * Reworking the way luks2().unlock and .format() returns device instances. They should now return BTRFSSubvolume where appropriate. * Fixed a missing import * Fixed an issue where mkfs.btrfs wouldn't trigger due to busy disk. * Fixing subvol mounting without creating a fake instance. * Added creation of mountpint for btrfs subvolume * Fixed root detection * Re-worked mounting into a queue system using frozen mounting calls using lambda * Removed old mount_subvolume() function * Removed get_subvolumes_from_findmnt() * Fixed Partition().subvolumes iteration * Adding .root to BtrfsSubvolume * Fixed issue in SysCommandWorker where log output would break and crash execution due to cmd being a string vs list * Changed return-value from MapperDev.mountpoint to pathlib.Path
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: