]> git.pld-linux.org Git - packages/systemd.git/blob - target-pld.patch
up to 246.4
[packages/systemd.git] / target-pld.patch
1 ; rest of target-pld.patch logic in systemd.spec
2 --- a/src/basic/hostname-util.h~        2018-03-05 23:16:37.000000000 +0100
3 +++ b/src/basic/hostname-util.h 2018-05-15 13:46:17.924678801 +0200
4 @@ -42,5 +42,6 @@ int sethostname_idempotent(const char *s
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 --- systemd-240/src/basic/hostname-util.c.orig  2018-12-21 19:53:33.000000000 +0100
12 +++ systemd-240/src/basic/hostname-util.c       2019-01-13 11:11:40.715590524 +0100
13 @@ -8,6 +8,7 @@
14  #include <unistd.h>
15  
16  #include "alloc-util.h"
17 +#include "env-file.h"
18  #include "fd-util.h"
19  #include "fileio.h"
20  #include "hostname-util.h"
21 @@ -290,13 +290,33 @@ int read_etc_hostname_stream(FILE *f, ch
22          }
23  }
24  
25 +int read_etc_hostname_distro(const char *path, char **ret) {
26 +        int r;
27 +        char *p = NULL;
28 +        r = parse_env_file(NULL, "/etc/sysconfig/network", "HOSTNAME", &p);
29 +        if (r < 0)
30 +                return r;
31 +        if (!p) /* EOF without any hostname? the file is empty, let's treat that exactly like no file at all: ENOENT */
32 +                return -ENOENT;
33 +        hostname_cleanup(p);
34 +         if (!hostname_is_valid(p, true))
35 +                 return -EBADMSG;
36 +         *ret = p;
37 +         return 0;
38 +}
39 +
40  int read_etc_hostname(const char *path, char **ret) {
41          _cleanup_fclose_ FILE *f = NULL;
42  
43          assert(ret);
44  
45 -        if (!path)
46 +        if (!path) {
47 +                int r;
48                  path = "/etc/hostname";
49 +                r = read_etc_hostname_distro(path, ret);
50 +                if (r == 0)
51 +                        return r;
52 +        }
53  
54          f = fopen(path, "re");
55          if (!f)
56 --- systemd-240/src/core/locale-setup.c.orig    2019-01-13 09:27:36.718995151 +0100
57 +++ systemd-240/src/core/locale-setup.c 2019-01-13 09:29:37.548993771 +0100
58 @@ -21,6 +21,7 @@
59          int r;
60  
61          r = proc_cmdline_get_key_many(PROC_CMDLINE_STRIP_RD_PREFIX,
62 +                                      "LANG",                     &variables[VARIABLE_LANG],
63                                        "locale.LANG",              &variables[VARIABLE_LANG],
64                                        "locale.LANGUAGE",          &variables[VARIABLE_LANGUAGE],
65                                        "locale.LC_CTYPE",          &variables[VARIABLE_LC_CTYPE],
66 @@ -59,6 +60,15 @@
67                          log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
68          }
69  
70 +        if (r <= 0 &&
71 +            (r = parse_env_file(NULL, "/etc/sysconfig/i18n",
72 +                                "LANG", &variables[VARIABLE_LANG]
73 +                                )) < 0) {
74 +
75 +                if (r != -ENOENT)
76 +                        log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
77 +        }
78 +
79          for (i = 0; i < _VARIABLE_LC_MAX; i++) {
80                  char *s;
81  
82 --- systemd-240/src/basic/time-util.c.orig      2019-01-13 09:27:36.718995151 +0100
83 +++ systemd-240/src/basic/time-util.c   2019-01-13 09:31:12.275659356 +0100
84 @@ -14,6 +14,7 @@
85  #include <unistd.h>
86  
87  #include "alloc-util.h"
88 +#include "env-file.h"
89  #include "fd-util.h"
90  #include "fileio.h"
91  #include "fs-util.h"
92 @@ -1385,8 +1385,16 @@
93                  return r; /* returns EINVAL if not a symlink */
94  
95          e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
96 -        if (!e)
97 -                return -EINVAL;
98 +        if (!e) {
99 +                r = parse_env_file(NULL, "/etc/sysconfig/timezone"
100 +                        "TIMEZONE", &e
101 +                        );
102 +                if (r < 0) {
103 +                        if (r != -ENOENT)
104 +                                log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
105 +                        return -EINVAL;
106 +                }
107 +       }
108  
109          if (!timezone_is_valid(e, LOG_DEBUG))
110                  return -EINVAL;
111 --- systemd-240.orig/src/vconsole/vconsole-setup.c      2013-08-13 22:02:47.000000000 +0200
112 +++ systemd-240/src/vconsole/vconsole-setup.c   2014-01-09 15:17:49.000000000 +0100
113 @@ -284,6 +284,17 @@ int main(int argc, char **argv) {
114          if (r < 0 && r != -ENOENT)
115                  log_warning_errno(r, "Failed to read /etc/vconsole.conf: %m");
116  
117 +        if (r < 0) {
118 +                int r1 = parse_env_file(NULL, "/etc/sysconfig/console"
119 +                                "CONSOLEFONT", &vc_font,
120 +                                "CONSOLEMAP", &vc_font_map,
121 +                                "CONSOLESCREENFONTMAP", &vc_font_unimap,
122 +                                "KEYTABLE", &vc_keymap
123 +                                );
124 +                if (r1 < 0 && r1 != -ENOENT)
125 +                        log_warning_errno(r1, "Failed to read /etc/sysconfig/console: %m");
126 +        } 
127 +
128          /* Let the kernel command line override /etc/vconsole.conf */
129          if (detect_container(NULL) <= 0) {
130                  r = parse_env_file(NULL, "/proc/cmdline", WHITESPACE,
This page took 0.066632 seconds and 3 git commands to generate.