systemd/0009-pid1-handle-console-specificities-weirdness-for-s390.patch
Dominique Leuenberger 49e3c4604e Accepting request 947453 from Base:System
- Move the systemd-network-generator stuff in udev package
  This generator can generate .link files and is mainly used in initrd where
  udev is mandatory.

- Restore /sbin/udevadm and /bin/systemctl (obsolete) paths when split_usr is
  true (bsc#1194519)

- Import commit 3743acbce3bd44208af453fc6dc384a1236dc83c (merge of v249.9)
  For a complete list of changes, visit:
  e2ca79dd77...3743acbce3

- 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

- Import commit e2ca79dd775d1f7d39861d57f23c43f6cd85a872 (merge of v249.8)
  For a complete list of changes, visit:
  458220239c...e2ca79dd77

- Import commit 458220239c69b8e5fe7be480929348daeccb70d1
  e95df40b09 shared/rm-rf: loop over nested directories instead of instead of recursing (CVE-2021-3997 bsc#1194178)
  078e04305d shared/rm_rf: refactor rm_rf() to shorten code a bit
  6d560d0aca shared/rm_rf: refactor rm_rf_children_inner() to shorten code a bit
  6666ff056c localectl: don't omit keymaps files that are symlinks (bsc#1191826)
- Drop the following patches as they have been merged into SUSE/v249 branch:
  5000-shared-rm_rf-refactor-rm_rf_children_inner-to-shorte.patch
  5001-shared-rm_rf-refactor-rm_rf-to-shorten-code-a-bit.patch
  5002-shared-rm-rf-loop-over-nested-directories-instead-of.patch

- Import commit 523f32df573d459551760b072cb62906f4a2cf23 (merge of v249.7)

OBS-URL: https://build.opensuse.org/request/show/947453
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=344
2022-01-21 00:25:13 +00:00

61 lines
2.0 KiB
Diff

From dedd52f920cf7ae718bb31ac7286d3f7314540c6 Mon Sep 17 00:00:00 2001
From: Franck Bui <fbui@suse.com>
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