]> git.pld-linux.org Git - packages/systemd.git/blob - target-pld.patch
6ef7e08466d0d318a287f508df2614e561005117
[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-238/src/basic/hostname-util.c~      2018-03-05 23:16:37.000000000 +0100
12 +++ systemd-238/src/basic/hostname-util.c       2018-05-15 13:21:08.392017315 +0200
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", NEWLINE, "HOSTNAME", &p, NULL);
29 +        if (r < 0)
30 +                return r;
31 +        if (r == 0) /* 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 diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/core/locale-setup.c systemd-208/src/core/locale-setup.c
57 --- systemd-208.orig/src/core/locale-setup.c    2013-10-01 00:17:21.000000000 +0200
58 +++ systemd-208/src/core/locale-setup.c 2014-01-09 15:15:41.000000000 +0100
59 @@ -21,6 +21,7 @@
60          int r;
61  
62          r = proc_cmdline_get_key_many(PROC_CMDLINE_STRIP_RD_PREFIX,
63 +                                      "LANG",                     &variables[VARIABLE_LANG],
64                                        "locale.LANG",              &variables[VARIABLE_LANG],
65                                        "locale.LANGUAGE",          &variables[VARIABLE_LANGUAGE],
66                                        "locale.LC_CTYPE",          &variables[VARIABLE_LC_CTYPE],
67 @@ -59,6 +60,15 @@
68                          log_warning_errno(r, "Failed to read /etc/locale.conf: %m");
69          }
70  
71 +        if (r <= 0 &&
72 +            (r = parse_env_file(NULL, "/etc/sysconfig/i18n", NEWLINE,
73 +                                "LANG", &variables[VARIABLE_LANG],
74 +                                NULL)) < 0) {
75 +
76 +                if (r != -ENOENT)
77 +                        log_warning_errno(r, "Failed to read /etc/sysconfig/i18n: %m");
78 +        }
79 +
80          for (i = 0; i < _VARIABLE_LC_MAX; i++) {
81                  char *s;
82  
83 --- a/src/basic/time-util.c~    2016-11-03 18:16:42.000000000 +0100
84 +++ b/src/basic/time-util.c     2016-11-12 19:54:28.457197174 +0100
85 @@ -14,6 +14,7 @@
86  #include <unistd.h>
87  
88  #include "alloc-util.h"
89 +#include "env-file.h"
90  #include "fd-util.h"
91  #include "fileio.h"
92  #include "fs-util.h"
93 @@ -1385,8 +1385,16 @@
94                  return r; /* returns EINVAL if not a symlink */
95  
96          e = PATH_STARTSWITH_SET(t, "/usr/share/zoneinfo/", "../usr/share/zoneinfo/");
97 -        if (!e)
98 -                return -EINVAL;
99 +        if (!e) {
100 +                r = parse_env_file(NULL, "/etc/sysconfig/timezone", NEWLINE,
101 +                        "TIMEZONE", &e,
102 +                        NULL);
103 +                if (r < 0) {
104 +                        if (r != -ENOENT)
105 +                                log_warning_errno(r, "Failed to read /etc/sysconfig/timezone: %m");
106 +                        return -EINVAL;
107 +                }
108 +        }
109  
110          if (!timezone_is_valid(e, LOG_DEBUG))
111                  return -EINVAL;
112 diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/vconsole/vconsole-setup.c systemd-208/src/vconsole/vconsole-setup.c
113 --- systemd-208.orig/src/vconsole/vconsole-setup.c      2013-08-13 22:02:47.000000000 +0200
114 +++ systemd-208/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("Failed to read /etc/vconsole.conf: %s", strerror(-r));
118  
119 +        if (r <= 0) {
120 +                int r1 = parse_env_file(NULL, "/etc/sysconfig/console", NEWLINE,
121 +                                "CONSOLEFONT", &vc_font,
122 +                                "CONSOLEMAP", &vc_font_map,
123 +                                "CONSOLESCREENFONTMAP", &vc_font_unimap,
124 +                                "KEYTABLE", &vc_keymap,
125 +                                NULL);
126 +                if (r1 < 0 && r1 != -ENOENT)
127 +                        log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r1));
128 +        } 
129 +
130          /* Let the kernel command line override /etc/vconsole.conf */
131          if (detect_container(NULL) <= 0) {
132                  r = parse_env_file(NULL, "/proc/cmdline", WHITESPACE,
This page took 0.045445 seconds and 2 git commands to generate.