]> git.pld-linux.org Git - packages/systemd.git/blob - target-pld.patch
up to 252
[packages/systemd.git] / target-pld.patch
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
4 @@ -18,6 +18,7 @@
5  
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);
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 @@
15  #include <unistd.h>
16  
17  #include "alloc-util.h"
18 +#include "env-file.h"
19  #include "fd-util.h"
20  #include "fileio.h"
21  #include "fs-util.h"
22 @@ -130,13 +131,34 @@
23          }
24  }
25  
26 +int read_etc_hostname_distro(const char *path, char **ret) {
27 +        int r;
28 +        char *p = NULL;
29 +        r = parse_env_file(NULL, "/etc/sysconfig/network", "HOSTNAME", &p);
30 +        if (r < 0)
31 +                return r;
32 +        if (!p) /* EOF without any hostname? the file is empty, let's treat that exactly like no file at all: ENOENT */
33 +                return -ENOENT;
34 +        hostname_cleanup(p);
35 +         if (!hostname_is_valid(p, true))
36 +                 return -EBADMSG;
37 +         *ret = p;
38 +         return 0;
39 +}
40 +
41 +
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);
52 +                if (r == 0)
53 +                        return r;
54 +        }
55  
56          f = fopen(path, "re");
57          if (!f)
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
60 @@ -21,6 +21,7 @@
61                  locale_context_clear(c);
62  
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],
68 @@ -59,6 +60,17 @@
69                  if (r < 0 && errno != ENOENT)
70                          return log_debug_errno(errno, "Failed to stat /etc/locale.conf: %m");
71  
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]
76 +                                )) < 0) {
77 +
78 +                        if (r != -ENOENT)
79 +                                log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
80 +                }
81 +        }
82 +
83                  if (r >= 0) {
84                          /* If mtime is not changed, then we do not need to re-read the file. */
85                          t = timespec_load(&st.st_mtim);
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
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/");
100 -        if (!e)
101 -                return -EINVAL;
102 +        if (!e) {
103 +                r = parse_env_file(NULL, "/etc/sysconfig/timezone"
104 +                        "TIMEZONE", &e
105 +                        );
106 +                if (r < 0) {
107 +                        if (r != -ENOENT)
108 +                                log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
109 +                        return -EINVAL;
110 +                }
111 +       }
112  
113          if (!timezone_is_valid(e, LOG_DEBUG))
114                  return -EINVAL;
115 --- systemd-240.orig/src/vconsole/vconsole-setup.c      2013-08-13 22:02:47.000000000 +0200
116 +++ systemd-240/src/vconsole/vconsole-setup.c   2014-01-09 15:17:49.000000000 +0100
117 @@ -284,6 +284,17 @@ int main(int argc, char **argv) {
118          if (r < 0 && r != -ENOENT)
119                  log_warning_errno(r, "Failed to read /etc/vconsole.conf: %m");
120  
121 +        if (r < 0) {
122 +                int r1 = parse_env_file(NULL, "/etc/sysconfig/console"
123 +                                "CONSOLEFONT", &vc_font,
124 +                                "CONSOLEMAP", &vc_font_map,
125 +                                "CONSOLESCREENFONTMAP", &vc_font_unimap,
126 +                                "KEYTABLE", &vc_keymap
127 +                                );
128 +                if (r1 < 0 && r1 != -ENOENT)
129 +                        log_warning_errno(r1, "Failed to read /etc/sysconfig/console: %m");
130 +        } 
131 +
132          /* Let the kernel command line override /etc/vconsole.conf */
133          r = proc_cmdline_get_key_many(
134                          PROC_CMDLINE_STRIP_RD_PREFIX,
This page took 0.081676 seconds and 3 git commands to generate.