1
0
forked from pool/util-linux
Dr. Werner Fink 2014-05-07 14:13:18 +00:00 committed by Git OBS Bridge
parent 485304a4e8
commit d478c097f8
3 changed files with 82 additions and 4 deletions

View File

@ -0,0 +1,76 @@
---
login-utils/sulogin.c | 11 ++++++-----
term-utils/agetty.c | 17 +++++++++--------
2 files changed, 15 insertions(+), 13 deletions(-)
--- login-utils/sulogin.c
+++ login-utils/sulogin.c 2014-05-07 14:06:56.198236254 +0000
@@ -142,8 +142,11 @@ static void tcinit(struct console *con)
return;
}
- /* Handle serial lines here */
- if (ioctl(fd, TIOCMGET, (char *) &mode) == 0) {
+ /* Handle lines other than virtual consoles here */
+#if defined(KDGKBMODE)
+ if (ioctl(fd, KDGKBMODE, &mode) < 0)
+#endif
+ {
speed_t ispeed, ospeed;
struct winsize ws;
@@ -191,9 +194,7 @@ static void tcinit(struct console *con)
goto setattr;
}
#if defined(IUTF8) && defined(KDGKBMODE)
- /* Detect mode of current keyboard setup, e.g. for UTF-8 */
- if (ioctl(fd, KDGKBMODE, &mode) < 0)
- mode = K_RAW;
+ /* Handle mode of current keyboard setup, e.g. for UTF-8 */
switch(mode) {
case K_UNICODE:
setlocale(LC_CTYPE, "C.UTF-8");
--- term-utils/agetty.c
+++ term-utils/agetty.c 2014-05-07 14:02:49.798735674 +0000
@@ -139,6 +139,7 @@ struct options {
int nice; /* Run login with this priority */
int numspeed; /* number of baud rates to try */
int clocal; /* CLOCAL_MODE_* */
+ int kbmode; /* Keyboard mode if virtual console */
speed_t speeds[MAX_SPEED]; /* baud rates to be tried */
};
@@ -1080,15 +1081,18 @@ static void open_tty(char *tty, struct t
#endif
/*
* Detect if this is a virtual console or serial/modem line.
- * In case of a virtual console the ioctl TIOCMGET fails and
- * the error number will be set to EINVAL.
+ * In case of a virtual console the ioctl KDGKBMODE succeeds
+ * whereas on other lines it will fails.
*/
- if (ioctl(STDIN_FILENO, TIOCMGET, &serial) < 0 && (errno == EINVAL)) {
+ if (ioctl(STDIN_FILENO, KDGKBMODE, &op->kbmode) == 0) {
op->flags |= F_VCONSOLE;
if (!op->term)
op->term = DEFAULT_VCTERM;
- } else if (!op->term)
- op->term = DEFAULT_STERM;
+ } else {
+ op->kbmode = K_RAW;
+ if (!op->term)
+ op->term = DEFAULT_STERM;
+ }
setenv("TERM", op->term, 1);
}
@@ -1124,9 +1128,6 @@ static void termio_init(struct options *
#if defined(IUTF8) && defined(KDGKBMODE)
int mode;
- /* Detect mode of current keyboard setup, e.g. for UTF-8 */
- if (ioctl(STDIN_FILENO, KDGKBMODE, &mode) < 0)
- mode = K_RAW;
switch(mode) {
case K_UNICODE:
setlocale(LC_CTYPE, "C.UTF-8");

View File

@ -1,9 +1,8 @@
-------------------------------------------------------------------
Wed May 7 13:34:19 UTC 2014 - werner@suse.de
Wed May 7 14:12:32 UTC 2014 - werner@suse.de
- Readd patch tty3270-on-serial-line-of-s390.patch
as it includes a required part for s390 which has *not*
added upstream.
- Add patch support-other-tty-lines-not-vconsole.patch
to be able to support console lines like xvc and hvc
-------------------------------------------------------------------
Thu Apr 24 11:33:36 UTC 2014 - sweet_f_a@gmx.de

View File

@ -104,6 +104,8 @@ Patch2: util-linux-2.23.1-eject-fpie.patch
Patch4: make-sure-sbin-resp-usr-sbin-are-in-PATH.diff
# disable encryption
Patch12: util-linux-2.23.1-noenc-suse.diff
# PATCH-FIX-SUSE Be aware that there are e.g. xvc/hvc
Patch14: support-other-tty-lines-not-vconsole.patch
# PATCH-FIX-SUSE -- Let agetty not be fooled by locked termios srtucture
Patch15: agetty-fooled-on-serial-line-due-plymouth.patch
# PATCH-FIX-SUSE -- Let agetty detect /dev/3270/tty1 as device not as baud rate
@ -247,6 +249,7 @@ xzcat %{S:0} | %gpg_verify %{S:12} -
%patch2 -p1
%patch4 -p1
%patch12 -p1
%patch14 -p0
%patch15 -p0
%patch16 -p0
%patch17 -p0