]> git.pld-linux.org Git - packages/systemd.git/blob - target-pld.patch
7afdbd62d986a9179ec43747580987e29fa03b78
[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/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
60 @@ -21,6 +21,7 @@
61          int r;
62  
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],
68 @@ -59,6 +60,15 @@
69                          log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
70          }
71  
72 +        if (r <= 0 &&
73 +            (r = parse_env_file(NULL, "/etc/sysconfig/i18n",
74 +                                "LANG", &variables[VARIABLE_LANG]
75 +                                )) < 0) {
76 +
77 +                if (r != -ENOENT)
78 +                        log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
79 +        }
80 +
81          for (LocaleVariable i = 0; i < _VARIABLE_LC_MAX; i++) {
82                  char *s;
83  
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
86 @@ -14,6 +14,7 @@
87  #include <unistd.h>
88  
89  #include "alloc-util.h"
90 +#include "env-file.h"
91  #include "fd-util.h"
92  #include "fileio.h"
93  #include "fs-util.h"
94 @@ -1385,8 +1385,16 @@
95                  return r; /* returns EINVAL if not a symlink */
96  
97          e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
98 -        if (!e)
99 -                return -EINVAL;
100 +        if (!e) {
101 +                r = parse_env_file(NULL, "/etc/sysconfig/timezone"
102 +                        "TIMEZONE", &e
103 +                        );
104 +                if (r < 0) {
105 +                        if (r != -ENOENT)
106 +                                log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
107 +                        return -EINVAL;
108 +                }
109 +       }
110  
111          if (!timezone_is_valid(e, LOG_DEBUG))
112                  return -EINVAL;
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");
118  
119 +        if (r < 0) {
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
125 +                                );
126 +                if (r1 < 0 && r1 != -ENOENT)
127 +                        log_warning_errno(r1, "Failed to read /etc/sysconfig/console: %m");
128 +        } 
129 +
130          /* Let the kernel command line override /etc/vconsole.conf */
131          r = proc_cmdline_get_key_many(
132                          PROC_CMDLINE_STRIP_RD_PREFIX,
This page took 0.041563 seconds and 2 git commands to generate.