linux-postmarketos-qcom-sdm670: enable null tty
The Google Pixel 3a automatically appends console=null to the command line. In the kernel, the preferred console is set to ttynull. Since ttynull is not automatically enabled, a warning is currently emitted:
[ 0.909853] Warning: unable to open an initial console.
This also causes stdin, stdout, and stderr to be missing from the init process.
In the busybox implementation, syslogd creates the /dev/log socket and opens /dev/kmsg. This happens just before daemonizing, which opens /dev/null and aliases stdin, stdout, and stderr to it. After daemonizing and potentially closing the socket, stdin is aliased to the socket to save stack memory. If the program starts without stdin under Linux, the socket gains the constant STDIN_FILENO file descriptor, which is cleared when daemonizing.
Syscalls when the 0, 1, 2 file descriptors aren't open:
socket(AF_UNIX, SOCK_DGRAM, 0) = 0
openat(AT_FDCWD, "/dev/kmsg", O_WRONLY|O_LARGEFILE) = 1
openat(AT_FDCWD, "/dev/null", O_RDWR|O_LARGEFILE) = 2
Enable the CONFIG_NULL_TTY option and update the configuration to allow the kernel to open stdin, stdout, and stderr for the init and (by inheritance) syslogd processes. It's technically an expert option but isn't enabled by default (and can be enabled in config fragments).
Closes #3269 (closed)
This kernel change is unscheduled. If this would prevent the scheduled kernel upgrade on the week of Dec 1 - Dec 7, then the scheduled one should take precedence.
Merge request reports
Activity
- Resolved by Alexey Minnekhanov
Strictly speaking, I'm not opposed to working around the bug here. But at the same time, I think we definitely should figure out how we can solve #3269 (closed) properly in userspace.
- Resolved by Alexey Minnekhanov
The description of CONFIG_NULL_TTY says
In order to use this driver, you should redirect the console to this TTY, or boot the kernel with console=ttynull.
not
console=null
. Or does null work same as ttynull?
added 14 commits
-
1f9f6c3d...e60c77ac - 13 commits from branch
postmarketOS:master
- 8834db0f - linux-postmarketos-qcom-sdm670: enable null tty (MR 5856)
-
1f9f6c3d...e60c77ac - 13 commits from branch
enabled an automatic merge when all merge checks for 8834db0f pass