]>
Commit | Line | Data |
---|---|---|
440d1d13 BZ |
1 | diff --git a/Makefile.am b/Makefile.am |
2 | index 170465a..bce467d 100644 | |
3 | --- a/Makefile.am | |
4 | +++ b/Makefile.am | |
d31498aa JR |
5 | @@ -196,6 +196,8 @@ |
6 | SYSINIT_TARGET_WANTS = | |
d31498aa | 7 | SOCKETS_TARGET_WANTS = |
bce90f0e | 8 | TIMERS_TARGET_WANTS = |
d31498aa JR |
9 | +FINAL_TARGET_WANTS = |
10 | +GRAPHICAL_TARGET_WANTS = | |
440d1d13 | 11 | |
d31498aa JR |
12 | SYSTEM_UNIT_ALIASES = |
13 | USER_UNIT_ALIASES = | |
14 | @@ -214,6 +216,8 @@ | |
15 | what="$(SYSINIT_TARGET_WANTS)" && wants=sysinit.target && $(add-wants) | |
d31498aa | 16 | what="$(SOCKETS_TARGET_WANTS)" && wants=sockets.target && $(add-wants) |
bce90f0e | 17 | what="$(TIMERS_TARGET_WANTS)" && wants=timers.target && $(add-wants) |
d31498aa JR |
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) | |
4d29e184 BZ |
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 ) | |
440d1d13 | 48 | |
d31498aa JR |
49 | distclean-local: $(DISTCLEAN_LOCAL_HOOKS) |
50 | ||
082609ad | 51 | diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c |
440d1d13 | 52 | index 2c2f10c..754f0c7 100644 |
082609ad JR |
53 | --- a/src/core/hostname-setup.c |
54 | +++ b/src/core/hostname-setup.c | |
da7cff0c JR |
55 | @@ -64,13 +64,84 @@ static int read_and_strip_hostname(const char *path, char **hn) { |
56 | return 0; | |
57 | } | |
4d29e184 | 58 | |
da7cff0c JR |
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); | |
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) { | |
4d29e184 | 131 | int r; |
da7cff0c JR |
132 | _cleanup_free_ char *b = NULL; |
133 | const char *hn; | |
134 | bool enoent = false; | |
4d29e184 | 135 | |
da7cff0c JR |
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; | |
082609ad | 141 | diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c |
440d1d13 | 142 | index 7f692e9..0a45854 100644 |
082609ad JR |
143 | --- a/src/core/locale-setup.c |
144 | +++ b/src/core/locale-setup.c | |
da7cff0c | 145 | @@ -74,6 +74,7 @@ int locale_setup(void) { |
4d29e184 | 146 | |
da7cff0c JR |
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) { | |
4d29e184 BZ |
154 | log_warning("Failed to read /etc/locale.conf: %s", strerror(-r)); |
155 | } | |
156 | ||
da7cff0c JR |
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 | if (!variables[VARIABLE_LANG]) { | |
167 | variables[VARIABLE_LANG] = strdup("C"); | |
168 | if (!variables[VARIABLE_LANG]) { | |
a2211e27 JR |
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 | |
da7cff0c | 171 | @@ -175,6 +175,13 @@ |
a2211e27 JR |
172 | } |
173 | } | |
174 | ||
a2211e27 JR |
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 | + } | |
d31498aa JR |
182 | have_timezone: |
183 | if (isempty(tz.zone)) { | |
184 | free(tz.zone); | |
440d1d13 BZ |
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 | |
d31498aa JR |
189 | @@ -358,6 +358,17 @@ |
190 | if (r < 0 && r != -ENOENT) | |
191 | log_warning("Failed to read /etc/vconsole.conf: %s", strerror(-r)); | |
da7cff0c | 192 | } |
d31498aa JR |
193 | + |
194 | + if (r <= 0) { | |
618c1d39 JR |
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)); | |
d31498aa | 203 | + } |
4d29e184 | 204 | |
d31498aa JR |
205 | if (utf8) |
206 | enable_utf8(fd); |