Fix fstab line endings (#2400)
This commit is contained in:
parent
2a33d7cd97
commit
b87c41e92f
|
|
@ -440,6 +440,12 @@ class SysCommand:
|
||||||
return val.strip()
|
return val.strip()
|
||||||
return val
|
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
|
@property
|
||||||
def exit_code(self) -> Optional[int]:
|
def exit_code(self) -> Optional[int]:
|
||||||
if self.session:
|
if self.session:
|
||||||
|
|
|
||||||
|
|
@ -362,12 +362,12 @@ class Installer:
|
||||||
info(f"Updating {fstab_path}")
|
info(f"Updating {fstab_path}")
|
||||||
|
|
||||||
try:
|
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:
|
except SysCallError as err:
|
||||||
raise RequirementError(
|
raise RequirementError(
|
||||||
f'Could not generate fstab, strapping in packages most likely failed (disk out of space?)\n Error: {err}')
|
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)
|
fp.write(gen_fstab)
|
||||||
|
|
||||||
if not fstab_path.is_file():
|
if not fstab_path.is_file():
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue