Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
jayfurmanek opened this issue Jan 22, 2015 · 13 comments
Closed
Assignees
Labels
bug The code does not do what it is meant to do waiting for info
Milestone

Comments

@jayfurmanek
Copy link
Contributor

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
Copy link
Member

schlomo commented Jan 22, 2015

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
Copy link
Contributor Author

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 gdha added the bug The code does not do what it is meant to do label Jan 23, 2015
@gdha gdha added this to the Rear v1.17 milestone Jan 23, 2015
@gdha gdha self-assigned this Jan 23, 2015
@gdha
Copy link
Member

gdha commented Jan 23, 2015

@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
Copy link
Contributor Author

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
Copy link
Member

gdha commented Feb 6, 2015

@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
Copy link
Contributor Author

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

@jayfurmanek
Copy link
Contributor Author

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

@jayfurmanek
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Member

gdha commented Feb 13, 2015

@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
Copy link
Contributor Author

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
Copy link
Member

gdha commented Feb 23, 2015

added to the release notes so we can close this issue

@gdha gdha closed this as completed Feb 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The code does not do what it is meant to do waiting for info
Projects
None yet
Development

No branches or pull requests

3 participants