-
Notifications
You must be signed in to change notification settings - Fork 502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fstab has carriage returns #1399
Comments
Yeah, I noticed this as well... vim shows |
short reproducer (with arch-install-scripts cloned as well): try_fstab.py:
Bare in mind that Also, am I getting crazy or is there really something weird going on, suddenly in the middle of trace
btw, for the context:
|
I'm almost certain by now it has something to do with This (closest to the orginal) do reproduce the issue:
And this does NOT:
mhm, |
@kamiccolo, how about this? Reproduce the issue: import os
import pty
import time
pid, fd = pty.fork()
if pid == 0:
os.execv('/usr/bin/printf', ['printf', 'foo\nbar\n'])
else:
time.sleep(1)
output = os.read(fd, 8192)
print(output) Output: Utilize the import os
import pty
import termios
import time
pid, fd = pty.fork()
if pid == 0:
os.execv('/usr/bin/printf', ['printf', 'foo\nbar\n'])
else:
attr = termios.tcgetattr(fd)
attr[1] &= ~termios.ONLCR
termios.tcsetattr(fd, termios.TCSANOW, attr)
time.sleep(1)
output = os.read(fd, 8192)
print(output) Output: [1] https://docs.python.org/3/library/termios.html |
Woa, way nicer and clearer explanation. Been bashing my head with those different |
Is only fstab affected by this? |
What the actual * haha, I love the pin point accuracy in the example. Thank you!
Any output relying on We could set a default flag to But I think setting the tty attribute is the cleanest approach? |
Checking the output of the examples below will show that import os
os.execv('/usr/bin/stty', ['stty', '-a']) import os
import pty
import time
pid, fd = pty.fork()
if pid == 0:
os.execv('/usr/bin/stty', ['stty', '-a'])
else:
time.sleep(1)
output = os.read(fd, 8192)
print(output) I do not understand why the Edit: I made an incorrect conclusion from the examples I gave in this comment. Fixed the first example incorrectly showing |
But suggestions are always welcome :) |
There is not any use of
I have none yet because I still lack an understanding of what necessitates the design choices for |
I understand now that the desire is for The only fix other than disabling import os
import pty
pid, fd = pty.fork()
if pid == 0:
os.execv('/usr/bin/printf', ['printf', 'foo\nbar\nbaz\n'])
else:
output = b''
while true:
try:
data = os.read(fd, 1024)
output += data.replace(b'\r\n', b'\n')
except:
break
print(output)
print(output.decode(), end='') Output:
|
I wonder, wasn't this particular issue already solved. There were a few simplifications of |
This issue has not been solved. The issue was inadvertently fixed for Btrfs in commit 00b0ae7 but the last line of the fstab file will be missing a newline ( archinstall/archinstall/lib/installer.py Line 338 in f107104
archinstall/archinstall/lib/general.py Line 433 in f107104
archinstall/archinstall/lib/general.py Lines 439 to 440 in f107104
The logic added to the In this for loop if the file system is Btrfs then the fstab file, which will contain the carriage return-newlines ( archinstall/archinstall/lib/installer.py Lines 358 to 387 in f107104
For the intended purpose the read and write of the file only need to occur once if even at all, not iteratively by way of a double nested for loop but that is yet another issue. |
After running archinstall, the generated /etc/fstab contains carriage returns (0x0D). This causes the following message in the systemd journal when booting into the newly installed system:
systemd-fstab-generator[251]: Mount point is not a valid path, ignoring.
Expected behavior: /etc/fstab should use only line feeds (0x0A) to represent new lines.
This may be related to issue #1378.
The text was updated successfully, but these errors were encountered: