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