Skip to content
Snippets Groups Projects

linux-postmarketos-qcom-sdm670: enable null tty

Merged Richard Acayan requested to merge rdacayan/pmaports:sargo into master
All threads resolved!

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

Merge request pipeline #211120 passed

Merge request pipeline passed for 8834db0f

Merged by Alexey MinnekhanovAlexey Minnekhanov 3 months ago (Nov 29, 2024 1:20am UTC)

Loading

Pipeline #211151 passed

Pipeline passed for 8834db0f on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading