1.       The autocons.py script checks /proc/cmdline for console=ttyS, and then 
does nothing if a serial console has been directly specified. It should 
similarly do nothing if no SPCR table is available to detect the serial port 
and speed, or if the table is available or says unavailable.

2.       DCD is ‘data carrier detect’.  I suspect on most, but at least I can 
confirm on Lenovo servers that the BMC asserts/deasserts DCD signal on the UART 
if a user connects/disconnects to the remote serial.   I was originally going 
to just put it out there, but when I saw I could make the screen redraw on 
connection loss/re-establish, thought I’d see if that would pan out.

In an ideal world, we could instruct the kernel to do this.  I have had a 
discussion with the kernel developer that added just that, but only for 
earlyprintk.  He was thinking such an option may be nice, but impractical by 
default (since SPCR is frequently there even if a user doesn’t know what a 
serial port is).  So currently we can do our best with userspace to at least 
reduce assumptions that things ‘hang’, but not get panic/sysrq without console=
From: Song BJ Yang <yang...@cn.ibm.com>
Sent: Tuesday, March 19, 2019 5:25 AM
To: xcat-user@lists.sourceforge.net
Cc: xcat-user@lists.sourceforge.net
Subject: [External] Re: [xcat-user] Automatic console support

interesting feature. I would like to take a look at your scripts.

several questions:

1. is this automatic console behavior only availabe when `console=` not 
specified in the kernel options?

2. what is "DCD"?

------------------------------------------------------------------------------
YANG Song (杨嵩)
IBM China System Technology Laboratory
Tel: 86-10-82452903
Email: yang...@cn.ibm.com<mailto:yang...@cn.ibm.com>
Address: Building 28, ZhongGuanCun Software Park,
No.8, Dong Bei Wang West Road, Haidian District Beijing 100193, PRC

北京市海淀区东北旺西路8号中关村软件园28号楼
邮编: 100193


----- Original message -----
From: Jarrod Johnson <jjohns...@lenovo.com<mailto:jjohns...@lenovo.com>>
To: "xCAT Users Mailing list 
(xcat-user@lists.sourceforge.net<mailto:xcat-user@lists.sourceforge.net>)" 
<xcat-user@lists.sourceforge.net<mailto:xcat-user@lists.sourceforge.net>>
Cc:
Subject: [xcat-user] Automatic console support
Date: Tue, Mar 19, 2019 3:37 AM


One major contributor to new-user confusion has been the oddity of the console 
behavior.  Generally I see:

-When I run rcons, I don’t see anything (because it’s on the video port only)

-When I attach a video cable, I don’t see anything (because it’s on the rcons 
session).



To mitigate this, I’ve started doing some automatic console behavior changes.  
Starting with Lenovo’s next release of genesis the first step is being made.  
If genesis boots without console=ttyS, it will then try to automatically put 
‘a’ console on the appropriate serial port and speed.  For the typical install, 
this means the discovery boot will have rcons output where it formerly did not. 
 As always, genesis still makes sure that the video console also has access.  
Limitations of this will be that the rcons at best still won’t show kernel 
panic output and won’t take sysrq input, console=ttyS will remain required.



I didn’t want to open a pull request since, for example, it uses python and I 
think the upstream genesis doesn’t have python yet.  It works by using ACPI to 
see what, if any, serial console should be used and at what speed.  It then 
does the appropriate calls to set the baud rate.  From that point forward, it 
uses DCD to determine whether the console is in use, producing the rather 
useful behavior of redrawing the screen on ‘ipmitool sol activate’ or similar.





If there is interest, here are the two files in our xCAT tree that do this:

https://github.com/xcat2/xcat-core/blob/lenovobuild2.14/xCAT-genesis-scripts/usr/lib/dracut/hooks/cmdline/09-autoconsole.sh

https://github.com/xcat2/xcat-core/blob/lenovobuild2.14/xCAT-genesis-scripts/usr/bin/autocons.py



I do plan for OS deployment to try for similar ‘best effort’, depending on what 
I can do in the respective OS, ensuring that if possible the OS install is 
available through both consoles or at least some explanatory message in the 
‘not console’ access channel.



console=ttyS is still the desired result, but at least things may be less 
confusing getting started for some.
_______________________________________________
xCAT-user mailing list
xCAT-user@lists.sourceforge.net<mailto:xCAT-user@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/xcat-user


_______________________________________________
xCAT-user mailing list
xCAT-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xcat-user

Reply via email to