From 888bc4fd00b434c76e3c18d6d2271dc234afd552be6cb5c141608f6836b9b3a5 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Wed, 7 May 2014 09:24:23 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=618 --- ...s390_con3270_disable_ANSI_colour_esc.patch | 42 ++++++++++++++++--- systemd-mini.changes | 7 ++++ systemd.changes | 7 ++++ 3 files changed, 51 insertions(+), 5 deletions(-) diff --git a/0001-On_s390_con3270_disable_ANSI_colour_esc.patch b/0001-On_s390_con3270_disable_ANSI_colour_esc.patch index 87a67090..f09e8270 100644 --- a/0001-On_s390_con3270_disable_ANSI_colour_esc.patch +++ b/0001-On_s390_con3270_disable_ANSI_colour_esc.patch @@ -1,9 +1,10 @@ --- - rules/99-systemd.rules.in | 2 - - src/core/manager.c | 24 +++++++++++--- - src/shared/util.c | 77 ++++++++++++++++++++++++++++++++++++++++++++-- + rules/99-systemd.rules.in | 2 + src/core/manager.c | 24 ++++++++-- + src/shared/util.c | 101 ++++++++++++++++++++++++++++++++++++++++++++-- src/shared/util.h | 1 - 4 files changed, 95 insertions(+), 9 deletions(-) + 4 files changed, 118 insertions(+), 10 deletions(-) + --- systemd-208/rules/99-systemd.rules.in +++ systemd-208/rules/99-systemd.rules.in 2014-02-05 10:34:17.346235540 +0000 @@ -151,13 +152,14 @@ prev_ephemeral = ephemeral; if (status) { -@@ -3169,12 +3209,43 @@ void columns_lines_cache_reset(int signu +@@ -3169,12 +3209,47 @@ void columns_lines_cache_reset(int signu bool on_tty(void) { static int cached_on_tty = -1; - if (_unlikely_(cached_on_tty < 0)) + if (_unlikely_(cached_on_tty < 0)) { cached_on_tty = isatty(STDOUT_FILENO) > 0; ++#if defined (__s390__) || defined (__s390x__) + if (cached_on_tty) { + const char *e = getenv("TERM"); + if (!e) @@ -169,6 +171,7 @@ + cached_on_tty = 0; + } + } ++#endif + } return cached_on_tty; @@ -179,6 +182,7 @@ + + if (_unlikely_(cached_ansi_console < 0)) { + cached_ansi_console = isatty(fd) > 0; ++#if defined (__s390__) || defined (__s390x__) + if (cached_ansi_console) { + const char *e = getenv("TERM"); + if (e && (streq(e, "dumb") || strneq(e, "ibm3", 4))) { @@ -188,6 +192,7 @@ + cached_ansi_console = 0; + } + } ++#endif + } + + return cached_ansi_console; @@ -196,6 +201,33 @@ int running_in_chroot(void) { struct stat a = {}, b = {}; +@@ -3630,7 +3705,25 @@ bool tty_is_vc_resolve(const char *tty) + const char *default_term_for_tty(const char *tty) { + assert(tty); + +- return tty_is_vc_resolve(tty) ? "TERM=linux" : "TERM=vt102"; ++ if (tty_is_vc_resolve(tty)) ++ return "TERM=linux"; ++ ++ if (startswith(tty, "/dev/")) ++ tty += 5; ++ ++#if defined (__s390__) || defined (__s390x__) ++ if (streq(tty, "ttyS0")) { ++ char *mode = NULL; ++ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL); ++ if (r < 0 || !mode || !streq(mode, "3270")) ++ return "TERM=dumb"; ++ if (streq(mode, "3270")) ++ return "TERM=ibm327x"; ++ } ++ if (streq(tty, "ttyS1")) ++ return "TERM=vt220"; ++#endif ++ return "TERM=vt102"; + } + + bool dirent_is_file(const struct dirent *de) { --- systemd-210/src/shared/util.h +++ systemd-210/src/shared/util.h 2014-04-30 10:24:51.134235665 +0000 @@ -418,6 +418,7 @@ unsigned lines(void); diff --git a/systemd-mini.changes b/systemd-mini.changes index 8bd691bd..6fdd00e0 100644 --- a/systemd-mini.changes +++ b/systemd-mini.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed May 7 09:23:01 UTC 2014 - werner@suse.de + +- Modify and extend patch + 0001-On_s390_con3270_disable_ANSI_colour_esc.patch + to have the correct terminal type used with agetty + ------------------------------------------------------------------- Mon May 5 14:02:16 UTC 2014 - werner@suse.de diff --git a/systemd.changes b/systemd.changes index 8bd691bd..6fdd00e0 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed May 7 09:23:01 UTC 2014 - werner@suse.de + +- Modify and extend patch + 0001-On_s390_con3270_disable_ANSI_colour_esc.patch + to have the correct terminal type used with agetty + ------------------------------------------------------------------- Mon May 5 14:02:16 UTC 2014 - werner@suse.de