SHA256
1
0
forked from pool/systemd
systemd/handle-root_uses_lang-value-in-etc-sysconfig-language.patch

73 lines
3.0 KiB
Diff
Raw Normal View History

From: Frederic Crozat <fcrozat@suse.com>
Date: Tue, 4 Dec 2012 16:51:32 +0000
Subject: handle root_uses_lang value in /etc/sysconfig/language
handle ROOT_USES_LANG=ctype (boo#792182).
---
src/core/locale-setup.c | 40 ++++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
Index: systemd-228/src/core/locale-setup.c
Accepting request 201848 from home:fcrozat:branches:Base:System (please fwd to 13.1 too) - Release v208: + logind gained support for facilitating privileged input and drm devices access for unprivileged clients (helps Wayland / kmscon). + New kernel command line luks.options= allows to specify LUKS options, when used with luks.uuid= + tmpfileS.d snippets can uses specifier expansion in path names (%m, %b, %H, %v). + New tmpfiles.d command "m" introduced to change owner/group/access mode of a file/directory only if it exists. + MemorySoftLimit= cgroup settings is no longer supported (underlying kernel cgroup attribute will disappear in the future). + memeory.use_hierarchy cgroup attribute is enabled for all cgroups systemd creates in memory cgroup hierarchy. + New filed _SYSTEMD_SLICE= is logged in journal messages related to a slice. + systemd-journald will no longer adjust the group of journal files it creates to "systemd-journal" group. Permissions and owernship is adjusted when package is upgraded. + Backlight and random seed files are now stored in /var/lib/systemd. + Boot time performance measurements included ACPI 5.0 FPDT informations if available. - Drop merged patches: 0001-cgroup-add-the-missing-setting-of-variable-s-value.patch, 0002-cgroup-correct-the-log-information.patch, 0003-cgroup-fix-incorrectly-setting-memory-cgroup.patch, 0004-random-seed-we-should-return-errno-of-failed-loop_wr.patch, 0005-core-cgroup-first-print-then-free.patch, OBS-URL: https://build.opensuse.org/request/show/201848 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=448
2013-10-02 13:01:24 +02:00
===================================================================
--- systemd-228.orig/src/core/locale-setup.c
+++ systemd-228/src/core/locale-setup.c
@@ -30,11 +30,16 @@
#include "strv.h"
#include "util.h"
#include "virt.h"
+#include "alloc-util.h"
int locale_setup(char ***environment) {
Accepting request 201848 from home:fcrozat:branches:Base:System (please fwd to 13.1 too) - Release v208: + logind gained support for facilitating privileged input and drm devices access for unprivileged clients (helps Wayland / kmscon). + New kernel command line luks.options= allows to specify LUKS options, when used with luks.uuid= + tmpfileS.d snippets can uses specifier expansion in path names (%m, %b, %H, %v). + New tmpfiles.d command "m" introduced to change owner/group/access mode of a file/directory only if it exists. + MemorySoftLimit= cgroup settings is no longer supported (underlying kernel cgroup attribute will disappear in the future). + memeory.use_hierarchy cgroup attribute is enabled for all cgroups systemd creates in memory cgroup hierarchy. + New filed _SYSTEMD_SLICE= is logged in journal messages related to a slice. + systemd-journald will no longer adjust the group of journal files it creates to "systemd-journal" group. Permissions and owernship is adjusted when package is upgraded. + Backlight and random seed files are now stored in /var/lib/systemd. + Boot time performance measurements included ACPI 5.0 FPDT informations if available. - Drop merged patches: 0001-cgroup-add-the-missing-setting-of-variable-s-value.patch, 0002-cgroup-correct-the-log-information.patch, 0003-cgroup-fix-incorrectly-setting-memory-cgroup.patch, 0004-random-seed-we-should-return-errno-of-failed-loop_wr.patch, 0005-core-cgroup-first-print-then-free.patch, OBS-URL: https://build.opensuse.org/request/show/201848 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=448
2013-10-02 13:01:24 +02:00
char **add;
char *variables[_VARIABLE_LC_MAX] = {};
int r = 0, i;
+#ifdef HAVE_SYSV_COMPAT
+ char _cleanup_free_ *rc_lang = NULL, *rc_lc_ctype = NULL;
+ char _cleanup_free_ *root_uses_lang = NULL;
+#endif
if (detect_container() <= 0) {
2013-04-19 22:31:17 +02:00
r = parse_env_file("/proc/cmdline", WHITESPACE,
@@ -81,6 +86,41 @@ int locale_setup(char ***environment) {
Accepting request 184036 from home:elvigia:branches:Base:System - version 206 , highlights: * Unit files now understand the new %v specifier which resolves to the kernel version string as returned by "uname-r". * "journalctl -b" may now be used to look for boot output of a specific boot. Try "journalctl -b -1" * Creation of "dead" device nodes has been moved from udev into kmod and tmpfiles. * The udev "keymap" data files and tools to apply keyboard specific mappings of scan to key codes, and force-release scan code lists have been entirely replaced by a udev "keyboard" builtin and a hwdb data file. - remove patches now in upstream - systemd now requires libkmod >=14 and cryptsetup >= 1.6.0 - systemd now require the kmod tool in addition to the library. - version 206 , highlights: * Unit files now understand the new %v specifier which resolves to the kernel version string as returned by "uname-r". * "journalctl -b" may now be used to look for boot output of a specific boot. Try "journalctl -b -1" * Creation of "dead" device nodes has been moved from udev into kmod and tmpfiles. * The udev "keymap" data files and tools to apply keyboard specific mappings of scan to key codes, and force-release scan code lists have been entirely replaced by a udev "keyboard" builtin and a hwdb data file. - remove patches now in upstream - systemd now requires libkmod >=14 and cryptsetup >= 1.6.0 - systemd now require the kmod tool in addition to the library. (forwarded request 184035 from elvigia) OBS-URL: https://build.opensuse.org/request/show/184036 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=416
2013-07-23 11:21:21 +02:00
if (r < 0 && r != -ENOENT)
log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
}
+#ifdef HAVE_SYSV_COMPAT
+ r = parse_env_file("/etc/sysconfig/language", NEWLINE,
+ "RC_LANG", &rc_lang,
+ "RC_LC_CTYPE", &rc_lc_ctype,
+ "ROOT_USES_LANG", &root_uses_lang,
+ NULL);
+
+ if (r < 0 && r != -ENOENT)
+ log_warning("Failed to read /etc/sysconfig/language: %s", strerror(-r));
+
+ /*
+ * Use the values of the interactive locale configuration in /etc/sysconfig/language
+ * as fallback if /etc/locale.conf does not exist and no locale was specified on the
+ * kernel's command line. The special case ROOT_USES_LANG=ctype allows to set LC_CTYPE
+ * even if LANG for root is set to e.g. POSIX. But do this only if no LC_CTYPE has been
+ * set in /etc/locale.conf and on the kernel's command line.
+ */
+ if (root_uses_lang) {
+ if (strcaseeq(root_uses_lang, "yes") && !variables[VARIABLE_LANG]) {
+ variables[VARIABLE_LANG] = rc_lang;
+ rc_lang = NULL;
+ }
+ if (strcaseeq(root_uses_lang, "ctype") && !variables[VARIABLE_LC_CTYPE]) {
+ if (variables[VARIABLE_LANG])
+ variables[VARIABLE_LC_CTYPE] = strdup(variables[VARIABLE_LANG]);
+ else if (rc_lc_ctype && *rc_lc_ctype) {
+ variables[VARIABLE_LC_CTYPE] = rc_lc_ctype;
+ rc_lc_ctype = NULL;
+ } else if (rc_lang && *rc_lang) {
+ variables[VARIABLE_LC_CTYPE] = rc_lang;
+ rc_lang = NULL;
+ }
+ }
+ }
+#endif
Accepting request 184036 from home:elvigia:branches:Base:System - version 206 , highlights: * Unit files now understand the new %v specifier which resolves to the kernel version string as returned by "uname-r". * "journalctl -b" may now be used to look for boot output of a specific boot. Try "journalctl -b -1" * Creation of "dead" device nodes has been moved from udev into kmod and tmpfiles. * The udev "keymap" data files and tools to apply keyboard specific mappings of scan to key codes, and force-release scan code lists have been entirely replaced by a udev "keyboard" builtin and a hwdb data file. - remove patches now in upstream - systemd now requires libkmod >=14 and cryptsetup >= 1.6.0 - systemd now require the kmod tool in addition to the library. - version 206 , highlights: * Unit files now understand the new %v specifier which resolves to the kernel version string as returned by "uname-r". * "journalctl -b" may now be used to look for boot output of a specific boot. Try "journalctl -b -1" * Creation of "dead" device nodes has been moved from udev into kmod and tmpfiles. * The udev "keymap" data files and tools to apply keyboard specific mappings of scan to key codes, and force-release scan code lists have been entirely replaced by a udev "keyboard" builtin and a hwdb data file. - remove patches now in upstream - systemd now requires libkmod >=14 and cryptsetup >= 1.6.0 - systemd now require the kmod tool in addition to the library. (forwarded request 184035 from elvigia) OBS-URL: https://build.opensuse.org/request/show/184036 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=416
2013-07-23 11:21:21 +02:00
Accepting request 201848 from home:fcrozat:branches:Base:System (please fwd to 13.1 too) - Release v208: + logind gained support for facilitating privileged input and drm devices access for unprivileged clients (helps Wayland / kmscon). + New kernel command line luks.options= allows to specify LUKS options, when used with luks.uuid= + tmpfileS.d snippets can uses specifier expansion in path names (%m, %b, %H, %v). + New tmpfiles.d command "m" introduced to change owner/group/access mode of a file/directory only if it exists. + MemorySoftLimit= cgroup settings is no longer supported (underlying kernel cgroup attribute will disappear in the future). + memeory.use_hierarchy cgroup attribute is enabled for all cgroups systemd creates in memory cgroup hierarchy. + New filed _SYSTEMD_SLICE= is logged in journal messages related to a slice. + systemd-journald will no longer adjust the group of journal files it creates to "systemd-journal" group. Permissions and owernship is adjusted when package is upgraded. + Backlight and random seed files are now stored in /var/lib/systemd. + Boot time performance measurements included ACPI 5.0 FPDT informations if available. - Drop merged patches: 0001-cgroup-add-the-missing-setting-of-variable-s-value.patch, 0002-cgroup-correct-the-log-information.patch, 0003-cgroup-fix-incorrectly-setting-memory-cgroup.patch, 0004-random-seed-we-should-return-errno-of-failed-loop_wr.patch, 0005-core-cgroup-first-print-then-free.patch, OBS-URL: https://build.opensuse.org/request/show/201848 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=448
2013-10-02 13:01:24 +02:00
add = NULL;
for (i = 0; i < _VARIABLE_LC_MAX; i++) {