diff --git a/0009-pid1-handle-console-specificities-weirdness-for-s390.patch b/0009-pid1-handle-console-specificities-weirdness-for-s390.patch new file mode 100644 index 00000000..14354b18 --- /dev/null +++ b/0009-pid1-handle-console-specificities-weirdness-for-s390.patch @@ -0,0 +1,60 @@ +From dedd52f920cf7ae718bb31ac7286d3f7314540c6 Mon Sep 17 00:00:00 2001 +From: Franck Bui +Date: Fri, 10 Jun 2016 15:19:57 +0200 +Subject: [PATCH 09/11] pid1: handle console specificities/weirdness for s390 + arch + +The 3270 console on S/390 can do color but not the 3215 console. + +Partial forward port of +0001-On_s390_con3270_disable_ANSI_colour_esc.patch from SLE12-SP1. A +bunch of the previous code has been dropped since some changes +imported from upsteam made them uneeded. + +The remaining bits are probably hackish but at least they are now +minimal. + +It was an attempt to address bnc#860937. And yes turning the console +color mode off by passing $TERM=dumb via the kernel command line would +have been much more easier and enough. + +This is actually implemented by recent systemd. There's also another +command line option: systemd.log_color=off. + +See also a short discussion which happened on @systemd-maintainers +whose $subject is "[PATCH] support conmode setting on command line". + +[fbui: fixes bsc#860937] +--- + src/basic/terminal-util.c | 15 ++++++++++++++- + 1 file changed, 14 insertions(+), 1 deletion(-) + +diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c +index d769423d6e..1a65391146 100644 +--- a/src/basic/terminal-util.c ++++ b/src/basic/terminal-util.c +@@ -779,7 +779,20 @@ bool tty_is_vc_resolve(const char *tty) { + } + + const char *default_term_for_tty(const char *tty) { +- return tty && tty_is_vc_resolve(tty) ? "linux" : "vt220"; ++ if (tty && tty_is_vc_resolve(tty)) ++ return "linux"; ++ ++#if defined (__s390__) || defined (__s390x__) ++ if (tty && tty_is_console(tty)) { ++ _cleanup_free_ char *mode = NULL; ++ ++ /* Simply return "dumb" in case of OOM. */ ++ (void) proc_cmdline_get_key("conmode", 0, &mode); ++ (void) proc_cmdline_value_missing("conmode", mode); ++ return streq_ptr(mode, "3270") ? "ibm327x" : "dumb"; ++ } ++#endif ++ return "vt220"; + } + + int fd_columns(int fd) { +-- +2.26.2 + diff --git a/systemd.changes b/systemd.changes index ba4c380b..24faf469 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,9 +1,6 @@ ------------------------------------------------------------------- Fri Jan 14 14:55:56 UTC 2022 - Franck Bui -- Drop 0009-pid1-handle-console-specificities-weirdness-for-s390.patch, it's SLE - material. - - Extract bits from 0008-sysv-generator-translate-Required-Start-into-a-Wants.patch which are not specific to the handling of 'Required-Start:' and move them into a new patch 0009-sysv-add-back-support-for-all-virtual-facility-and-f.patch diff --git a/systemd.spec b/systemd.spec index f3655399..cac40550 100644 --- a/systemd.spec +++ b/systemd.spec @@ -202,6 +202,7 @@ Patch9: 0009-sysv-add-back-support-for-all-virtual-facility-and-f.patch Patch10: 0001-conf-parser-introduce-early-drop-ins.patch Patch11: 0011-core-disable-session-keyring-per-system-sevice-entir.patch Patch12: 0012-resolved-create-etc-resolv.conf-symlink-at-runtime.patch +Patch13: 0009-pid1-handle-console-specificities-weirdness-for-s390.patch # Patches listed below are put in quarantine. Normally all changes # must go to upstream first and then are cherry-picked in the SUSE git