Fixing a strip glitch in `sys_command()` causing certain output to get truncated in unwanted places (like fstab)

This commit is contained in:
Anton Hvornum 2020-12-07 20:36:06 +01:00
parent 5c8d24a329
commit 21cfe5708c
2 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ class sys_command():#Thread):
while alive and not self.kwargs['emulate']:
for fileno, event in poller.poll(0.1):
try:
output = os.read(child_fd, 8192).strip()
output = os.read(child_fd, 8192)
self.trace_log += output
except OSError:
alive = False

View File

@ -121,7 +121,7 @@ class Installer():
fstab = sys_command(f'/usr/bin/genfstab {flags} {self.mountpoint}').trace_log
print(fstab)
with open(f"{self.mountpoint}/etc/fstab", 'ab') as fstab_fh:
fstab.write(fstab)
fstab_fh.write(fstab)
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}')