diff --git a/0001-On_s390_con3270_disable_ANSI_colour_esc.patch b/0001-On_s390_con3270_disable_ANSI_colour_esc.patch index e225f29f..2139384f 100644 --- a/0001-On_s390_con3270_disable_ANSI_colour_esc.patch +++ b/0001-On_s390_con3270_disable_ANSI_colour_esc.patch @@ -1,5 +1,10 @@ +--- + getty-generator/getty-generator.c | 31 ++++++++++++++++++- + shared/util.c | 62 ++++++++++++++++++++++++++++++++++++-- + 2 files changed, 89 insertions(+), 4 deletions(-) + --- systemd-208/src/shared/util.c -+++ systemd-208/src/shared/util.c 2014-01-30 12:23:20.094236656 +0000 ++++ systemd-208/src/shared/util.c 2014-01-31 11:54:07.222235280 +0000 @@ -2967,6 +2967,7 @@ int status_vprintf(const char *status, b struct iovec iovec[6] = {}; int n = 0; @@ -8,7 +13,7 @@ assert(format); -@@ -2980,6 +2981,47 @@ int status_vprintf(const char *status, b +@@ -2980,6 +2981,51 @@ int status_vprintf(const char *status, b if (fd < 0) return fd; @@ -16,8 +21,12 @@ + cached_on_tty = isatty(fd) > 0; + if (cached_on_tty) { + const char *e = getenv("TERM"); -+ if (e && (strcmp(e, "dumb") == 0 || strcmp(e, "ibm327x") == 0)) -+ cached_on_tty = 0; ++ if (e && (strcmp(e, "dumb") == 0 || strcmp(e, "ibm327x") == 0)) { ++ char *mode = NULL; ++ int r = parse_env_file("/proc/cmdline", WHITESPACE, "conmode", &mode, NULL); ++ if (r < 0 || !mode || !streq(mode, "3270")) ++ cached_on_tty = 0; ++ } + } + } + @@ -56,7 +65,7 @@ if (ellipse) { char *e; size_t emax, sl; -@@ -3002,8 +3044,12 @@ int status_vprintf(const char *status, b +@@ -3002,8 +3048,12 @@ int status_vprintf(const char *status, b } } @@ -71,7 +80,7 @@ prev_ephemeral = ephemeral; if (status) { -@@ -3267,8 +3313,14 @@ void columns_lines_cache_reset(int signu +@@ -3267,8 +3317,14 @@ void columns_lines_cache_reset(int signu bool on_tty(void) { static int cached_on_tty = -1; @@ -80,10 +89,57 @@ cached_on_tty = isatty(STDOUT_FILENO) > 0; + if (cached_on_tty) { + const char *e = getenv("TERM"); -+ if (e && (strcmp(e, "dumb") == 0 || strcmp(e, "ibm327x") == 0)) ++ if (e && (strcmp(e, "dumb") == 0)) + cached_on_tty = 0; + } + } return cached_on_tty; } +--- systemd-208/src/getty-generator/getty-generator.c ++++ systemd-208/src/getty-generator/getty-generator.c 2014-01-31 13:28:44.802235532 +0000 +@@ -144,14 +144,43 @@ int main(int argc, char *argv[]) { + continue; + } + ++ if (strncmp(tty, "3270/tty", 8) == 0) { ++ int index; ++ ++ k = safe_atoi(tty+8, &index); ++ free(tty); ++ ++ if (k < 0) ++ continue; ++ ++ index++; ++ if (asprintf(&tty, "3270/tty%d", index) < 0) { ++ log_oom(); ++ free(active); ++ r = EXIT_FAILURE; ++ goto finish; ++ } ++ ++ k = add_serial_getty(tty); ++ free(tty); ++ ++ if (k < 0) { ++ free(active); ++ r = EXIT_FAILURE; ++ goto finish; ++ } ++ ++ continue; ++ } ++ + /* We assume that gettys on virtual terminals are + * started via manual configuration and do this magic + * only for non-VC terminals. */ + + k = add_serial_getty(tty); ++ free(tty); + + if (k < 0) { +- free(tty); + free(active); + r = EXIT_FAILURE; + goto finish; diff --git a/systemd.changes b/systemd.changes index df17ae6d..ffb779c8 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Jan 31 14:24:35 UTC 2014 - werner@suse.de + +- Change and extend patch + 0001-On_s390_con3270_disable_ANSI_colour_esc.patch + to re-enable colouring if 3270 console was enforced on the kernel + command line as 3270 cna handle colour ANSI escape sequences. + Also let the serial getty generator find the /dev/3270/tty1 + character device (bnc#861316) + ------------------------------------------------------------------- Thu Jan 30 12:33:08 UTC 2014 - werner@suse.de