]> git.pld-linux.org Git - packages/systemd.git/blame - target-pld.patch
runtime elfutils dep is optional and belongs to -libs
[packages/systemd.git] / target-pld.patch
CommitLineData
f06261ce 1; rest of target-pld.patch logic in systemd.spec
821688ba
JP
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
4@@ -18,6 +18,7 @@
c75f826c 5
7d414874
AM
6 int shorten_overlong(const char *s, char **ret);
7
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);
821688ba
JP
11
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
14@@ -7,6 +7,7 @@
a919bc1d
JP
15 #include <unistd.h>
16
17 #include "alloc-util.h"
18+#include "env-file.h"
19 #include "fd-util.h"
20 #include "fileio.h"
821688ba
JP
21 #include "fs-util.h"
22@@ -130,13 +131,34 @@
7d414874 23 }
da7cff0c 24 }
4d29e184 25
7d414874 26+int read_etc_hostname_distro(const char *path, char **ret) {
da7cff0c 27+ int r;
dc5fbf40 28+ char *p = NULL;
057a68c8 29+ r = parse_env_file(NULL, "/etc/sysconfig/network", "HOSTNAME", &p);
7d414874 30+ if (r < 0)
da7cff0c 31+ return r;
489cb848 32+ if (!p) /* EOF without any hostname? the file is empty, let's treat that exactly like no file at all: ENOENT */
7d414874
AM
33+ return -ENOENT;
34+ hostname_cleanup(p);
35+ if (!hostname_is_valid(p, true))
36+ return -EBADMSG;
37+ *ret = p;
38+ return 0;
da7cff0c 39+}
821688ba 40+
da7cff0c 41+
7d414874
AM
42 int read_etc_hostname(const char *path, char **ret) {
43 _cleanup_fclose_ FILE *f = NULL;
44
45 assert(ret);
46
47- if (!path)
48+ if (!path) {
49+ int r;
50 path = "/etc/hostname";
51+ r = read_etc_hostname_distro(path, ret);
d38d6806 52+ if (r == 0)
7d414874
AM
53+ return r;
54+ }
4d29e184 55
7d414874
AM
56 f = fopen(path, "re");
57 if (!f)
51186fee
JP
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
a919bc1d 60@@ -21,6 +21,7 @@
65813442 61 locale_context_clear(c);
4d29e184 62
65813442
JP
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],
51186fee 68@@ -59,6 +60,17 @@
65813442
JP
69 if (fstat(fd, &st) < 0)
70 return log_debug_errno(errno, "Failed to stat /etc/locale.conf: %m");
4d29e184 71
51186fee
JP
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]
057a68c8 76+ )) < 0) {
da7cff0c 77+
51186fee
JP
78+ if (r != -ENOENT)
79+ log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
80+ }
da7cff0c
JR
81+ }
82+
65813442
JP
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))
85 return 0;
a8a1a634
JB
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
a919bc1d
JP
88@@ -14,6 +14,7 @@
89 #include <unistd.h>
90
91 #include "alloc-util.h"
92+#include "env-file.h"
93 #include "fd-util.h"
94 #include "fileio.h"
95 #include "fs-util.h"
96@@ -1385,8 +1385,16 @@
97 return r; /* returns EINVAL if not a symlink */
98
99 e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
c75f826c
AM
100- if (!e)
101- return -EINVAL;
102+ if (!e) {
057a68c8
JP
103+ r = parse_env_file(NULL, "/etc/sysconfig/timezone"
104+ "TIMEZONE", &e
105+ );
c75f826c
AM
106+ if (r < 0) {
107+ if (r != -ENOENT)
a919bc1d 108+ log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
c75f826c
AM
109+ return -EINVAL;
110+ }
a8a1a634 111+ }
a2211e27 112
a919bc1d 113 if (!timezone_is_valid(e, LOG_DEBUG))
c75f826c 114 return -EINVAL;
5003d836
JP
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
117@@ -141,7 +141,19 @@
118 if (r < 0) {
119 if (r != -ENOENT)
120 log_warning_errno(r, "Failed to read /etc/vconsole.conf, ignoring: %m");
121- return r;
122+
057a68c8 123+ int r1 = parse_env_file(NULL, "/etc/sysconfig/console"
5003d836
JP
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]
057a68c8 128+ );
5003d836
JP
129+ if (r1 < 0) {
130+ if (r1 != -ENOENT)
131+ log_warning_errno(r1, "Failed to read /etc/sysconfig/console, ignoring: %m");
132+ return r1;
133+ }
808bb44c 134+
5003d836
JP
135 }
136
137 context_merge_config(c, &v, NULL);
This page took 0.762799 seconds and 4 git commands to generate.