#537 Issue closed: ppc64: getty not started on /dev/hvsi0 or /dev/hvc0 in rescue image

Labels: bug, waiting for info

jayfurmanek opened issue at 2015-01-22 18:22:

On IBM ppc64 systems, the console is on /dev/hvsi0 when using the serial port. When using a virtual TTY (through a Hardware Management Console or something), the console is on /dev/hvc0. We would need an addition in the ppc64 skel tree to make sure init starts a getty is the correct places for these systems.
SSH with a key does work as a workaround.

schlomo commented at 2015-01-22 20:06:

No problem, please submit a pull request. Since PPC64 hardware is rather seldom we need contributions from users because only you can know what actually works.

jayfurmanek commented at 2015-01-22 22:34:

I've got something working, but it might not be the best solution. I'm working with RHEL6. There is no /etc/init directory in the ppc64 skel tree. I created it, then put a hvc0.conf and hvsi.conf in there with respawn agetty commands. This solution doesnt use USE_SERIAL_CONSOLE, but seems to work.

gdha commented at 2015-01-23 07:30:

@jayfurmanek What is the content of /etc/init on your production system? I know that debian also have an /etc/init directory.
Is there no need to redefine the cmdline (see ./rescue/GNU/Linux/40_use_serial_console.sh)?

jayfurmanek commented at 2015-01-23 08:21:

My system is running RHEL6, and the /etc/init directory looks pretty much the same as it does on an x86-64 system:

# ls /etc/init
control-alt-delete.conf  rcS-sulogin.conf
init-system-dbus.conf    readahead-collector.conf
kexec-disable.conf       readahead.conf
plymouth-shutdown.conf   readahead-disable-services.conf
prefdm.conf              serial.conf
quit-plymouth.conf       splash-manager.conf
rc.conf                  start-ttys.conf
rcS.conf                 tty.conf
rcS-emergency.conf

The cmdline does include the console entry (this one is using a serial cable console)

# cat  /proc/cmdline 
root=/dev/mapper/vg0-lv_root ro rd_NO_LUKS rd_LVM_LV=vg0/lv_root LANG=en_US.UTF-8 crashkernel=1024M@0M console=hvsi0 rd_NO_MD  KEYTABLE=us rd_LVM_LV=vg0/lv_swap SYSFONT=latarcyrheb-sun16 console=hvsi0 rd_NO_DM rhgb quiet

I probably do want to make sure the console= parameter is correct and to leverage the USE_SERIAL_CONSOLE param..just have to figure it out.

gdha commented at 2015-02-06 08:27:

@jayfurmanek I guess you have /dev/hvsi0 available? Could you check if /dev/ttyS* exist?
Otherwise, we could just update script rescue/GNU/Linux/40_use_serial_console.sh with;

for devnode in $(ls /dev/ttyS[0-9]* /dev/hvsi[0-9]*| sort); do

Would you able to test this out for me?

jayfurmanek commented at 2015-02-06 16:28:

Sure. Thanks. I'll give it a shot.

jayfurmanek commented at 2015-02-06 16:34:

BTW - there /dev/ttyS* files do exist. The system doesn't use them for the console, though.

jayfurmanek commented at 2015-02-06 17:50:

So your addition does indeed produce the console parameter on the kernel comand line, which is good:

# cat /proc/cmdline 
 root=/dev/ram0 LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 KEYTABLE=us selinux=0 console=hvc0,38400 console=tty0

(The above test is on a virtual "LPAR", so the console is hvc0 there) The agetty still needs to be started, to get the login prompt, however.

If I SSH in to the rescue OS and run:

RESCUE chefserver:~ # /sbin/agetty /dev/hvc0 38400 vt100-nav

The login prompt pops up on the console.

jayfurmanek commented at 2015-02-06 19:57:

Thanks for pointing me in the right direction, I think I got it figured out now.
I added the following to usr/share/rear/skel/default/etc/init/start-ttys.conf:

    # support HVC console on Power
    if [ -c /dev/hvc0 ] ; then
            echo initctl start tty TTY=/dev/hvc0
            initctl start tty TTY=/dev/hvc0
    fi
    # support serial console on Power
    if [ -c /dev/hvsi0 ] ; then
            echo initctl start tty TTY=/dev/hvsi0
            initctl start tty TTY=/dev/hvsi0
    fi

That kicks up the gettys on the hvc0 console. I still need to test the serial console (hvsi0), but I'm confident that it will work there too.
I also need to test to see if your proposed change above is necessary or not..

jayfurmanek commented at 2015-02-06 20:30:

The change you proposed to rescue/GNU/Linux/40_use_serial_console.sh ended up not making much of a difference. Below in that same file, console=tty0 is tacked on to the cmdline and the kernel takes the last console= parameter first. So when USE_SERIAL_CONSOLE is set to yes, you loose some of the boot time messages (as they are directed to /dev/tty0)
Once the getty starts, though, the login does pop up properly with my change, above.

It's probably best just to have USE_SERIAL_CONSOLE set to NO for this platform.

gdha commented at 2015-02-13 13:52:

@jayfurmanek could you tell me how the /etc/init/start-ttys.conf gets kick off in recovery mode? It is not clear to me as don't find any reference to it within rear.

jayfurmanek commented at 2015-02-13 14:16:

Upstart executes those config files.

# initctl list
rc stop/waiting
tty (/dev/tty3) start/running, process 2041
tty (/dev/tty2) start/running, process 2039
tty (/dev/tty1) start/running, process 2037
tty (/dev/tty6) start/running, process 2049
tty (/dev/tty5) start/running, process 2046
tty (/dev/tty4) start/running, process 2043
plymouth-shutdown stop/waiting
control-alt-delete stop/waiting
srcmstr start/running, process 811
rcS-emergency stop/waiting
readahead-collector stop/waiting
kexec-disable stop/waiting
quit-plymouth stop/waiting
rcS stop/waiting
prefdm stop/waiting
init-system-dbus stop/waiting
readahead stop/waiting
splash-manager stop/waiting
start-ttys stop/waiting              <---
readahead-disable-services stop/waiting
rcS-sulogin stop/waiting
serial (hvc0) start/running, process 2048

gdha commented at 2015-02-23 13:49:

added to the release notes so we can close this issue


[Export of Github issue for rear/rear.]