Updated fstab to better match the given input

This commit is contained in:
Anton Hvornum 2020-12-07 20:18:47 +01:00
parent ba863c341d
commit 0de302c47d
1 changed files with 3 additions and 3 deletions

View File

@ -118,9 +118,9 @@ class Installer():
def genfstab(self, flags='-pU'):
self.log(f"Updating {self.mountpoint}/etc/fstab", level=LOG_LEVELS.Info)
o = b''.join(sys_command(f'/usr/bin/genfstab {flags} {self.mountpoint}'))
with open(f"{self.mountpoint}/etc/fstab", 'a') as fstab:
fstab.write(f"\n{o.decode('UTF-8')}")
with open(f"{self.mountpoint}/etc/fstab", 'ab') as fstab:
for line in sys_command(f'/usr/bin/genfstab {flags} {self.mountpoint}'):
fstab.write(f"{line}\n")
if not os.path.isfile(f'{self.mountpoint}/etc/fstab'):
raise RequirementError(f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n{o}')