1 ; rest of target-pld.patch logic in systemd.spec
2 --- systemd-stable-248/src/shared/hostname-setup.h.orig 2021-03-30 22:59:02.000000000 +0200
3 +++ systemd-stable-248/src/shared/hostname-setup.h 2021-04-07 00:02:26.813489363 +0200
6 int shorten_overlong(const char *s, char **ret);
8 +int read_etc_hostname_distro(const char *path, char **ret);
9 int read_etc_hostname_stream(FILE *f, char **ret);
10 int read_etc_hostname(const char *path, char **ret);
12 --- systemd-stable-248/src/shared/hostname-setup.c.orig 2021-03-30 22:59:02.000000000 +0200
13 +++ systemd-stable-248/src/shared/hostname-setup.c 2021-04-07 00:04:58.955649812 +0200
17 #include "alloc-util.h"
18 +#include "env-file.h"
26 +int read_etc_hostname_distro(const char *path, char **ret) {
29 + r = parse_env_file(NULL, "/etc/sysconfig/network", "HOSTNAME", &p);
32 + if (!p) /* EOF without any hostname? the file is empty, let's treat that exactly like no file at all: ENOENT */
34 + hostname_cleanup(p);
35 + if (!hostname_is_valid(p, true))
42 int read_etc_hostname(const char *path, char **ret) {
43 _cleanup_fclose_ FILE *f = NULL;
50 path = "/etc/hostname";
51 + r = read_etc_hostname_distro(path, ret);
56 f = fopen(path, "re");
58 --- systemd-240/src/core/locale-setup.c.orig 2019-01-13 09:27:36.718995151 +0100
59 +++ systemd-240/src/core/locale-setup.c 2019-01-13 09:29:37.548993771 +0100
63 r = proc_cmdline_get_key_many(PROC_CMDLINE_STRIP_RD_PREFIX,
64 + "LANG", &variables[VARIABLE_LANG],
65 "locale.LANG", &variables[VARIABLE_LANG],
66 "locale.LANGUAGE", &variables[VARIABLE_LANGUAGE],
67 "locale.LC_CTYPE", &variables[VARIABLE_LC_CTYPE],
69 log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
73 + (r = parse_env_file(NULL, "/etc/sysconfig/i18n",
74 + "LANG", &variables[VARIABLE_LANG]
78 + log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
81 for (LocaleVariable i = 0; i < _VARIABLE_LC_MAX; i++) {
84 --- systemd-240/src/basic/time-util.c.orig 2019-01-13 09:27:36.718995151 +0100
85 +++ systemd-240/src/basic/time-util.c 2019-01-13 09:31:12.275659356 +0100
89 #include "alloc-util.h"
90 +#include "env-file.h"
94 @@ -1385,8 +1385,16 @@
95 return r; /* returns EINVAL if not a symlink */
97 e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
101 + r = parse_env_file(NULL, "/etc/sysconfig/timezone"
106 + log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
111 if (!timezone_is_valid(e, LOG_DEBUG))
113 --- systemd-240.orig/src/vconsole/vconsole-setup.c 2013-08-13 22:02:47.000000000 +0200
114 +++ systemd-240/src/vconsole/vconsole-setup.c 2014-01-09 15:17:49.000000000 +0100
115 @@ -284,6 +284,17 @@ int main(int argc, char **argv) {
116 if (r < 0 && r != -ENOENT)
117 log_warning_errno(r, "Failed to read /etc/vconsole.conf: %m");
120 + int r1 = parse_env_file(NULL, "/etc/sysconfig/console"
121 + "CONSOLEFONT", &vc_font,
122 + "CONSOLEMAP", &vc_font_map,
123 + "CONSOLESCREENFONTMAP", &vc_font_unimap,
124 + "KEYTABLE", &vc_keymap
126 + if (r1 < 0 && r1 != -ENOENT)
127 + log_warning_errno(r1, "Failed to read /etc/sysconfig/console: %m");
130 /* Let the kernel command line override /etc/vconsole.conf */
131 r = proc_cmdline_get_key_many(
132 PROC_CMDLINE_STRIP_RD_PREFIX,