Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/installer.py
diff options
context:
space:
mode:
authorAnton Hvornum <anton@hvornum.se>2022-03-28 14:43:33 +0200
committerGitHub <noreply@github.com>2022-03-28 14:43:33 +0200
commit77bfa10d53bb0b18fa775b06596c6463e06e602b (patch)
tree1abf3584c49ef4068eae425cc05237ce4f754cc5 /archinstall/lib/installer.py
parentc92c448f294b10f6a8858d3df1c67fce90019803 (diff)
Added error handling to fstab (#1045)
* Added error handling to fstab * Checking the exit code for == 0
Diffstat (limited to 'archinstall/lib/installer.py')
-rw-r--r--archinstall/lib/installer.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/archinstall/lib/installer.py b/archinstall/lib/installer.py
index 13bca56b..f10b4064 100644
--- a/archinstall/lib/installer.py
+++ b/archinstall/lib/installer.py
@@ -380,11 +380,14 @@ class Installer:
def genfstab(self, flags :str = '-pU') -> bool:
self.log(f"Updating {self.target}/etc/fstab", level=logging.INFO)
+ if not (fstab := SysCommand(f'/usr/bin/genfstab {flags} {self.target}')).exit_code == 0:
+ raise RequirementError(f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n Error: {fstab}')
+
with open(f"{self.target}/etc/fstab", 'a') as fstab_fh:
- fstab_fh.write((fstab := SysCommand(f'/usr/bin/genfstab {flags} {self.target}')).decode())
+ fstab_fh.write(fstab.decode())
if not os.path.isfile(f'{self.target}/etc/fstab'):
- raise RequirementError(f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n{fstab}')
+ raise RequirementError(f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n Error: {fstab}')
for plugin in plugins.values():
if hasattr(plugin, 'on_genfstab'):