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

init: add support for s390x installation on LPAR #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tuan-hoang1
Copy link
Contributor

In QEMU/KVM, ttysclp0 (ttyS1) is automatically detected and used by
default.
In z/VM, ttyS0 is still used instead of ttysclp0/sclp_line0, however.
In LPAR, ttyS0 is mapped to sclp_line0 as expected.

This patch detects if we are running in LPAR mode and change ttyS0 to
sclp_line0 accordingly. /proc/sysinfo is s390x specific.

@tuan-hoang1
Copy link
Contributor Author

I understand introducing more arch-specific stuffs are not very friendly but I don't have much options. Any comment is welcomed !

@tuan-hoang1
Copy link
Contributor Author

This seems to be a wrong way to do it. Working on it.

@tuan-hoang1
Copy link
Contributor Author

This commit is ready. cc @ncopa

@tuan-hoang1
Copy link
Contributor Author

Still small aesthetic hiccup. Will update again in next commit in next few hours.

@tuan-hoang1
Copy link
Contributor Author

Run and tested perfectly on KVM, z/VM and LPAR installations. Ready to go.

@tuan-hoang1
Copy link
Contributor Author

tuan-hoang1 commented Jun 18, 2019

To explain the logic:

[ "$1" = "ttyS0" ] && [ -e /sys/class/tty/sclp_line0 ] && return

I have observed that ttyS0 is available in /sys/class/tty/console/active even though /sys/class/tty/ttyS0 directory is not present on LPAR installation. On LPAR installation, sclp_line0 (the device name for ttyS0 console) is available instead, thus this if block. Putting console=ttyS0 or console=sclp_line0 won't work. Without this block, stdout/stderr is spammed with messages of ttyS0 not found.

	for _tty in hvc0 xvc0 hvsi0 sclp_line0 ttysclp0 "3270!tty1"; do
		[ -e /sys/class/tty/$_tty ] && echo $_tty
	done

On s390x, if a tty is available, the directory /sys/class/tty/$tty_name exists, which is enough.

These 2 blocks wouldn't affect any other architectures I believe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant