From e66e0cdc2ea59f78b9721fd83b86d838f2c4c9d2702b002a7732bf15829a5165 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 6 Feb 2014 10:05:12 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/util-linux?expand=0&rev=219 --- ...y-fooled-on-serial-line-due-plymouth.patch | 12 ++++--- sulogin-fooled-on-tty-line-due-plymouth.patch | 33 +++++++++++++++++++ util-linux.changes | 8 +++++ util-linux.spec | 3 ++ 4 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 sulogin-fooled-on-tty-line-due-plymouth.patch diff --git a/agetty-fooled-on-serial-line-due-plymouth.patch b/agetty-fooled-on-serial-line-due-plymouth.patch index dffe781..2d69aa0 100644 --- a/agetty-fooled-on-serial-line-due-plymouth.patch +++ b/agetty-fooled-on-serial-line-due-plymouth.patch @@ -41,10 +41,11 @@ console as the flags are locked. if (close_stream(dbf) != 0) log_err("write failed: %s", DEBUG_OUTPUT); #endif -@@ -1090,6 +1094,23 @@ static void termio_init(struct options * +@@ -1090,6 +1094,25 @@ static void termio_init(struct options * { speed_t ispeed, ospeed; struct winsize ws; ++ struct termios lock; + int i; + + for (i = 0; i < 20; i++) { @@ -53,7 +54,6 @@ console as the flags are locked. + * the termios flags become changed from under the first + * agetty on a serial system console as the flags are locked. + */ -+ struct termios lock; + memset(&lock, 0, sizeof(struct termios)); + if (ioctl(STDIN_FILENO, TIOCGLCKTRMIOS, &lock) < 0) + break; @@ -62,10 +62,12 @@ console as the flags are locked. + debug("termios locked\n"); + sleep(1); + } ++ memset(&lock, 0, sizeof(struct termios)); ++ ioctl(STDIN_FILENO, TIOCSLCKTRMIOS, &lock); if (op->flags & F_VCONSOLE) { #if defined(IUTF8) && defined(KDGKBMODE) -@@ -1154,9 +1175,6 @@ static void termio_init(struct options * +@@ -1154,9 +1177,6 @@ static void termio_init(struct options * * later on. */ @@ -75,7 +77,7 @@ console as the flags are locked. #ifdef IUTF8 tp->c_iflag = tp->c_iflag & IUTF8; if (tp->c_iflag & IUTF8) -@@ -1216,8 +1234,11 @@ static void termio_init(struct options * +@@ -1216,8 +1236,11 @@ static void termio_init(struct options * if (op->flags & F_RTSCTS) tp->c_cflag |= CRTSCTS; #endif @@ -88,7 +90,7 @@ console as the flags are locked. /* Go to blocking input even in local mode. */ fcntl(STDIN_FILENO, F_SETFL, -@@ -1238,6 +1259,10 @@ static void reset_vc(const struct option +@@ -1238,6 +1261,10 @@ static void reset_vc(const struct option if (tcsetattr(STDIN_FILENO, TCSADRAIN, tp)) log_warn(_("setting terminal attributes failed: %m")); diff --git a/sulogin-fooled-on-tty-line-due-plymouth.patch b/sulogin-fooled-on-tty-line-due-plymouth.patch new file mode 100644 index 0000000..45c111d --- /dev/null +++ b/sulogin-fooled-on-tty-line-due-plymouth.patch @@ -0,0 +1,33 @@ +Make sure that plymouth does not break sulogin. + +--- + sulogin.c | 18 +++++++++++++++++- + 1 file changed, 17 insertions(+), 1 deletion(-) + +--- login-utils/sulogin.c ++++ login-utils/sulogin.c 2014-02-06 09:39:57.726236116 +0000 +@@ -83,7 +83,23 @@ static void tcinit(struct console *con) + { + int mode = 0, flags = 0; + struct termios *tio = &con->tio; +- int fd = con->fd; ++ struct termios lock; ++ int i, fd = con->fd; ++ ++ for (i = 0; i < 5; i++) { ++ /* ++ * With plymouth the termios flags become changed after this ++ * function had changed the termios. ++ */ ++ memset(&lock, 0, sizeof(struct termios)); ++ if (ioctl(fd, TIOCGLCKTRMIOS, &lock) < 0) ++ break; ++ if (!lock.c_iflag && !lock.c_oflag && !lock.c_cflag && !lock.c_lflag) ++ break; ++ sleep(1); ++ } ++ memset(&lock, 0, sizeof(struct termios)); ++ ioctl(fd, TIOCSLCKTRMIOS, &lock); + + errno = 0; + diff --git a/util-linux.changes b/util-linux.changes index 8517585..d58a4ee 100644 --- a/util-linux.changes +++ b/util-linux.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Thu Feb 6 10:03:30 UTC 2014 - werner@suse.de + +- Avoid that hanging plymouth locks terminal lines that is + add patch sulogin-fooled-on-tty-line-due-plymouth.patch and + modify patch agetty-fooled-on-serial-line-due-plymouth.patch + to remove any lock which had been left over. + ------------------------------------------------------------------- Tue Feb 4 10:24:02 UTC 2014 - werner@suse.de diff --git a/util-linux.spec b/util-linux.spec index 07fef46..35968f0 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -112,6 +112,8 @@ Patch14: tty3270-on-serial-line-of-s390.patch Patch15: agetty-fooled-on-serial-line-due-plymouth.patch # PATCH-FIX-SUSE -- Let agetty detect /dev/3270/tty1 as device not as baud rate Patch16: agetty-on-s390-on-dev-3270-tty1-line.patch +# PATCH-FIX-SUSE -- Make sure that plymouth does not break sulogin +Patch17: sulogin-fooled-on-tty-line-due-plymouth.patch # hack for boot.localfs Patch20: util-linux-HACK-boot.localfs.diff @@ -232,6 +234,7 @@ xzcat %{S:0} | %gpg_verify %{S:12} - %patch14 -p0 %patch15 -p0 %patch16 -p0 +%patch17 -p0 # %patch20 -p1 #