Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2021-03-14 12:24:37 +0100
committerAnton Hvornum <anton@hvornum.se>2021-03-14 12:24:37 +0100
commitd2804993dbcd9fc6ff743d2886000407ec3b019e (patch)
tree2360d56625c69b904d591ee388aa9abf3bc518c8 /archinstall/lib
parent2ef7be9787c4d3acb91f91308acf7bf5c8715c1a (diff)
Added some error handling for umount().
Diffstat (limited to 'archinstall/lib')
-rw-r--r--archinstall/lib/disk.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/archinstall/lib/disk.py b/archinstall/lib/disk.py
index 16756df8..54f86f7a 100644
--- a/archinstall/lib/disk.py
+++ b/archinstall/lib/disk.py
@@ -313,9 +313,19 @@ class Partition():
return True
def unmount(self):
- if sys_command(f'/usr/bin/umount {self.path}').exit_code == 0:
- self.mountpoint = None
- return True
+ try:
+ exit_code = sys_command(f'/usr/bin/umount {self.path}').exit_code
+ except SysCallError as err:
+ exit_code = err.exit_code
+
+ # Without to much research, it seams that low error codes are errors.
+ # And above 8k is indicators such as "/dev/x not mounted.".
+ # So anything in between 0 and 8k are errors (?).
+ if exit_code > 0 and exit_code < 8000:
+ raise err
+
+ self.mountpoint = None
+ return True
def filesystem_supported(self):
"""