diff options
author | Werner Fink | 2013-11-29 16:44:25 +0100 |
---|---|---|
committer | Karel Zak | 2013-12-02 11:07:32 +0100 |
commit | fba8a535423e80da46e1823b28cd5a400d57d96f (patch) | |
tree | 1b2a5fcf9b1de72f6b3ce0f904438e9da0a3820e /term-utils/agetty.c | |
parent | mount man page cleanups (diff) | |
download | kernel-qcow2-util-linux-fba8a535423e80da46e1823b28cd5a400d57d96f.tar.gz kernel-qcow2-util-linux-fba8a535423e80da46e1823b28cd5a400d57d96f.tar.xz kernel-qcow2-util-linux-fba8a535423e80da46e1823b28cd5a400d57d96f.zip |
agetty: support the special terminal on first serial line on a S/390
which is due legacy reasons a block terminal of type 3270 or higher.
Whereas the second serial line on a S/390(x) is a real character
terminal which is compatible with VT220.
Signed-off-by: Werner Fink <werner@suse.de>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r-- | term-utils/agetty.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c index b162e9f75..baa1b38cb 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -49,6 +49,10 @@ # ifndef DEFAULT_VCTERM # define DEFAULT_VCTERM "linux" # endif +# if defined (__s390__) || defined (__s390x__) +# define DEFAULT_TTYS0 "ibm327x" +# define DEFAULT_TTYS1 "vt220" +# endif # ifndef DEFAULT_STERM # define DEFAULT_STERM "vt102" # endif @@ -1051,6 +1055,20 @@ static void open_tty(char *tty, struct termios *tp, struct options *op) if (tcgetattr(STDIN_FILENO, tp) < 0) log_err(_("%s: failed to get terminal attributes: %m"), tty); +#if defined (__s390__) || defined (__s390x__) + if (!op->term) { + /* + * Special terminal on first serial line on a S/390(x) which + * is due legacy reasons a block terminal of type 3270 or + * higher. Whereas the second serial line on a S/390(x) is + * a real character terminal which is compatible with VT220. + */ + if (strcmp(op->tty, "ttyS0") == 0) + op->term = DEFAULT_TTYS0; + else if (strcmp(op->tty, "ttyS1") == 0) + op->term = DEFAULT_TTYS1; + } +#endif /* * Detect if this is a virtual console or serial/modem line. * In case of a virtual console the ioctl TIOCMGET fails and |