]> git.pld-linux.org Git - packages/systemd.git/blob - target-pld.patch
- fix autogenerated fsck-root service
[packages/systemd.git] / target-pld.patch
1 diff -dur -x '*~' -x '*.orig' systemd-208.orig/Makefile.am systemd-208/Makefile.am
2 --- systemd-208.orig/Makefile.am        2013-10-02 04:57:09.000000000 +0200
3 +++ systemd-208/Makefile.am     2014-01-09 15:15:41.000000000 +0100
4 @@ -211,6 +211,8 @@
5  TIMERS_TARGET_WANTS =
6  USER_SOCKETS_TARGET_WANTS =
7  USER_BUSNAMES_TARGET_WANTS =
8 +FINAL_TARGET_WANTS =
9 +GRAPHICAL_TARGET_WANTS =
10  
11  SYSTEM_UNIT_ALIASES =
12  USER_UNIT_ALIASES =
13 @@ -230,6 +232,8 @@
14         what="$(SLICES_TARGET_WANTS)" && wants=slices.target && $(add-wants)
15         what="$(USER_SOCKETS_TARGET_WANTS)" && wants=sockets.target && dir=$(userunitdir) && $(add-wants)
16         what="$(USER_BUSNAMES_TARGET_WANTS)" && wants=busnames.target && dir=$(userunitdir) && $(add-wants)
17 +       what="$(FINAL_TARGET_WANTS)" && wants=final.target && dir=$(systemunitdir) && $(add-wants)
18 +       what="$(GRAPHICAL_TARGET_WANTS)" && wants=graphical.target && dir=$(systemunitdir) && $(add-wants)
19  
20  define add-wants
21         [ -z "$$what" ] || ( \
22 @@ -4001,8 +4005,15 @@
23         $(systemdstatedir)
24  
25  MULTI_USER_TARGET_WANTS += \
26 +       rc-local.service \
27         systemd-logind.service
28  
29 +FINAL_TARGET_WANTS += \
30 +       halt-local.service
31 +
32 +GRAPHICAL_TARGET_WANTS += \
33 +       display-manager.service
34 +
35  SYSTEM_UNIT_ALIASES += \
36         systemd-logind.service dbus-org.freedesktop.login1.service
37  
38 @@ -4493,6 +4504,10 @@
39  uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
40  
41  install-data-hook: $(INSTALL_DATA_HOOKS)
42 +       ( cd $(DESTDIR)$(systemunitdir) && \
43 +               rm -f display-manager.service single.service && \
44 +               $(LN_S) prefdm.service display-manager.service && \
45 +               $(LN_S) rescue.service single.service )
46  
47  distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
48  
49 diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/core/hostname-setup.c systemd-208/src/core/hostname-setup.c
50 --- systemd-208.orig/src/core/hostname-setup.c  2013-08-13 22:02:46.000000000 +0200
51 +++ systemd-208/src/core/hostname-setup.c       2014-01-09 15:15:41.000000000 +0100
52 @@ -53,13 +53,84 @@
53          return 0;
54  }
55  
56 +static int read_distro_hostname(char **hn) {
57 +        int r;
58 +        _cleanup_fclose_ FILE *f = NULL;
59 +
60 +        assert(hn);
61 +
62 +        f = fopen("/etc/sysconfig/network", "re");
63 +        if (!f)
64 +                return -errno;
65 +
66 +        for (;;) {
67 +                char line[LINE_MAX];
68 +                char *s, *k;
69 +
70 +                if (!fgets(line, sizeof(line), f)) {
71 +                        if (feof(f))
72 +                                break;
73 +
74 +                        r = -errno;
75 +                        goto finish;
76 +                }
77 +
78 +                s = strstrip(line);
79 +
80 +                if (!startswith_no_case(s, "HOSTNAME="))
81 +                        continue;
82 +
83 +                k = strdup(s+9);
84 +                if (!k) {
85 +                        r = -ENOMEM;
86 +                        goto finish;
87 +                }
88 +
89 +                hostname_cleanup(k, false);
90 +
91 +                if (isempty(k)) {
92 +                        free(k);
93 +                        r = -ENOENT;
94 +                        goto finish;
95 +                }
96 +
97 +                *hn = k;
98 +                r = 0;
99 +                goto finish;
100 +        }
101 +
102 +        r = -ENOENT;
103 +
104 +finish:
105 +        return r;
106 +}
107 +
108 +static int read_hostname(char **hn) {
109 +        int r;
110 +
111 +        assert(hn);
112 +
113 +        /* First, try to load the generic hostname configuration file,
114 +         * that we support on all distributions */
115 +
116 +        r = read_hostname_config("/etc/hostname", hn);
117 +        if (r < 0) {
118 +                if (r == -ENOENT)
119 +                        return read_distro_hostname(hn);
120 +
121 +                return r;
122 +        }
123 +
124 +        return 0;
125 +}
126 +
127  int hostname_setup(void) {
128          int r;
129          _cleanup_free_ char *b = NULL;
130          const char *hn;
131          bool enoent = false;
132  
133 -        r = read_hostname_config("/etc/hostname", &b);
134 +        r = read_hostname(&b);
135          if (r < 0) {
136                  if (r == -ENOENT)
137                          enoent = true;
138 diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/core/locale-setup.c systemd-208/src/core/locale-setup.c
139 --- systemd-208.orig/src/core/locale-setup.c    2013-10-01 00:17:21.000000000 +0200
140 +++ systemd-208/src/core/locale-setup.c 2014-01-09 15:15:41.000000000 +0100
141 @@ -76,6 +76,7 @@
142  
143          if (detect_container(NULL) <= 0) {
144                  r = parse_env_file("/proc/cmdline", WHITESPACE,
145 +                                   "LANG",                     &variables[VARIABLE_LANG],
146                                     "locale.LANG",              &variables[VARIABLE_LANG],
147                                     "locale.LANGUAGE",          &variables[VARIABLE_LANGUAGE],
148                                     "locale.LC_CTYPE",          &variables[VARIABLE_LC_CTYPE],
149 @@ -120,6 +121,15 @@
150                          log_warning("Failed to read /etc/locale.conf: %s", strerror(-r));
151          }
152  
153 +        if (r <= 0 &&
154 +            (r = parse_env_file("/etc/sysconfig/i18n", NEWLINE,
155 +                                "LANG", &variables[VARIABLE_LANG],
156 +                                NULL)) < 0) {
157 +
158 +                if (r != -ENOENT)
159 +                        log_warning("Failed to read /etc/sysconfig/i18n: %s", strerror(-r));
160 +        }
161 +
162          add = NULL;
163          for (i = 0; i < _VARIABLE_MAX; i++) {
164                  char *s;
165 diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/timedate/timedated.c systemd-208/src/timedate/timedated.c
166 --- systemd-208.orig/src/timedate/timedated.c   2013-08-13 22:02:47.000000000 +0200
167 +++ systemd-208/src/timedate/timedated.c        2014-01-09 15:15:41.000000000 +0100
168 @@ -183,9 +183,19 @@
169                          c->zone = strdup(e);
170                          if (!c->zone)
171                                  return log_oom();
172 +                        goto have_timezone;
173                  }
174          }
175  
176 +       r = parse_env_file("/etc/sysconfig/timezone", NEWLINE,
177 +                          "TIMEZONE", &c->zone,
178 +                          NULL);
179 +       if (r < 0) {
180 +               if (r != -ENOENT)
181 +                       log_warning("Failed to read /etc/sysconfig/timezone: %s", strerror(-r));
182 +       }
183
184 +have_timezone:
185          if (isempty(c->zone)) {
186                  free(c->zone);
187                  c->zone = NULL;
188 diff -dur -x '*~' -x '*.orig' systemd-208.orig/src/vconsole/vconsole-setup.c systemd-208/src/vconsole/vconsole-setup.c
189 --- systemd-208.orig/src/vconsole/vconsole-setup.c      2013-08-13 22:02:47.000000000 +0200
190 +++ systemd-208/src/vconsole/vconsole-setup.c   2014-01-09 15:17:49.000000000 +0100
191 @@ -284,6 +284,17 @@ int main(int argc, char **argv) {
192          if (r < 0 && r != -ENOENT)
193                  log_warning("Failed to read /etc/vconsole.conf: %s", strerror(-r));
194  
195 +        if (r <= 0) {
196 +                int r1 = parse_env_file("/etc/sysconfig/console", NEWLINE,
197 +                                "CONSOLEFONT", &vc_font,
198 +                                "CONSOLEMAP", &vc_font_map,
199 +                                "CONSOLESCREENFONTMAP", &vc_font_unimap,
200 +                                "KEYTABLE", &vc_keymap,
201 +                                NULL);
202 +                if (r1 < 0 && r1 != -ENOENT)
203 +                        log_warning("Failed to read /etc/sysconfig/console: %s", strerror(-r1));
204 +        } 
205 +
206          /* Let the kernel command line override /etc/vconsole.conf */
207          if (detect_container(NULL) <= 0) {
208                  r = parse_env_file("/proc/cmdline", WHITESPACE,
This page took 0.170138 seconds and 3 git commands to generate.