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/shared/locale-setup.c.orig 2019-01-13 09:27:36.718995151 +0100
59 +++ systemd-240/src/shared/locale-setup.c 2019-01-13 09:29:37.548993771 +0100
61 locale_context_clear(c);
63 r = proc_cmdline_get_key_many(PROC_CMDLINE_STRIP_RD_PREFIX,
64 + "LANG", &c->locale[VARIABLE_LANG],
65 "locale.LANG", &c->locale[VARIABLE_LANG],
66 "locale.LANGUAGE", &c->locale[VARIABLE_LANGUAGE],
67 "locale.LC_CTYPE", &c->locale[VARIABLE_LC_CTYPE],
69 if (fstat(fd, &st) < 0)
70 return log_debug_errno(errno, "Failed to stat /etc/locale.conf: %m");
72 + if (r < 0 && stat("/etc/sysconfig/i18n", &st) == 0) {
73 + locale_context_clear(c);
74 + if ((r = parse_env_file(NULL, "/etc/sysconfig/i18n",
75 + "LANG", &c->locale[VARIABLE_LANG]
79 + log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
83 /* If the file is not changed, then we do not need to re-read the file. */
84 if (stat_inode_unmodified(&c->st, &st))
86 --- systemd-240/src/basic/time-util.c.orig 2019-01-13 09:27:36.718995151 +0100
87 +++ systemd-240/src/basic/time-util.c 2019-01-13 09:31:12.275659356 +0100
91 #include "alloc-util.h"
92 +#include "env-file.h"
96 @@ -1385,8 +1385,16 @@
97 return r; /* returns EINVAL if not a symlink */
99 e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
103 + r = parse_env_file(NULL, "/etc/sysconfig/timezone"
108 + log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
113 if (!timezone_is_valid(e, LOG_DEBUG))
115 --- systemd-stable-254/src/vconsole/vconsole-setup.c.orig 2023-08-02 23:51:41.833676408 +0200
116 +++ systemd-stable-254/src/vconsole/vconsole-setup.c 2023-08-03 00:00:16.025707038 +0200
120 log_warning_errno(r, "Failed to read /etc/vconsole.conf, ignoring: %m");
123 + int r1 = parse_env_file(NULL, "/etc/sysconfig/console"
124 + "CONSOLEFONT", &v.config[VC_FONT],
125 + "CONSOLEMAP", &v.config[VC_FONT_MAP],
126 + "CONSOLESCREENFONTMAP", &v.config[VC_FONT_UNIMAP],
127 + "KEYTABLE", &v.config[VC_KEYMAP]
131 + log_warning_errno(r1, "Failed to read /etc/sysconfig/console, ignoring: %m");
137 context_merge_config(c, &v, NULL);