Bug 9440

Summary: SERIAL_CONSOLES_CHECK doesn't work if kernel console name and device node name differ
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Sascha Silbe <silbe>
Component: coreAssignee: California Sullivan <california.l.sullivan>
Status: RESOLVED FIXED QA Contact: Francisco Pedraza <francisco.j.pedraza.gonzalez>
Severity: normal    
Priority: Medium+ CC: jose.perez.carranza, meta.mr.watcher, meta.watcher, sgw
Version: 2.3   
Target Milestone: 2.2 M3   
Hardware: Other   
OS: other   
See Also: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9529
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: Don't know

Description Sascha Silbe 2016-04-12 12:45:43 UTC
On some systems, the name of the kernel console (as used for console= on the kernel command line and seen in /proc/consoles) and the name of the corresponding user-space device node can differ. E.g. on s390x (z/Architecture, "mainframes") the kernel consoles are named "ttyS0" and "ttyS1" (probably for historic reasons) but the device nodes are named "sclp_line0" and "ttysclp0".

The postinst script installed by meta/recipes-core/sysvinit/sysvinit-inittab_2.88dsf.bb checks the device node name of each TTY listed in SERIAL_CONSOLES_CHECK against /proc/consoles. For the above reason, that fails on s390x and the consoles will be disabled even if they are actually present, working and even in use by the kernel.

Since the purpose of SERIAL_CONSOLES_CHECK is to avoid starting gettys for on device nodes that do not exist, the easiest fix is to check for existence of the device node rather than grepping through /proc/consoles.
Comment 1 California Sullivan 2016-08-10 23:09:13 UTC
Just checking the device node isn't quite right, as it showing up in dev doesn't guarantee its a working serial console. E.g., with the default configuration used in meta-intel, device nodes are created for ttyS0-ttyS3, but on a MinnowBoard Max or Turbot only ttyS0 will be a real working serial port.

Instead, I opted to update the SERIAL_CONSOLES_CHECK variable to allow aliasing.

Patch: http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=da72327ab03cbbb72ce999a167e7e3b4b4aa736a

Documentation patch: http://git.yoctoproject.org/cgit/cgit.cgi/yocto-docs/commit/?id=020f927bc01d662601fb44b19e4c6bc70e5e5ee7