public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Werner Fink <werner@suse.de>
To: util-linux@vger.kernel.org
Cc: werner@suse.de
Subject: [PATCH] Support the special terminal on first serial line on a S/390
Date: Fri, 29 Nov 2013 16:44:25 +0100	[thread overview]
Message-ID: <1385739865-24696-1-git-send-email-werner@suse.de> (raw)

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>
---
 term-utils/agetty.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git term-utils/agetty.c term-utils/agetty.c
index 113f8e7..c881f3d 100644
--- term-utils/agetty.c
+++ 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
@@ -1052,6 +1056,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
-- 
1.7.9.2


             reply	other threads:[~2013-11-29 15:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-29 15:44 Werner Fink [this message]
2013-12-02 10:19 ` [PATCH] Support the special terminal on first serial line on a S/390 Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1385739865-24696-1-git-send-email-werner@suse.de \
    --to=werner@suse.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox