Use ro.boot.serialconsole to disable console services
For many years, services declaring "console" would only be started if the console device specified by androidboot.console= was present under /dev. However, they would also be started if the /dev/console node existed. This fallback causes problems with newer GKI kernel images which now hard-code "console=ttynull" via CONFIG_CMDLINE, which essentially means /dev/console always exists, even though this console points nowhere. It also causes problems on devices where the androidboot.console was not the same as the kernel dmesg console ("console="), such as cuttlefish, because those platforms could not simultaneously enable kernel logging but disable the interactive serial console feature. The framework just assumed both would be muxed on the same serial port. Cuttlefish had a workaround, to use "androidboot.console=invalid" to avoid the fallback, but this doesn't work on devices which still want to mux the kernel logs and interactive serial console. This change resolves the issue in a better way, by introducing a new boolean property called "androidboot.serialconsole". Setting this to "0" will disable the console services, regardless of whether the /dev/console or /dev/${ro.boot.console} devices exist. Older kernels and bootloaders don't need to set this and can rely on the old behavior in init, but bootloaders booting newer kernels must set it to avoid the "performance is impacted" message due to console services being started. Bug: 266982931 Bug: 223797063 Bug: 267428635 Test: "launch_cvd" with "androidboot.console=invalid" removed; See the "performance is impacted" message. Test: "launch_cvd" with "androidboot.serialconsole=0"; The "performance is impacted" message is gone. Change-Id: Iaad4d27ffe4df74ed49606d3cabe83483c350df4
Loading
Please register or sign in to comment