Fix fstab line endings (#2400)

This commit is contained in:
codefiles 2024-03-10 10:19:22 -04:00 committed by GitHub
parent 2a33d7cd97
commit b87c41e92f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View File

@ -440,6 +440,12 @@ class SysCommand:
return val.strip()
return val
def output(self) -> bytes:
if not self.session:
raise ValueError('No session available')
return self.session._trace_log.replace(b'\r\n', b'\n')
@property
def exit_code(self) -> Optional[int]:
if self.session:

View File

@ -362,12 +362,12 @@ class Installer:
info(f"Updating {fstab_path}")
try:
gen_fstab = SysCommand(f'/usr/bin/genfstab {flags} {self.target}').decode()
gen_fstab = SysCommand(f'/usr/bin/genfstab {flags} {self.target}').output()
except SysCallError as err:
raise RequirementError(
f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n Error: {err}')
with open(fstab_path, 'a') as fp:
with open(fstab_path, 'ab') as fp:
fp.write(gen_fstab)
if not fstab_path.is_file():