1
0
forked from pool/util-linux
Dr. Werner Fink 2014-02-06 10:05:12 +00:00 committed by Git OBS Bridge
parent 447cc5648c
commit e66e0cdc2e
4 changed files with 51 additions and 5 deletions

View File

@ -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"));

View File

@ -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;

View File

@ -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

View File

@ -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
#