diff options
author | Khem Raj <raj.khem@gmail.com> | 2013-03-27 12:08:31 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-27 12:57:49 +0000 |
commit | f17316600204426a2c0d1dce104fed076fe5e5ca (patch) | |
tree | bd228e8e9ab315a1153de375fc4eecc6b5a46fd7 /meta/recipes-core | |
parent | eddba86f51d210c70568b77ba516d61d2b81177e (diff) | |
download | poky-f17316600204426a2c0d1dce104fed076fe5e5ca.tar.gz |
systemd: Upgrade to 198
Tested on ppc and x86_64
compile tested for uclibc
(From OE-Core rev: effb345e6c84158066620a90e224ad25ba79db34)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0001-systemd-analyze-rewrite-in-C.patch | 1087 | ||||
-rw-r--r-- | meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch | 140 | ||||
-rw-r--r-- | meta/recipes-core/systemd/systemd/udev-linkage.patch | 62 | ||||
-rw-r--r-- | meta/recipes-core/systemd/systemd_198.bb (renamed from meta/recipes-core/systemd/systemd_197.bb) | 10 |
4 files changed, 75 insertions, 1224 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-systemd-analyze-rewrite-in-C.patch b/meta/recipes-core/systemd/systemd/0001-systemd-analyze-rewrite-in-C.patch deleted file mode 100644 index b278390fef..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-systemd-analyze-rewrite-in-C.patch +++ /dev/null | |||
@@ -1,1087 +0,0 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | From 523f304facdf3dbc09dbcdcff500ddce60274987 Mon Sep 17 00:00:00 2001 | ||
4 | From: Peeters Simon <peeters.simon@gmail.com> | ||
5 | Date: Thu, 17 Jan 2013 14:34:25 -0800 | ||
6 | Subject: [PATCH] systemd-analyze: rewrite in C. | ||
7 | |||
8 | Written by Peeters Simon <peeters.simon@gmail.com>. Makefile stuff | ||
9 | and cleaned up a bit by Auke Kok <auke-jan.h.kok@intel.com>. | ||
10 | --- | ||
11 | Makefile.am | 21 +- | ||
12 | src/analyze/systemd-analyze.c | 684 +++++++++++++++++++++++++++++++++++++++++ | ||
13 | src/analyze/systemd-analyze.in | 328 -------------------- | ||
14 | 3 files changed, 694 insertions(+), 339 deletions(-) | ||
15 | create mode 100644 src/analyze/systemd-analyze.c | ||
16 | delete mode 100755 src/analyze/systemd-analyze.in | ||
17 | |||
18 | Index: systemd-197/Makefile.am | ||
19 | =================================================================== | ||
20 | --- systemd-197.orig/Makefile.am 2013-01-07 17:37:15.391966148 -0800 | ||
21 | +++ systemd-197/Makefile.am 2013-01-24 10:06:11.219490786 -0800 | ||
22 | @@ -185,7 +185,8 @@ | ||
23 | systemd-ask-password \ | ||
24 | systemd-tty-ask-password-agent \ | ||
25 | systemd-tmpfiles \ | ||
26 | - systemd-machine-id-setup | ||
27 | + systemd-machine-id-setup \ | ||
28 | + systemd-analyze | ||
29 | |||
30 | bin_PROGRAMS = \ | ||
31 | systemd-cgls \ | ||
32 | @@ -220,14 +221,16 @@ | ||
33 | systemd-fstab-generator \ | ||
34 | systemd-system-update-generator | ||
35 | |||
36 | -dist_bin_SCRIPTS = \ | ||
37 | - src/analyze/systemd-analyze | ||
38 | +systemd_analyze_SOURCES = \ | ||
39 | + src/analyze/systemd-analyze.c | ||
40 | |||
41 | -EXTRA_DIST += \ | ||
42 | - src/analyze/systemd-analyze.in | ||
43 | +systemd_analyze_CFLAGS = \ | ||
44 | + $(AM_CFLAGS) \ | ||
45 | + $(DBUS_CFLAGS) | ||
46 | |||
47 | -CLEANFILES += \ | ||
48 | - src/analyze/systemd-analyze | ||
49 | +systemd_analyze_LDADD = \ | ||
50 | + libsystemd-shared.la \ | ||
51 | + libsystemd-dbus.la | ||
52 | |||
53 | dist_bashcompletion_DATA = \ | ||
54 | shell-completion/systemd-bash-completion.sh | ||
55 | @@ -3839,10 +3842,6 @@ | ||
56 | $(SED_PROCESS) | ||
57 | $(AM_V_GEN)chmod +x $@ | ||
58 | |||
59 | -src/analyze/systemd-analyze: %: %.in Makefile | ||
60 | - $(SED_PROCESS) | ||
61 | - $(AM_V_GEN)chmod +x $@ | ||
62 | - | ||
63 | src/%.c: src/%.gperf | ||
64 | $(AM_V_at)$(MKDIR_P) $(dir $@) | ||
65 | $(AM_V_GEN)$(GPERF) < $< > $@ | ||
66 | Index: systemd-197/src/analyze/systemd-analyze.c | ||
67 | =================================================================== | ||
68 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
69 | +++ systemd-197/src/analyze/systemd-analyze.c 2013-01-24 10:06:11.219490786 -0800 | ||
70 | @@ -0,0 +1,684 @@ | ||
71 | +#include <stdio.h> | ||
72 | +#include <stdlib.h> | ||
73 | +#include <getopt.h> | ||
74 | +#include <locale.h> | ||
75 | + | ||
76 | +#include "install.h" | ||
77 | +#include "log.h" | ||
78 | +#include "dbus-common.h" | ||
79 | +#include "build.h" | ||
80 | +#include "util.h" | ||
81 | + | ||
82 | +#define svg(...) printf(__VA_ARGS__) | ||
83 | + | ||
84 | +static UnitFileScope arg_scope = UNIT_FILE_SYSTEM; | ||
85 | + | ||
86 | +struct unit_times { | ||
87 | + char *name; | ||
88 | + unsigned long long int ixt; | ||
89 | + unsigned long long int iet; | ||
90 | + unsigned long long int axt; | ||
91 | + unsigned long long int aet; | ||
92 | +}; | ||
93 | + | ||
94 | + | ||
95 | +unsigned long long int property_getull( | ||
96 | + DBusConnection *bus, | ||
97 | + const char *dest, | ||
98 | + const char *path, | ||
99 | + const char *interface, | ||
100 | + const char *property) | ||
101 | +{ | ||
102 | + _cleanup_dbus_message_unref_ DBusMessage *reply = NULL; | ||
103 | + DBusMessageIter iter, sub; | ||
104 | + unsigned long long int result = 0; | ||
105 | + union { | ||
106 | + char byte; | ||
107 | + dbus_int16_t i16; | ||
108 | + dbus_uint16_t u16; | ||
109 | + dbus_int32_t i32; | ||
110 | + dbus_uint32_t u32; | ||
111 | + dbus_int64_t i64; | ||
112 | + dbus_uint64_t u64; | ||
113 | + } dbus_result; | ||
114 | + | ||
115 | + int r = bus_method_call_with_reply ( | ||
116 | + bus, | ||
117 | + dest, | ||
118 | + path, | ||
119 | + "org.freedesktop.DBus.Properties", | ||
120 | + "Get", | ||
121 | + &reply, | ||
122 | + NULL, | ||
123 | + DBUS_TYPE_STRING, &interface, | ||
124 | + DBUS_TYPE_STRING, &property, | ||
125 | + DBUS_TYPE_INVALID); | ||
126 | + if (r) | ||
127 | + goto finish; | ||
128 | + | ||
129 | + if (!dbus_message_iter_init(reply, &iter) || | ||
130 | + dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT) | ||
131 | + goto finish; | ||
132 | + | ||
133 | + dbus_message_iter_recurse(&iter, &sub); | ||
134 | + | ||
135 | + switch(dbus_message_iter_get_arg_type(&sub)) { | ||
136 | + case DBUS_TYPE_BYTE: | ||
137 | + dbus_message_iter_get_basic(&sub, &dbus_result.byte); | ||
138 | + result = dbus_result.byte; | ||
139 | + break; | ||
140 | + case DBUS_TYPE_INT16: | ||
141 | + dbus_message_iter_get_basic(&sub, &dbus_result.i16); | ||
142 | + result = dbus_result.i16; | ||
143 | + break; | ||
144 | + case DBUS_TYPE_UINT16: | ||
145 | + dbus_message_iter_get_basic(&sub, &dbus_result.u16); | ||
146 | + result = dbus_result.u16; | ||
147 | + break; | ||
148 | + case DBUS_TYPE_INT32: | ||
149 | + dbus_message_iter_get_basic(&sub, &dbus_result.i32); | ||
150 | + result = dbus_result.i32; | ||
151 | + break; | ||
152 | + case DBUS_TYPE_UINT32: | ||
153 | + dbus_message_iter_get_basic(&sub, &dbus_result.u32); | ||
154 | + result = dbus_result.u32; | ||
155 | + break; | ||
156 | + case DBUS_TYPE_INT64: | ||
157 | + dbus_message_iter_get_basic(&sub, &dbus_result.i64); | ||
158 | + result = dbus_result.i64; | ||
159 | + break; | ||
160 | + case DBUS_TYPE_UINT64: | ||
161 | + dbus_message_iter_get_basic(&sub, &dbus_result.u64); | ||
162 | + result = dbus_result.u64; | ||
163 | + break; | ||
164 | + default: | ||
165 | + goto finish; | ||
166 | + } | ||
167 | +finish: | ||
168 | + return result; | ||
169 | +} | ||
170 | + | ||
171 | +static int compare_unit_times1(const void *a, const void *b) { | ||
172 | + const struct unit_times *u = a, *v = b; | ||
173 | + | ||
174 | + return (int)(v->aet - v->ixt) - (int)(u->aet - u->ixt); | ||
175 | +} | ||
176 | + | ||
177 | +static int compare_unit_times2(const void *a, const void *b) { | ||
178 | + const struct unit_times *u = a, *v = b; | ||
179 | + | ||
180 | + return (long long int)(u->ixt) - (long long int)(v->ixt); | ||
181 | +} | ||
182 | + | ||
183 | +int acquire_time_data(DBusConnection *bus, struct unit_times **out) | ||
184 | +{ | ||
185 | + _cleanup_dbus_message_unref_ DBusMessage *reply = NULL; | ||
186 | + DBusMessageIter iter, sub, sub2; | ||
187 | + unsigned int c = 0, n_units = 0; | ||
188 | + struct unit_times *unit_times = NULL; | ||
189 | + int r = bus_method_call_with_reply ( | ||
190 | + bus, | ||
191 | + "org.freedesktop.systemd1", | ||
192 | + "/org/freedesktop/systemd1", | ||
193 | + "org.freedesktop.systemd1.Manager", | ||
194 | + "ListUnits", | ||
195 | + &reply, | ||
196 | + NULL, | ||
197 | + DBUS_TYPE_INVALID); | ||
198 | + if (r) | ||
199 | + goto finish; | ||
200 | + | ||
201 | + if (!dbus_message_iter_init(reply, &iter) || | ||
202 | + dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_ARRAY || | ||
203 | + dbus_message_iter_get_element_type(&iter) != DBUS_TYPE_STRUCT) { | ||
204 | + log_error("Failed to parse reply."); | ||
205 | + r = -EIO; | ||
206 | + goto finish; | ||
207 | + } | ||
208 | + | ||
209 | + dbus_message_iter_recurse(&iter, &sub); | ||
210 | + | ||
211 | + while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) { | ||
212 | + struct unit_times *u; | ||
213 | + char *path; | ||
214 | + | ||
215 | + if (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_STRUCT) { | ||
216 | + log_error("Failed to parse reply."); | ||
217 | + r = -EIO; | ||
218 | + goto finish; | ||
219 | + } | ||
220 | + | ||
221 | + if (c >= n_units) { | ||
222 | + struct unit_times *w; | ||
223 | + | ||
224 | + n_units = MAX(2*c, 16); | ||
225 | + w = realloc(unit_times, sizeof(struct unit_times) * n_units); | ||
226 | + | ||
227 | + if (!w) { | ||
228 | + log_error("Failed to allocate unit array."); | ||
229 | + r = -ENOMEM; | ||
230 | + goto finish; | ||
231 | + } | ||
232 | + | ||
233 | + unit_times = w; | ||
234 | + } | ||
235 | + u = unit_times+c; | ||
236 | + | ||
237 | + dbus_message_iter_recurse(&sub, &sub2); | ||
238 | + | ||
239 | + if (bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_STRING, &u->name, true) < 0 || | ||
240 | + dbus_message_iter_next(&sub2), dbus_message_iter_next(&sub2), dbus_message_iter_next(&sub2), | ||
241 | + dbus_message_iter_next(&sub2), dbus_message_iter_next(&sub2), | ||
242 | + bus_iter_get_basic_and_next(&sub2, DBUS_TYPE_OBJECT_PATH, &path, true) < 0) { | ||
243 | + log_error("Failed to parse reply."); | ||
244 | + r = -EIO; | ||
245 | + goto finish; | ||
246 | + } | ||
247 | + u->name = strdup(u->name); | ||
248 | + u->ixt = property_getull(bus, | ||
249 | + "org.freedesktop.systemd1", | ||
250 | + path, | ||
251 | + "org.freedesktop.systemd1.Unit", | ||
252 | + "InactiveExitTimestampMonotonic"); | ||
253 | + u->iet = property_getull(bus, | ||
254 | + "org.freedesktop.systemd1", | ||
255 | + path, | ||
256 | + "org.freedesktop.systemd1.Unit", | ||
257 | + "InactiveEnterTimestampMonotonic"); | ||
258 | + u->axt = property_getull(bus, | ||
259 | + "org.freedesktop.systemd1", | ||
260 | + path, | ||
261 | + "org.freedesktop.systemd1.Unit", | ||
262 | + "ActiveExitTimestampMonotonic"); | ||
263 | + u->aet = property_getull(bus, | ||
264 | + "org.freedesktop.systemd1", | ||
265 | + path, | ||
266 | + "org.freedesktop.systemd1.Unit", | ||
267 | + "ActiveEnterTimestampMonotonic"); | ||
268 | + dbus_message_iter_next(&sub); | ||
269 | + if (u->ixt == 0) | ||
270 | + continue; | ||
271 | + c++; | ||
272 | + } | ||
273 | + | ||
274 | + *out = unit_times; | ||
275 | + return c; | ||
276 | +finish: | ||
277 | + free(unit_times); | ||
278 | + return r; | ||
279 | +} | ||
280 | + | ||
281 | +static void svg_graph_box(int height, long long int begin, long long int end, float scale_x, float scale_y) | ||
282 | +{ | ||
283 | + double d = 0.0; | ||
284 | + int i = 0; | ||
285 | + | ||
286 | + /* outside box, fill */ | ||
287 | + svg("<rect class=\"box\" x=\"%.03f\" y=\"0\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
288 | + 0, | ||
289 | + scale_x * (end - begin), | ||
290 | + scale_y * height); | ||
291 | + | ||
292 | + for (d = 0.000001 * begin; d <= 0.000001 * end; | ||
293 | + d += 0.1) { | ||
294 | + /* lines for each second */ | ||
295 | + if (i % 50 == 0) | ||
296 | + svg(" <line class=\"sec5\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n", | ||
297 | + scale_x * d, | ||
298 | + scale_x * d, | ||
299 | + scale_y * height); | ||
300 | + else if (i % 10 == 0) | ||
301 | + svg(" <line class=\"sec1\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n", | ||
302 | + scale_x * d, | ||
303 | + scale_x * d, | ||
304 | + scale_y * height); | ||
305 | + else | ||
306 | + svg(" <line class=\"sec01\" x1=\"%.03f\" y1=\"0\" x2=\"%.03f\" y2=\"%.03f\" />\n", | ||
307 | + scale_x * d, | ||
308 | + scale_x * d, | ||
309 | + scale_y * height); | ||
310 | + | ||
311 | + /* time label */ | ||
312 | + if (i % 10 == 0) | ||
313 | + svg(" <text class=\"sec\" x=\"%.03f\" y=\"%.03f\" >%.01fs</text>\n", | ||
314 | + scale_x * d, -5.0, d); | ||
315 | + | ||
316 | + i++; | ||
317 | + } | ||
318 | +} | ||
319 | + | ||
320 | +int analyze_plot(DBusConnection *bus) | ||
321 | +{ | ||
322 | + struct unit_times *times; | ||
323 | + int n = acquire_time_data(bus, ×); | ||
324 | + int m = n + 1; | ||
325 | + unsigned long long int firmware_time, loader_time, kernel_time, initrd_time, userspace_time, finish_time; | ||
326 | + long long int starttime = 0; | ||
327 | + | ||
328 | + float scale_x = 100.0; | ||
329 | + float scale_y = 20.0; | ||
330 | + | ||
331 | + if (n<=0) | ||
332 | + return -n; | ||
333 | + | ||
334 | + qsort(times, n, sizeof(struct unit_times), compare_unit_times2); | ||
335 | + | ||
336 | + firmware_time = property_getull(bus, | ||
337 | + "org.freedesktop.systemd1", | ||
338 | + "/org/freedesktop/systemd1", | ||
339 | + "org.freedesktop.systemd1.Manager", | ||
340 | + "FirmwareTimestampMonotonic"); | ||
341 | + loader_time = property_getull(bus, | ||
342 | + "org.freedesktop.systemd1", | ||
343 | + "/org/freedesktop/systemd1", | ||
344 | + "org.freedesktop.systemd1.Manager", | ||
345 | + "LoaderTimestampMonotonic"); | ||
346 | + kernel_time = property_getull(bus, | ||
347 | + "org.freedesktop.systemd1", | ||
348 | + "/org/freedesktop/systemd1", | ||
349 | + "org.freedesktop.systemd1.Manager", | ||
350 | + "KernelTimestamp"); | ||
351 | + initrd_time = property_getull(bus, | ||
352 | + "org.freedesktop.systemd1", | ||
353 | + "/org/freedesktop/systemd1", | ||
354 | + "org.freedesktop.systemd1.Manager", | ||
355 | + "InitRDTimestampMonotonic"); | ||
356 | + userspace_time = property_getull(bus, | ||
357 | + "org.freedesktop.systemd1", | ||
358 | + "/org/freedesktop/systemd1", | ||
359 | + "org.freedesktop.systemd1.Manager", | ||
360 | + "UserspaceTimestampMonotonic"); | ||
361 | + finish_time = property_getull(bus, | ||
362 | + "org.freedesktop.systemd1", | ||
363 | + "/org/freedesktop/systemd1", | ||
364 | + "org.freedesktop.systemd1.Manager", | ||
365 | + "FinishTimestampMonotonic"); | ||
366 | + | ||
367 | + | ||
368 | + if (firmware_time > 0) { | ||
369 | + m++; | ||
370 | + starttime += firmware_time - loader_time; | ||
371 | + } | ||
372 | + if (loader_time > 0) { | ||
373 | + m++; | ||
374 | + starttime += loader_time; | ||
375 | + } | ||
376 | + if (initrd_time > 0) | ||
377 | + m += 2; | ||
378 | + else if (kernel_time > 0) | ||
379 | + m++; | ||
380 | + | ||
381 | + float width = 80.0 + (scale_x * (starttime + finish_time) * 0.000001); | ||
382 | + float height = 150.0 + (m* scale_y); | ||
383 | + | ||
384 | + svg("<?xml version=\"1.0\" standalone=\"no\"?>\n"); | ||
385 | + svg("<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" "); | ||
386 | + svg("\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n"); | ||
387 | + | ||
388 | + //svg("<g transform=\"translate(10,%d)\">\n", 1000 + 150 + (pcount * 20)); | ||
389 | + svg("<svg width=\"%.0fpx\" height=\"%.0fpx\" version=\"1.1\" ", width, height); | ||
390 | + svg("xmlns=\"http://www.w3.org/2000/svg\">\n\n"); | ||
391 | + | ||
392 | + /* write some basic info as a comment, including some help */ | ||
393 | + svg("<!-- This file is a systemd-analyze SVG file. It is best rendered in a -->\n"); | ||
394 | + svg("<!-- browser such as Chrome/Chromium, firefox. Other applications that -->\n"); | ||
395 | + svg("<!-- render these files properly but much more slow are ImageMagick, -->\n"); | ||
396 | + svg("<!-- gimp, inkscape, etc.. To display the files on your system, just -->\n"); | ||
397 | + svg("<!-- point your browser to file:///var/log/ and click. -->\n\n"); | ||
398 | + svg("<!-- this plot was generated by systemd-analyze version %-16.16s -->\n\n", VERSION); | ||
399 | + | ||
400 | + /* style sheet */ | ||
401 | + svg("<defs>\n <style type=\"text/css\">\n <![CDATA[\n"); | ||
402 | + | ||
403 | + svg(" rect { stroke-width: 1; stroke-opacity: 0; }\n"); | ||
404 | + svg(" rect.activating { fill: rgb(255,0,0); fill-opacity: 0.7; }\n"); | ||
405 | + svg(" rect.active { fill: rgb(200,150,150); fill-opacity: 0.7; }\n"); | ||
406 | + svg(" rect.deactivating { fill: rgb(150,100,100); fill-opacity: 0.7; }\n"); | ||
407 | + svg(" rect.kernel { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"); | ||
408 | + svg(" rect.initrd { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"); | ||
409 | + svg(" rect.firmware { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"); | ||
410 | + svg(" rect.loader { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"); | ||
411 | + svg(" rect.userspace { fill: rgb(150,150,150); fill-opacity: 0.7; }\n"); | ||
412 | + svg(" rect.cpu { fill: rgb(64,64,240); stroke-width: 0; fill-opacity: 0.7; }\n"); | ||
413 | + svg(" rect.wait { fill: rgb(240,240,0); stroke-width: 0; fill-opacity: 0.7; }\n"); | ||
414 | + svg(" rect.bi { fill: rgb(240,128,128); stroke-width: 0; fill-opacity: 0.7; }\n"); | ||
415 | + svg(" rect.bo { fill: rgb(192,64,64); stroke-width: 0; fill-opacity: 0.7; }\n"); | ||
416 | + svg(" rect.ps { fill: rgb(192,192,192); stroke: rgb(128,128,128); fill-opacity: 0.7; }\n"); | ||
417 | + svg(" rect.krnl { fill: rgb(240,240,0); stroke: rgb(128,128,128); fill-opacity: 0.7; }\n"); | ||
418 | + svg(" rect.box { fill: rgb(240,240,240); stroke: rgb(192,192,192); }\n"); | ||
419 | + svg(" rect.clrw { stroke-width: 0; fill-opacity: 0.7;}\n"); | ||
420 | + svg(" line { stroke: rgb(64,64,64); stroke-width: 1; }\n"); | ||
421 | + svg("// line.sec1 { }\n"); | ||
422 | + svg(" line.sec5 { stroke-width: 2; }\n"); | ||
423 | + svg(" line.sec01 { stroke: rgb(224,224,224); stroke-width: 1; }\n"); | ||
424 | + svg(" line.dot { stroke-dasharray: 2 4; }\n"); | ||
425 | + svg(" line.idle { stroke: rgb(64,64,64); stroke-dasharray: 10 6; stroke-opacity: 0.7; }\n"); | ||
426 | + | ||
427 | + svg(" .run { font-size: 8; font-style: italic; }\n"); | ||
428 | + svg(" text { font-family: Verdana, Helvetica; font-size: 10; }\n"); | ||
429 | + svg(" text.sec { font-size: 8; }\n"); | ||
430 | + svg(" text.t1 { font-size: 24; }\n"); | ||
431 | + svg(" text.t2 { font-size: 12; }\n"); | ||
432 | + svg(" text.idle { font-size: 18; }\n"); | ||
433 | + | ||
434 | + svg(" ]]>\n </style>\n</defs>\n\n"); | ||
435 | + | ||
436 | + svg("<text x=\"20\" y=\"40\">Startup finished in "); | ||
437 | + | ||
438 | + if (firmware_time > 0) | ||
439 | + svg("%llums (firmware) + ", (firmware_time - loader_time) / 1000); | ||
440 | + if (loader_time > 0) | ||
441 | + svg("%llums (loader) + ", loader_time / 1000); | ||
442 | + if (initrd_time > 0) | ||
443 | + svg("%llums (kernel) + %llums (initrd) + ", initrd_time / 1000, (userspace_time - initrd_time) / 1000); | ||
444 | + else if (kernel_time > 0) | ||
445 | + svg("%llums (kernel) + ", userspace_time / 1000); | ||
446 | + svg("%llums (userspace) ", (finish_time - userspace_time) / 1000); | ||
447 | + if (kernel_time > 0) | ||
448 | + svg("= %llums\n", (firmware_time + finish_time) / 1000); | ||
449 | + else | ||
450 | + svg("= %llums\n", (finish_time - userspace_time) / 1000); | ||
451 | + svg("</text>"); | ||
452 | + | ||
453 | + svg("<g transform=\"translate(20,100)\">\n"); | ||
454 | + svg_graph_box(m, starttime, finish_time, scale_x, scale_y); | ||
455 | + | ||
456 | + float top = 0.0; | ||
457 | + | ||
458 | + if (firmware_time > 0) { | ||
459 | + svg(" <rect class=\"firmware\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
460 | + scale_x * (starttime - firmware_time) * 0.000001, | ||
461 | + top, | ||
462 | + scale_x * (firmware_time - loader_time) * 0.000001, | ||
463 | + scale_y - 1.0); | ||
464 | + svg(" <text x=\"%.03f\" y=\"%.03f\">firmware</text>\n", | ||
465 | + scale_x * (starttime - firmware_time) * 0.000001 + 5.0, | ||
466 | + top + 14.0); | ||
467 | + top += scale_y; | ||
468 | + } | ||
469 | + if (loader_time > 0) { | ||
470 | + svg(" <rect class=\"loader\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
471 | + scale_x * (starttime - loader_time) * 0.000001, | ||
472 | + top, | ||
473 | + scale_x * (loader_time) * 0.000001, | ||
474 | + scale_y - 1.0); | ||
475 | + svg(" <text x=\"%.03f\" y=\"%.03f\">loader</text>\n", | ||
476 | + scale_x * (starttime - loader_time) * 0.000001 + 5.0, | ||
477 | + top + 14.0); | ||
478 | + top += scale_y; | ||
479 | + } | ||
480 | + if (initrd_time > 0) { | ||
481 | + svg(" <rect class=\"kernel\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
482 | + scale_x * (starttime) * 0.000001, | ||
483 | + top, | ||
484 | + scale_x * (initrd_time) * 0.000001, | ||
485 | + scale_y - 1.0); | ||
486 | + svg(" <text x=\"%.03f\" y=\"%.03f\">kernel</text>\n", | ||
487 | + scale_x * (starttime) * 0.000001 + 5.0, | ||
488 | + top + 14.0); | ||
489 | + top += scale_y; | ||
490 | + svg(" <rect class=\"inird\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
491 | + scale_x * (starttime + initrd_time) * 0.000001, | ||
492 | + top, | ||
493 | + scale_x * (userspace_time - initrd_time) * 0.000001, | ||
494 | + scale_y - 1.0); | ||
495 | + svg(" <text x=\"%.03f\" y=\"%.03f\">initrd</text>\n", | ||
496 | + scale_x * (starttime + initrd_time) * 0.000001 + 5.0, | ||
497 | + top + 14.0); | ||
498 | + top += scale_y; | ||
499 | + } else if (kernel_time > 0) { | ||
500 | + svg(" <rect class=\"kernel\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
501 | + scale_x * (starttime) * 0.000001, | ||
502 | + top, | ||
503 | + scale_x * (userspace_time) * 0.000001, | ||
504 | + scale_y - 1.0); | ||
505 | + svg(" <text x=\"%.03f\" y=\"%.03f\">kernel</text>\n", | ||
506 | + scale_x * (starttime) * 0.000001 + 5.0, | ||
507 | + top + 14.0); | ||
508 | + top += scale_y; | ||
509 | + } | ||
510 | + | ||
511 | + svg(" <rect class=\"userspace\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
512 | + scale_x * (userspace_time) * 0.000001, | ||
513 | + top, | ||
514 | + scale_x * (finish_time - userspace_time) * 0.000001, | ||
515 | + scale_y - 1.0); | ||
516 | + svg(" <text x=\"%.03f\" y=\"%.03f\">userspace</text>\n", | ||
517 | + scale_x * (userspace_time) * 0.000001 + 5.0, | ||
518 | + top + 14.0); | ||
519 | + top += scale_y; | ||
520 | + | ||
521 | + | ||
522 | + for (int i=0; i < n; i++) { | ||
523 | + //draw times[i] | ||
524 | + | ||
525 | + bool drawn = false; | ||
526 | + | ||
527 | + if (times[i].ixt >= userspace_time && times[i].ixt <= finish_time) { | ||
528 | + unsigned long long int end = finish_time; | ||
529 | + if (times[i].aet >= times[i].ixt && times[i].aet < end) | ||
530 | + end = times[i].aet; | ||
531 | + if (times[i].axt >= times[i].ixt && times[i].axt < end) | ||
532 | + end = times[i].axt; | ||
533 | + if (times[i].iet >= times[i].ixt && times[i].iet < end) | ||
534 | + end = times[i].iet; | ||
535 | + svg(" <rect class=\"activating\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
536 | + scale_x * (starttime + times[i].ixt) * 0.000001, | ||
537 | + top + (scale_y * i), | ||
538 | + scale_x * (end - times[i].ixt) * 0.000001, | ||
539 | + scale_y - 1.0); | ||
540 | + } | ||
541 | + if (times[i].aet >= userspace_time && times[i].aet <= finish_time) { | ||
542 | + unsigned long long int end = finish_time; | ||
543 | + if (times[i].axt >= times[i].aet && times[i].axt < end) | ||
544 | + end = times[i].axt; | ||
545 | + if (times[i].iet >= times[i].aet && times[i].iet < end) | ||
546 | + end = times[i].iet; | ||
547 | + svg(" <rect class=\"active\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
548 | + scale_x * (starttime + times[i].aet) * 0.000001, | ||
549 | + top + (scale_y * i), | ||
550 | + scale_x * (end - times[i].aet) * 0.000001, | ||
551 | + scale_y - 1.0); | ||
552 | + } | ||
553 | + if (times[i].axt >= userspace_time && times[i].axt <= finish_time) { | ||
554 | + unsigned long long int end = finish_time; | ||
555 | + if (times[i].iet >= times[i].axt && times[i].iet < end) | ||
556 | + end = times[i].iet; | ||
557 | + svg(" <rect class=\"deactivating\" x=\"%.03f\" y=\"%.03f\" width=\"%.03f\" height=\"%.03f\" />\n", | ||
558 | + scale_x * (starttime + times[i].axt) * 0.000001, | ||
559 | + top + (scale_y * i), | ||
560 | + scale_x * (end - times[i].axt) * 0.000001, | ||
561 | + scale_y - 1.0); | ||
562 | + } | ||
563 | + | ||
564 | + svg(" <text x=\"%.03f\" y=\"%.03f\">%s</text>\n", | ||
565 | + (starttime + times[i].ixt) * scale_x * 0.000001 + 5.0, | ||
566 | + top + (scale_y * i) + 14.0, | ||
567 | + times[i].name); | ||
568 | + | ||
569 | + } | ||
570 | + svg("</g>\n\n"); | ||
571 | + | ||
572 | + svg("</svg>"); | ||
573 | + return 0; | ||
574 | +} | ||
575 | + | ||
576 | +int analyze_blame(DBusConnection *bus) | ||
577 | +{ | ||
578 | + struct unit_times *times; | ||
579 | + int n = acquire_time_data(bus, ×); | ||
580 | + if (n<=0) | ||
581 | + return -n; | ||
582 | + | ||
583 | + qsort(times, n, sizeof(struct unit_times), compare_unit_times1); | ||
584 | + | ||
585 | + for (int i = 0; i < n; i++) { | ||
586 | + if (times[i].ixt <= 0 || times[i].aet <= 0) | ||
587 | + continue; | ||
588 | + if (times[i].aet <= times[i].ixt) | ||
589 | + continue; | ||
590 | + printf("%6llums %s\n", (times[i].aet - times[i].ixt) / 1000, times[i].name); | ||
591 | + } | ||
592 | + return 0; | ||
593 | +} | ||
594 | +int analyze_time(DBusConnection *bus) | ||
595 | +{ | ||
596 | + unsigned long long firmware_time, loader_time, kernel_time, initrd_time, userspace_time, finish_time; | ||
597 | + | ||
598 | + firmware_time = property_getull(bus, | ||
599 | + "org.freedesktop.systemd1", | ||
600 | + "/org/freedesktop/systemd1", | ||
601 | + "org.freedesktop.systemd1.Manager", | ||
602 | + "FirmwareTimestampMonotonic"); | ||
603 | + loader_time = property_getull(bus, | ||
604 | + "org.freedesktop.systemd1", | ||
605 | + "/org/freedesktop/systemd1", | ||
606 | + "org.freedesktop.systemd1.Manager", | ||
607 | + "LoaderTimestampMonotonic"); | ||
608 | + kernel_time = property_getull(bus, | ||
609 | + "org.freedesktop.systemd1", | ||
610 | + "/org/freedesktop/systemd1", | ||
611 | + "org.freedesktop.systemd1.Manager", | ||
612 | + "KernelTimestamp"); | ||
613 | + initrd_time = property_getull(bus, | ||
614 | + "org.freedesktop.systemd1", | ||
615 | + "/org/freedesktop/systemd1", | ||
616 | + "org.freedesktop.systemd1.Manager", | ||
617 | + "InitRDTimestampMonotonic"); | ||
618 | + userspace_time = property_getull(bus, | ||
619 | + "org.freedesktop.systemd1", | ||
620 | + "/org/freedesktop/systemd1", | ||
621 | + "org.freedesktop.systemd1.Manager", | ||
622 | + "UserspaceTimestampMonotonic"); | ||
623 | + finish_time = property_getull(bus, | ||
624 | + "org.freedesktop.systemd1", | ||
625 | + "/org/freedesktop/systemd1", | ||
626 | + "org.freedesktop.systemd1.Manager", | ||
627 | + "FinishTimestampMonotonic"); | ||
628 | + | ||
629 | + printf("Startup finished in "); | ||
630 | + | ||
631 | + if (firmware_time > 0) | ||
632 | + printf("%llums (firmware) + ", (firmware_time - loader_time) / 1000); | ||
633 | + if (loader_time > 0) | ||
634 | + printf("%llums (loader) + ", loader_time / 1000); | ||
635 | + if (initrd_time > 0) | ||
636 | + printf("%llums (kernel) + %llums (initrd) + ", initrd_time / 1000, (userspace_time - initrd_time) / 1000); | ||
637 | + else if (kernel_time > 0) | ||
638 | + printf("%llums (kernel) + ", userspace_time / 1000); | ||
639 | + | ||
640 | + printf("%llums (userspace) ", (finish_time - userspace_time) / 1000); | ||
641 | + | ||
642 | + if (kernel_time > 0) | ||
643 | + printf("= %llums\n", (firmware_time + finish_time) / 1000); | ||
644 | + else | ||
645 | + printf("= %llums\n", (finish_time - userspace_time) / 1000); | ||
646 | + | ||
647 | + return 0; | ||
648 | +} | ||
649 | + | ||
650 | +void analyze_help() | ||
651 | +{ | ||
652 | + printf("%s [OPTIONS...] {COMMAND} ...\n\n" | ||
653 | + " -h --help Show this help\n" | ||
654 | + " --version Show package version\n" | ||
655 | + " --system Connect to system manager\n" | ||
656 | + " --user Connect to user service manager\n\n" | ||
657 | + "Commands:\n" | ||
658 | + " time\n" | ||
659 | + " blame\n", | ||
660 | + program_invocation_short_name); | ||
661 | + | ||
662 | +} | ||
663 | + | ||
664 | +static int parse_argv(int argc, char *argv[]) | ||
665 | +{ | ||
666 | + enum { | ||
667 | + ARG_VERSION = 0x100, | ||
668 | + ARG_USER, | ||
669 | + ARG_SYSTEM | ||
670 | + }; | ||
671 | + | ||
672 | + static const struct option options[] = { | ||
673 | + { "help", no_argument, NULL, 'h' }, | ||
674 | + { "version", no_argument, NULL, ARG_VERSION }, | ||
675 | + { "user", no_argument, NULL, ARG_USER }, | ||
676 | + { "system", no_argument, NULL, ARG_SYSTEM }, | ||
677 | + { NULL, 0, NULL, 0 } | ||
678 | + }; | ||
679 | + | ||
680 | + int c; | ||
681 | + | ||
682 | + assert(argc >= 0); | ||
683 | + assert(argv); | ||
684 | + | ||
685 | + while ((c = getopt_long(argc, argv, "h", options, NULL)) >= 0) { | ||
686 | + switch (c) { | ||
687 | + case 'h': | ||
688 | + analyze_help(); | ||
689 | + return 0; | ||
690 | + case ARG_VERSION: | ||
691 | + puts(PACKAGE_STRING); | ||
692 | + puts(SYSTEMD_FEATURES); | ||
693 | + return 0; | ||
694 | + case ARG_USER: | ||
695 | + arg_scope = UNIT_FILE_USER; | ||
696 | + break; | ||
697 | + case ARG_SYSTEM: | ||
698 | + arg_scope = UNIT_FILE_SYSTEM; | ||
699 | + break; | ||
700 | + | ||
701 | + case '?': | ||
702 | + return -EINVAL; | ||
703 | + | ||
704 | + default: | ||
705 | + log_error("Unknown option code '%c'.", c); | ||
706 | + return -EINVAL; | ||
707 | + } | ||
708 | + } | ||
709 | + return 1; | ||
710 | +} | ||
711 | + | ||
712 | + | ||
713 | +int main(int argc, char*argv[]) { | ||
714 | + int r, retval = EXIT_FAILURE; | ||
715 | + DBusConnection *bus = NULL; | ||
716 | + DBusError error; | ||
717 | + bool private_bus = false; | ||
718 | + | ||
719 | + dbus_error_init(&error); | ||
720 | + | ||
721 | + setlocale(LC_ALL, ""); | ||
722 | + log_parse_environment(); | ||
723 | + log_open(); | ||
724 | + | ||
725 | + r = parse_argv(argc, argv); | ||
726 | + if (r < 0) | ||
727 | + goto finish; | ||
728 | + else if (r == 0) { | ||
729 | + retval = EXIT_SUCCESS; | ||
730 | + goto finish; | ||
731 | + } | ||
732 | + | ||
733 | + bus_connect(arg_scope == UNIT_FILE_SYSTEM ? DBUS_BUS_SYSTEM : DBUS_BUS_SESSION, &bus, &private_bus, &error); | ||
734 | + | ||
735 | + if (!argv[optind] || streq(argv[optind], "time")) | ||
736 | + retval = analyze_time(bus); | ||
737 | + else if (streq(argv[optind], "blame")) | ||
738 | + retval = analyze_blame(bus); | ||
739 | + else if (streq(argv[optind], "plot")) | ||
740 | + retval = analyze_plot(bus); | ||
741 | + else | ||
742 | + log_error("Unknown operation '%s'.", argv[optind]); | ||
743 | + | ||
744 | +finish: | ||
745 | + if (bus) { | ||
746 | + dbus_connection_flush(bus); | ||
747 | + dbus_connection_close(bus); | ||
748 | + dbus_connection_unref(bus); | ||
749 | + } | ||
750 | + | ||
751 | + dbus_error_free(&error); | ||
752 | + | ||
753 | + return retval; | ||
754 | +} | ||
755 | Index: systemd-197/src/analyze/systemd-analyze.in | ||
756 | =================================================================== | ||
757 | --- systemd-197.orig/src/analyze/systemd-analyze.in 2013-01-07 16:27:01.000000000 -0800 | ||
758 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
759 | @@ -1,328 +0,0 @@ | ||
760 | -#!@PYTHON_BINARY@ | ||
761 | -# -*-python-*- | ||
762 | - | ||
763 | -# This file is part of systemd. | ||
764 | -# | ||
765 | -# Copyright 2010-2013 Lennart Poettering | ||
766 | -# | ||
767 | -# systemd is free software; you can redistribute it and/or modify it | ||
768 | -# under the terms of the GNU Lesser General Public License as published by | ||
769 | -# the Free Software Foundation; either version 2.1 of the License, or | ||
770 | -# (at your option) any later version. | ||
771 | -# | ||
772 | -# systemd is distributed in the hope that it will be useful, but | ||
773 | -# WITHOUT ANY WARRANTY; without even the implied warranty of | ||
774 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
775 | -# Lesser General Public License for more details. | ||
776 | -# | ||
777 | -# You should have received a copy of the GNU Lesser General Public License | ||
778 | -# along with systemd; If not, see <http://www.gnu.org/licenses/>. | ||
779 | - | ||
780 | -import sys, os | ||
781 | -import argparse | ||
782 | -from gi.repository import Gio | ||
783 | -try: | ||
784 | - import cairo | ||
785 | -except ImportError: | ||
786 | - cairo = None | ||
787 | - | ||
788 | -def acquire_time_data(): | ||
789 | - manager = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE, | ||
790 | - None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.systemd1.Manager', None) | ||
791 | - units = manager.ListUnits() | ||
792 | - | ||
793 | - l = [] | ||
794 | - | ||
795 | - for i in units: | ||
796 | - if i[5] != "": | ||
797 | - continue | ||
798 | - | ||
799 | - properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE, | ||
800 | - None, 'org.freedesktop.systemd1', i[6], 'org.freedesktop.DBus.Properties', None) | ||
801 | - | ||
802 | - ixt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveExitTimestampMonotonic') | ||
803 | - aet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveEnterTimestampMonotonic') | ||
804 | - axt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveExitTimestampMonotonic') | ||
805 | - iet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveEnterTimestampMonotonic') | ||
806 | - | ||
807 | - l.append((str(i[0]), ixt, aet, axt, iet)) | ||
808 | - | ||
809 | - return l | ||
810 | - | ||
811 | -def acquire_start_time(): | ||
812 | - properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE, | ||
813 | - None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.DBus.Properties', None) | ||
814 | - | ||
815 | - # Note that the firmware/loader times are returned as positive | ||
816 | - # values but are actually considered negative from the point | ||
817 | - # in time of kernel initialization. Also, the monotonic kernel | ||
818 | - # time will always be 0 since that's the epoch of the | ||
819 | - # monotonic clock. Since we want to know whether the kernel | ||
820 | - # timestamp is set at all we will instead ask for the realtime | ||
821 | - # clock for this timestamp. | ||
822 | - | ||
823 | - firmware_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'FirmwareTimestampMonotonic') | ||
824 | - loader_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'LoaderTimestampMonotonic') | ||
825 | - kernel_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'KernelTimestamp') | ||
826 | - initrd_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'InitRDTimestampMonotonic') | ||
827 | - userspace_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'UserspaceTimestampMonotonic') | ||
828 | - finish_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic') | ||
829 | - | ||
830 | - if finish_time == 0: | ||
831 | - sys.exit("Bootup is not yet finished. Please try again later.") | ||
832 | - | ||
833 | - assert firmware_time >= loader_time | ||
834 | - assert initrd_time <= userspace_time | ||
835 | - assert userspace_time <= finish_time | ||
836 | - | ||
837 | - return firmware_time, loader_time, kernel_time, initrd_time, userspace_time, finish_time | ||
838 | - | ||
839 | -def draw_box(context, j, k, l, m, r = 0, g = 0, b = 0): | ||
840 | - context.save() | ||
841 | - context.set_source_rgb(r, g, b) | ||
842 | - context.rectangle(j, k, l, m) | ||
843 | - context.fill() | ||
844 | - context.restore() | ||
845 | - | ||
846 | -def draw_text(context, x, y, text, size = 12, r = 0, g = 0, b = 0, vcenter = 0.5, hcenter = 0.5): | ||
847 | - context.save() | ||
848 | - | ||
849 | - context.set_source_rgb(r, g, b) | ||
850 | - context.select_font_face("Sans", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL) | ||
851 | - context.set_font_size(size) | ||
852 | - | ||
853 | - if vcenter or hcenter: | ||
854 | - x_bearing, y_bearing, width, height = context.text_extents(text)[:4] | ||
855 | - | ||
856 | - if hcenter: | ||
857 | - x = x - width*hcenter - x_bearing | ||
858 | - | ||
859 | - if vcenter: | ||
860 | - y = y - height*vcenter - y_bearing | ||
861 | - | ||
862 | - context.move_to(x, y) | ||
863 | - context.show_text(text) | ||
864 | - | ||
865 | - context.restore() | ||
866 | - | ||
867 | -def time(): | ||
868 | - | ||
869 | - firmware_time, loader_time, kernel_time, initrd_time, userspace_time, finish_time = acquire_start_time() | ||
870 | - | ||
871 | - sys.stdout.write("Startup finished in ") | ||
872 | - | ||
873 | - if firmware_time > 0: | ||
874 | - sys.stdout.write("%lums (firmware) + " % ((firmware_time - loader_time) / 1000)) | ||
875 | - if loader_time > 0: | ||
876 | - sys.stdout.write("%lums (loader) + " % (loader_time / 1000)) | ||
877 | - if initrd_time > 0: | ||
878 | - sys.stdout.write("%lums (kernel) + %lums (initrd) + " % (initrd_time / 1000, (userspace_time - initrd_time) / 1000)) | ||
879 | - elif kernel_time > 0: | ||
880 | - sys.stdout.write("%lums (kernel) + " % (userspace_time / 1000)) | ||
881 | - | ||
882 | - sys.stdout.write("%lums (userspace) " % ((finish_time - userspace_time) / 1000)) | ||
883 | - | ||
884 | - if kernel_time > 0: | ||
885 | - sys.stdout.write("= %lums\n" % ((firmware_time + finish_time) / 1000)) | ||
886 | - else: | ||
887 | - sys.stdout.write("= %lums\n" % ((finish_time - userspace_time) / 1000)) | ||
888 | - | ||
889 | -def blame(): | ||
890 | - | ||
891 | - data = acquire_time_data() | ||
892 | - s = sorted(data, key = lambda i: i[2] - i[1], reverse = True) | ||
893 | - | ||
894 | - for name, ixt, aet, axt, iet in s: | ||
895 | - | ||
896 | - if ixt <= 0 or aet <= 0: | ||
897 | - continue | ||
898 | - | ||
899 | - if aet <= ixt: | ||
900 | - continue | ||
901 | - | ||
902 | - sys.stdout.write("%6lums %s\n" % ((aet - ixt) / 1000, name)) | ||
903 | - | ||
904 | -def plot(): | ||
905 | - if cairo is None: | ||
906 | - sys.exit("Failed to initilize python-cairo required for 'plot' verb.") | ||
907 | - firmware_time, loader_time, kernel_time, initrd_time, userspace_time, finish_time = acquire_start_time() | ||
908 | - data = acquire_time_data() | ||
909 | - s = sorted(data, key = lambda i: i[1]) | ||
910 | - | ||
911 | - # Account for kernel and initramfs bars if they exist | ||
912 | - if initrd_time > 0: | ||
913 | - count = 3 | ||
914 | - else: | ||
915 | - count = 2 | ||
916 | - | ||
917 | - for name, ixt, aet, axt, iet in s: | ||
918 | - | ||
919 | - if (ixt >= userspace_time and ixt <= finish_time) or \ | ||
920 | - (aet >= userspace_time and aet <= finish_time) or \ | ||
921 | - (axt >= userspace_time and axt <= finish_time): | ||
922 | - count += 1 | ||
923 | - | ||
924 | - border = 100 | ||
925 | - bar_height = 20 | ||
926 | - bar_space = bar_height * 0.1 | ||
927 | - | ||
928 | - # 1000px = 10s, 1px = 10ms | ||
929 | - width = finish_time/10000 + border*2 | ||
930 | - height = count * (bar_height + bar_space) + border * 2 | ||
931 | - | ||
932 | - if width < 1000: | ||
933 | - width = 1000 | ||
934 | - | ||
935 | - surface = cairo.SVGSurface(sys.stdout, width, height) | ||
936 | - context = cairo.Context(surface) | ||
937 | - | ||
938 | - draw_box(context, 0, 0, width, height, 1, 1, 1) | ||
939 | - | ||
940 | - context.translate(border + 0.5, border + 0.5) | ||
941 | - | ||
942 | - context.save() | ||
943 | - context.set_line_width(1) | ||
944 | - context.set_source_rgb(0.7, 0.7, 0.7) | ||
945 | - | ||
946 | - for x in range(0, int(finish_time/10000) + 100, 100): | ||
947 | - context.move_to(x, 0) | ||
948 | - context.line_to(x, height-border*2) | ||
949 | - | ||
950 | - context.move_to(0, 0) | ||
951 | - context.line_to(width-border*2, 0) | ||
952 | - | ||
953 | - context.move_to(0, height-border*2) | ||
954 | - context.line_to(width-border*2, height-border*2) | ||
955 | - | ||
956 | - context.stroke() | ||
957 | - context.restore() | ||
958 | - | ||
959 | - osrel = "Linux" | ||
960 | - if os.path.exists("/etc/os-release"): | ||
961 | - for line in open("/etc/os-release"): | ||
962 | - if line.startswith('PRETTY_NAME='): | ||
963 | - osrel = line[12:] | ||
964 | - osrel = osrel.strip('\"\n') | ||
965 | - break | ||
966 | - | ||
967 | - banner = "{} {} ({} {}) {}".format(osrel, *(os.uname()[1:5])) | ||
968 | - draw_text(context, 0, -15, banner, hcenter = 0, vcenter = 1) | ||
969 | - | ||
970 | - for x in range(0, int(finish_time/10000) + 100, 100): | ||
971 | - draw_text(context, x, -5, "%lus" % (x/100), vcenter = 0, hcenter = 0) | ||
972 | - | ||
973 | - y = 0 | ||
974 | - | ||
975 | - # draw boxes for kernel and initramfs boot time | ||
976 | - if initrd_time > 0: | ||
977 | - draw_box(context, 0, y, initrd_time/10000, bar_height, 0.7, 0.7, 0.7) | ||
978 | - draw_text(context, 10, y + bar_height/2, "kernel", hcenter = 0) | ||
979 | - y += bar_height + bar_space | ||
980 | - | ||
981 | - draw_box(context, initrd_time/10000, y, userspace_time/10000-initrd_time/10000, bar_height, 0.7, 0.7, 0.7) | ||
982 | - draw_text(context, initrd_time/10000 + 10, y + bar_height/2, "initramfs", hcenter = 0) | ||
983 | - y += bar_height + bar_space | ||
984 | - | ||
985 | - else: | ||
986 | - draw_box(context, 0, y, userspace_time/10000, bar_height, 0.6, 0.6, 0.6) | ||
987 | - draw_text(context, 10, y + bar_height/2, "kernel", hcenter = 0) | ||
988 | - y += bar_height + bar_space | ||
989 | - | ||
990 | - draw_box(context, userspace_time/10000, y, finish_time/10000-userspace_time/10000, bar_height, 0.7, 0.7, 0.7) | ||
991 | - draw_text(context, userspace_time/10000 + 10, y + bar_height/2, "userspace", hcenter = 0) | ||
992 | - y += bar_height + bar_space | ||
993 | - | ||
994 | - for name, ixt, aet, axt, iet in s: | ||
995 | - | ||
996 | - drawn = False | ||
997 | - left = -1 | ||
998 | - | ||
999 | - if ixt >= userspace_time and ixt <= finish_time: | ||
1000 | - | ||
1001 | - # Activating | ||
1002 | - a = ixt | ||
1003 | - b = min(filter(lambda x: x >= ixt, (aet, axt, iet, finish_time))) - ixt | ||
1004 | - | ||
1005 | - draw_box(context, a/10000, y, b/10000, bar_height, 1, 0, 0) | ||
1006 | - drawn = True | ||
1007 | - | ||
1008 | - if left < 0: | ||
1009 | - left = a | ||
1010 | - | ||
1011 | - if aet >= userspace_time and aet <= finish_time: | ||
1012 | - | ||
1013 | - # Active | ||
1014 | - a = aet | ||
1015 | - b = min(filter(lambda x: x >= aet, (axt, iet, finish_time))) - aet | ||
1016 | - | ||
1017 | - draw_box(context, a/10000, y, b/10000, bar_height, .8, .6, .6) | ||
1018 | - drawn = True | ||
1019 | - | ||
1020 | - if left < 0: | ||
1021 | - left = a | ||
1022 | - | ||
1023 | - if axt >= userspace_time and axt <= finish_time: | ||
1024 | - | ||
1025 | - # Deactivating | ||
1026 | - a = axt | ||
1027 | - b = min(filter(lambda x: x >= axt, (iet, finish_time))) - axt | ||
1028 | - | ||
1029 | - draw_box(context, a/10000, y, b/10000, bar_height, .6, .4, .4) | ||
1030 | - drawn = True | ||
1031 | - | ||
1032 | - if left < 0: | ||
1033 | - left = a | ||
1034 | - | ||
1035 | - if drawn: | ||
1036 | - x = left/10000 | ||
1037 | - | ||
1038 | - if x < width/2-border: | ||
1039 | - draw_text(context, x + 10, y + bar_height/2, name, hcenter = 0) | ||
1040 | - else: | ||
1041 | - draw_text(context, x - 10, y + bar_height/2, name, hcenter = 1) | ||
1042 | - | ||
1043 | - y += bar_height + bar_space | ||
1044 | - | ||
1045 | - draw_text(context, 0, height-border*2, "Legend: Red = Activating; Pink = Active; Dark Pink = Deactivating", hcenter = 0, vcenter = -1) | ||
1046 | - | ||
1047 | - if initrd_time > 0: | ||
1048 | - draw_text(context, 0, height-border*2 + bar_height, "Startup finished in %lums (kernel) + %lums (initramfs) + %lums (userspace) = %lums" % ( \ | ||
1049 | - initrd_time/1000, \ | ||
1050 | - (userspace_time - initrd_time)/1000, \ | ||
1051 | - (finish_time - userspace_time)/1000, \ | ||
1052 | - finish_time/1000), hcenter = 0, vcenter = -1) | ||
1053 | - else: | ||
1054 | - draw_text(context, 0, height-border*2 + bar_height, "Startup finished in %lums (kernel) + %lums (userspace) = %lums" % ( \ | ||
1055 | - userspace_time/1000, \ | ||
1056 | - (finish_time - userspace_time)/1000, \ | ||
1057 | - finish_time/1000), hcenter = 0, vcenter = -1) | ||
1058 | - | ||
1059 | - surface.finish() | ||
1060 | - | ||
1061 | -parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter, | ||
1062 | - version='systemd-analyze @PACKAGE_VERSION@', | ||
1063 | - description='Process systemd profiling information', | ||
1064 | - epilog='''\ | ||
1065 | -time - print time spent in the kernel before reaching userspace | ||
1066 | -blame - print list of running units ordered by time to init | ||
1067 | -plot - output SVG graphic showing service initialization | ||
1068 | -''') | ||
1069 | - | ||
1070 | -parser.add_argument('action', choices=('time', 'blame', 'plot'), | ||
1071 | - default='time', nargs='?', | ||
1072 | - help='action to perform (default: time)') | ||
1073 | -parser.add_argument('--user', action='store_true', | ||
1074 | - help='use the session bus') | ||
1075 | - | ||
1076 | -args = parser.parse_args() | ||
1077 | - | ||
1078 | -if args.user: | ||
1079 | - bus = Gio.BusType.SESSION | ||
1080 | -else: | ||
1081 | - bus = Gio.BusType.SYSTEM | ||
1082 | - | ||
1083 | -verb = {'time' : time, | ||
1084 | - 'blame': blame, | ||
1085 | - 'plot' : plot, | ||
1086 | - } | ||
1087 | -verb.get(args.action)() | ||
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch index aa186bda72..8d1aa7d11a 100644 --- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch | |||
@@ -1,20 +1,20 @@ | |||
1 | Upstream-Status: Denied [no desire for uclibc support] | 1 | Upstream-Status: Denied [no desire for uclibc support] |
2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | 2 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
3 | 3 | ||
4 | Index: systemd-196/src/fsck/fsck.c | 4 | Index: systemd-198/src/fsck/fsck.c |
5 | =================================================================== | 5 | =================================================================== |
6 | --- systemd-196.orig/src/fsck/fsck.c 2012-07-26 03:45:14.000000000 -0700 | 6 | --- systemd-198.orig/src/fsck/fsck.c 2013-03-07 13:18:34.000000000 -0800 |
7 | +++ systemd-196/src/fsck/fsck.c 2013-01-21 16:10:46.807537608 -0800 | 7 | +++ systemd-198/src/fsck/fsck.c 2013-03-09 14:49:03.756572873 -0800 |
8 | @@ -36,6 +36,8 @@ | 8 | @@ -37,6 +37,8 @@ |
9 | #include "bus-errors.h" | ||
10 | #include "virt.h" | 9 | #include "virt.h" |
10 | #include "fileio.h" | ||
11 | 11 | ||
12 | +#include "config.h" | 12 | +#include "config.h" |
13 | + | 13 | + |
14 | static bool arg_skip = false; | 14 | static bool arg_skip = false; |
15 | static bool arg_force = false; | 15 | static bool arg_force = false; |
16 | static bool arg_show_progress = false; | 16 | static bool arg_show_progress = false; |
17 | @@ -193,9 +195,16 @@ | 17 | @@ -203,9 +205,16 @@ |
18 | char *device; | 18 | char *device; |
19 | double p; | 19 | double p; |
20 | usec_t t; | 20 | usec_t t; |
@@ -33,10 +33,10 @@ Index: systemd-196/src/fsck/fsck.c | |||
33 | 33 | ||
34 | /* Only show one progress counter at max */ | 34 | /* Only show one progress counter at max */ |
35 | if (!locked) { | 35 | if (!locked) { |
36 | Index: systemd-196/src/core/swap.c | 36 | Index: systemd-198/src/core/swap.c |
37 | =================================================================== | 37 | =================================================================== |
38 | --- systemd-196.orig/src/core/swap.c 2012-10-29 19:40:42.000000000 -0700 | 38 | --- systemd-198.orig/src/core/swap.c 2013-03-07 13:18:34.000000000 -0800 |
39 | +++ systemd-196/src/core/swap.c 2013-01-21 16:15:11.751544181 -0800 | 39 | +++ systemd-198/src/core/swap.c 2013-03-09 14:49:03.756572873 -0800 |
40 | @@ -41,6 +41,8 @@ | 40 | @@ -41,6 +41,8 @@ |
41 | #include "path-util.h" | 41 | #include "path-util.h" |
42 | #include "virt.h" | 42 | #include "virt.h" |
@@ -46,7 +46,7 @@ Index: systemd-196/src/core/swap.c | |||
46 | static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = { | 46 | static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = { |
47 | [SWAP_DEAD] = UNIT_INACTIVE, | 47 | [SWAP_DEAD] = UNIT_INACTIVE, |
48 | [SWAP_ACTIVATING] = UNIT_ACTIVATING, | 48 | [SWAP_ACTIVATING] = UNIT_ACTIVATING, |
49 | @@ -1059,6 +1061,7 @@ | 49 | @@ -1037,6 +1039,7 @@ |
50 | char *dev = NULL, *d; | 50 | char *dev = NULL, *d; |
51 | int prio = 0, k; | 51 | int prio = 0, k; |
52 | 52 | ||
@@ -54,7 +54,7 @@ Index: systemd-196/src/core/swap.c | |||
54 | k = fscanf(m->proc_swaps, | 54 | k = fscanf(m->proc_swaps, |
55 | "%ms " /* device/file */ | 55 | "%ms " /* device/file */ |
56 | "%*s " /* type of swap */ | 56 | "%*s " /* type of swap */ |
57 | @@ -1066,6 +1069,16 @@ | 57 | @@ -1044,6 +1047,16 @@ |
58 | "%*s " /* used */ | 58 | "%*s " /* used */ |
59 | "%i\n", /* priority */ | 59 | "%i\n", /* priority */ |
60 | &dev, &prio); | 60 | &dev, &prio); |
@@ -71,10 +71,10 @@ Index: systemd-196/src/core/swap.c | |||
71 | if (k != 2) { | 71 | if (k != 2) { |
72 | if (k == EOF) | 72 | if (k == EOF) |
73 | break; | 73 | break; |
74 | Index: systemd-196/src/core/mount-setup.c | 74 | Index: systemd-198/src/core/mount-setup.c |
75 | =================================================================== | 75 | =================================================================== |
76 | --- systemd-196.orig/src/core/mount-setup.c 2012-11-09 06:55:35.000000000 -0800 | 76 | --- systemd-198.orig/src/core/mount-setup.c 2013-03-07 13:18:34.000000000 -0800 |
77 | +++ systemd-196/src/core/mount-setup.c 2013-01-21 16:10:46.807537608 -0800 | 77 | +++ systemd-198/src/core/mount-setup.c 2013-03-09 14:49:03.760572872 -0800 |
78 | @@ -28,6 +28,7 @@ | 78 | @@ -28,6 +28,7 @@ |
79 | #include <assert.h> | 79 | #include <assert.h> |
80 | #include <unistd.h> | 80 | #include <unistd.h> |
@@ -83,16 +83,16 @@ Index: systemd-196/src/core/mount-setup.c | |||
83 | 83 | ||
84 | #include "mount-setup.h" | 84 | #include "mount-setup.h" |
85 | #include "dev-setup.h" | 85 | #include "dev-setup.h" |
86 | @@ -42,6 +43,8 @@ | 86 | @@ -43,6 +44,8 @@ |
87 | #include "missing.h" | ||
88 | #include "virt.h" | 87 | #include "virt.h" |
88 | #include "efivars.h" | ||
89 | 89 | ||
90 | +#include "config.h" | 90 | +#include "config.h" |
91 | + | 91 | + |
92 | #ifndef TTY_GID | 92 | #ifndef TTY_GID |
93 | #define TTY_GID 5 | 93 | #define TTY_GID 5 |
94 | #endif | 94 | #endif |
95 | @@ -224,9 +227,12 @@ | 95 | @@ -231,9 +234,12 @@ |
96 | for (;;) { | 96 | for (;;) { |
97 | char *controller; | 97 | char *controller; |
98 | int enabled = 0; | 98 | int enabled = 0; |
@@ -107,11 +107,11 @@ Index: systemd-196/src/core/mount-setup.c | |||
107 | if (feof(f)) | 107 | if (feof(f)) |
108 | break; | 108 | break; |
109 | 109 | ||
110 | Index: systemd-196/src/core/mount.c | 110 | Index: systemd-198/src/core/mount.c |
111 | =================================================================== | 111 | =================================================================== |
112 | --- systemd-196.orig/src/core/mount.c 2012-10-22 16:53:02.000000000 -0700 | 112 | --- systemd-198.orig/src/core/mount.c 2013-03-07 13:18:34.000000000 -0800 |
113 | +++ systemd-196/src/core/mount.c 2013-01-21 16:10:46.811537609 -0800 | 113 | +++ systemd-198/src/core/mount.c 2013-03-09 14:49:03.760572872 -0800 |
114 | @@ -41,6 +41,8 @@ | 114 | @@ -42,6 +42,8 @@ |
115 | #include "exit-status.h" | 115 | #include "exit-status.h" |
116 | #include "def.h" | 116 | #include "def.h" |
117 | 117 | ||
@@ -120,7 +120,7 @@ Index: systemd-196/src/core/mount.c | |||
120 | static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = { | 120 | static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = { |
121 | [MOUNT_DEAD] = UNIT_INACTIVE, | 121 | [MOUNT_DEAD] = UNIT_INACTIVE, |
122 | [MOUNT_MOUNTING] = UNIT_ACTIVATING, | 122 | [MOUNT_MOUNTING] = UNIT_ACTIVATING, |
123 | @@ -1538,7 +1540,7 @@ | 123 | @@ -1584,7 +1586,7 @@ |
124 | int k; | 124 | int k; |
125 | 125 | ||
126 | device = path = options = options2 = fstype = d = p = o = NULL; | 126 | device = path = options = options2 = fstype = d = p = o = NULL; |
@@ -129,7 +129,7 @@ Index: systemd-196/src/core/mount.c | |||
129 | if ((k = fscanf(m->proc_self_mountinfo, | 129 | if ((k = fscanf(m->proc_self_mountinfo, |
130 | "%*s " /* (1) mount id */ | 130 | "%*s " /* (1) mount id */ |
131 | "%*s " /* (2) parent id */ | 131 | "%*s " /* (2) parent id */ |
132 | @@ -1557,7 +1559,31 @@ | 132 | @@ -1603,7 +1605,31 @@ |
133 | &fstype, | 133 | &fstype, |
134 | &device, | 134 | &device, |
135 | &options2)) != 5) { | 135 | &options2)) != 5) { |
@@ -162,10 +162,10 @@ Index: systemd-196/src/core/mount.c | |||
162 | if (k == EOF) | 162 | if (k == EOF) |
163 | break; | 163 | break; |
164 | 164 | ||
165 | Index: systemd-196/src/core/umount.c | 165 | Index: systemd-198/src/core/umount.c |
166 | =================================================================== | 166 | =================================================================== |
167 | --- systemd-196.orig/src/core/umount.c 2012-11-16 09:32:41.000000000 -0800 | 167 | --- systemd-198.orig/src/core/umount.c 2013-03-07 13:18:34.000000000 -0800 |
168 | +++ systemd-196/src/core/umount.c 2013-01-21 16:10:46.811537609 -0800 | 168 | +++ systemd-198/src/core/umount.c 2013-03-09 14:49:03.760572872 -0800 |
169 | @@ -36,6 +36,8 @@ | 169 | @@ -36,6 +36,8 @@ |
170 | #include "util.h" | 170 | #include "util.h" |
171 | #include "virt.h" | 171 | #include "virt.h" |
@@ -235,20 +235,20 @@ Index: systemd-196/src/core/umount.c | |||
235 | if (k == EOF) | 235 | if (k == EOF) |
236 | break; | 236 | break; |
237 | 237 | ||
238 | Index: systemd-196/src/shared/socket-util.c | 238 | Index: systemd-198/src/shared/socket-util.c |
239 | =================================================================== | 239 | =================================================================== |
240 | --- systemd-196.orig/src/shared/socket-util.c 2012-11-14 13:21:15.000000000 -0800 | 240 | --- systemd-198.orig/src/shared/socket-util.c 2013-03-07 13:18:34.000000000 -0800 |
241 | +++ systemd-196/src/shared/socket-util.c 2013-01-21 16:10:46.811537609 -0800 | 241 | +++ systemd-198/src/shared/socket-util.c 2013-03-09 14:49:03.760572872 -0800 |
242 | @@ -39,6 +39,8 @@ | 242 | @@ -40,6 +40,8 @@ |
243 | #include "socket-util.h" | ||
244 | #include "missing.h" | 243 | #include "missing.h" |
244 | #include "fileio.h" | ||
245 | 245 | ||
246 | +#include "config.h" | 246 | +#include "config.h" |
247 | + | 247 | + |
248 | int socket_address_parse(SocketAddress *a, const char *s) { | 248 | int socket_address_parse(SocketAddress *a, const char *s) { |
249 | int r; | 249 | int r; |
250 | char *e, *n; | 250 | char *e, *n; |
251 | @@ -202,8 +204,16 @@ | 251 | @@ -203,8 +205,16 @@ |
252 | a->type = SOCK_RAW; | 252 | a->type = SOCK_RAW; |
253 | 253 | ||
254 | errno = 0; | 254 | errno = 0; |
@@ -266,10 +266,10 @@ Index: systemd-196/src/shared/socket-util.c | |||
266 | 266 | ||
267 | family = netlink_family_from_string(sfamily); | 267 | family = netlink_family_from_string(sfamily); |
268 | if (family < 0) | 268 | if (family < 0) |
269 | Index: systemd-196/src/tmpfiles/tmpfiles.c | 269 | Index: systemd-198/src/tmpfiles/tmpfiles.c |
270 | =================================================================== | 270 | =================================================================== |
271 | --- systemd-196.orig/src/tmpfiles/tmpfiles.c 2012-10-23 16:06:30.000000000 -0700 | 271 | --- systemd-198.orig/src/tmpfiles/tmpfiles.c 2013-03-07 13:18:34.000000000 -0800 |
272 | +++ systemd-196/src/tmpfiles/tmpfiles.c 2013-01-21 16:10:46.811537609 -0800 | 272 | +++ systemd-198/src/tmpfiles/tmpfiles.c 2013-03-09 14:55:40.772566599 -0800 |
273 | @@ -51,6 +51,8 @@ | 273 | @@ -51,6 +51,8 @@ |
274 | #include "conf-files.h" | 274 | #include "conf-files.h" |
275 | #include "capability.h" | 275 | #include "capability.h" |
@@ -279,26 +279,25 @@ Index: systemd-196/src/tmpfiles/tmpfiles.c | |||
279 | /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates | 279 | /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates |
280 | * them in the file system. This is intended to be used to create | 280 | * them in the file system. This is intended to be used to create |
281 | * properly owned directories beneath /tmp, /var/tmp, /run, which are | 281 | * properly owned directories beneath /tmp, /var/tmp, /run, which are |
282 | @@ -990,7 +992,7 @@ | 282 | @@ -993,6 +995,7 @@ |
283 | i = new0(Item, 1); | ||
284 | if (!i) | 283 | if (!i) |
285 | return log_oom(); | 284 | return log_oom(); |
286 | - | 285 | |
287 | +#ifdef HAVE_MSFORMAT | 286 | +#ifdef HAVE_MSFORMAT |
288 | if (sscanf(buffer, | 287 | r = sscanf(buffer, |
289 | "%c " | 288 | "%c %ms %ms %ms %ms %ms %n", |
290 | "%ms " | 289 | &type, |
291 | @@ -1006,6 +1008,28 @@ | 290 | @@ -1002,6 +1005,29 @@ |
292 | &group, | 291 | &group, |
293 | &age, | 292 | &age, |
294 | &n) < 2) { | 293 | &n); |
295 | +#else | 294 | +#else |
296 | + i->path = malloc(257); | 295 | + i->path = malloc(257); |
297 | + mode = malloc(257); | 296 | + mode = malloc(257); |
298 | + user = malloc(257); | 297 | + user = malloc(257); |
299 | + group = malloc(257); | 298 | + group = malloc(257); |
300 | + age = malloc(257); | 299 | + age = malloc(257); |
301 | + if (sscanf(buffer, | 300 | + r = sscanf(buffer, |
302 | + "%c " | 301 | + "%c " |
303 | + "%256s " | 302 | + "%256s " |
304 | + "%256s " | 303 | + "%256s " |
@@ -312,38 +311,39 @@ Index: systemd-196/src/tmpfiles/tmpfiles.c | |||
312 | + user, | 311 | + user, |
313 | + group, | 312 | + group, |
314 | + age, | 313 | + age, |
315 | + &n) < 2) { | 314 | + &n); |
316 | +#endif /* HAVE_MSFORMAT */ | 315 | +#endif /* HAVE_MSFORMAT */ |
316 | + | ||
317 | if (r < 2) { | ||
317 | log_error("[%s:%u] Syntax error.", fname, line); | 318 | log_error("[%s:%u] Syntax error.", fname, line); |
318 | r = -EIO; | 319 | r = -EIO; |
319 | goto finish; | 320 | Index: systemd-198/src/cryptsetup/cryptsetup-generator.c |
320 | Index: systemd-196/src/cryptsetup/cryptsetup-generator.c | ||
321 | =================================================================== | 321 | =================================================================== |
322 | --- systemd-196.orig/src/cryptsetup/cryptsetup-generator.c 2012-08-08 14:53:24.000000000 -0700 | 322 | --- systemd-198.orig/src/cryptsetup/cryptsetup-generator.c 2013-03-07 13:18:34.000000000 -0800 |
323 | +++ systemd-196/src/cryptsetup/cryptsetup-generator.c 2013-01-21 16:10:46.811537609 -0800 | 323 | +++ systemd-198/src/cryptsetup/cryptsetup-generator.c 2013-03-09 14:51:33.080571639 -0800 |
324 | @@ -30,6 +30,8 @@ | 324 | @@ -31,6 +31,8 @@ |
325 | #include "virt.h" | ||
326 | #include "strv.h" | 325 | #include "strv.h" |
326 | #include "fileio.h" | ||
327 | 327 | ||
328 | +#include "config.h" | 328 | +#include "config.h" |
329 | + | 329 | + |
330 | static const char *arg_dest = "/tmp"; | 330 | static const char *arg_dest = "/tmp"; |
331 | static bool arg_enabled = true; | 331 | static bool arg_enabled = true; |
332 | static bool arg_read_crypttab = true; | 332 | static bool arg_read_crypttab = true; |
333 | @@ -421,8 +423,15 @@ | 333 | @@ -395,7 +397,16 @@ |
334 | l = strstrip(line); | 334 | if (*l == '#' || *l == 0) |
335 | if (*l == '#' || *l == 0) | 335 | continue; |
336 | continue; | 336 | |
337 | - | ||
338 | +#ifdef HAVE_MSFORMAT | 337 | +#ifdef HAVE_MSFORMAT |
339 | k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options); | 338 | k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options); |
340 | +#else | 339 | +#else |
341 | + name = malloc(257); | 340 | + name = malloc(257); |
342 | + device = malloc(257); | 341 | + device = malloc(257); |
343 | + password = malloc(257); | 342 | + password = malloc(257); |
344 | + options = malloc(257); | 343 | + options = malloc(257); |
345 | + k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options); | 344 | + k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options); |
346 | +#endif /* HAVE_MSFORMAT */ | 345 | +#endif /* HAVE_MSFORMAT */ |
347 | if (k < 2 || k > 4) { | 346 | + |
348 | log_error("Failed to parse /etc/crypttab:%u, ignoring.", n); | 347 | if (k < 2 || k > 4) { |
349 | r = EXIT_FAILURE; | 348 | log_error("Failed to parse /etc/crypttab:%u, ignoring.", n); |
349 | r = EXIT_FAILURE; | ||
diff --git a/meta/recipes-core/systemd/systemd/udev-linkage.patch b/meta/recipes-core/systemd/systemd/udev-linkage.patch deleted file mode 100644 index a0d9b4c876..0000000000 --- a/meta/recipes-core/systemd/systemd/udev-linkage.patch +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | Don't cause libudev to link against libsystemd-daemon. | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
5 | |||
6 | From 8ee37c2bed1d452d566abf85b0cdf732b7ca029a Mon Sep 17 00:00:00 2001 | ||
7 | From: Kay Sievers <kay@vrfy.org> | ||
8 | Date: Thu, 7 Feb 2013 13:47:46 +0100 | ||
9 | Subject: [PATCH] build-sys: at least for now, never link libudev against | ||
10 | systemd's shared libraries | ||
11 | |||
12 | --- | ||
13 | Makefile.am | 12 +++++++++--- | ||
14 | 1 file changed, 9 insertions(+), 3 deletions(-) | ||
15 | |||
16 | diff --git a/Makefile.am b/Makefile.am | ||
17 | index 474110a..0e6c88f 100644 | ||
18 | --- a/Makefile.am | ||
19 | +++ b/Makefile.am | ||
20 | @@ -811,8 +811,6 @@ libsystemd_shared_la_SOURCES = \ | ||
21 | src/shared/calendarspec.c \ | ||
22 | src/shared/calendarspec.h | ||
23 | |||
24 | -libsystemd_shared_la_LIBADD = libsystemd-daemon.la | ||
25 | - | ||
26 | #------------------------------------------------------------------------------- | ||
27 | noinst_LTLIBRARIES += \ | ||
28 | libsystemd-dbus.la | ||
29 | @@ -1662,6 +1660,9 @@ systemd_tty_ask_password_agent_LDADD = \ | ||
30 | libsystemd_daemon_la_SOURCES = \ | ||
31 | src/libsystemd-daemon/sd-daemon.c | ||
32 | |||
33 | +libsystemd_daemon_internal_la_SOURCES = \ | ||
34 | + $(libsystemd_daemon_la_SOURCES) | ||
35 | + | ||
36 | libsystemd_daemon_la_CFLAGS = \ | ||
37 | $(AM_CFLAGS) \ | ||
38 | -fvisibility=hidden \ | ||
39 | @@ -1689,6 +1690,9 @@ UNINSTALL_EXEC_HOOKS += libsystemd-daemon-uninstall-hook | ||
40 | lib_LTLIBRARIES += \ | ||
41 | libsystemd-daemon.la | ||
42 | |||
43 | +noinst_LTLIBRARIES += \ | ||
44 | + libsystemd-daemon-internal.la | ||
45 | + | ||
46 | pkgconfiglib_DATA += \ | ||
47 | src/libsystemd-daemon/libsystemd-daemon.pc | ||
48 | |||
49 | @@ -1768,7 +1772,9 @@ libudev_la_LDFLAGS = \ | ||
50 | -Wl,--version-script=$(top_srcdir)/src/libudev/libudev.sym | ||
51 | |||
52 | libudev_la_LIBADD = \ | ||
53 | - libsystemd-shared.la | ||
54 | + libsystemd-shared.la \ | ||
55 | + libsystemd-daemon-internal.la \ | ||
56 | + libsystemd-id128-internal.la | ||
57 | |||
58 | pkgconfiglib_DATA += \ | ||
59 | src/libudev/libudev.pc | ||
60 | -- | ||
61 | 1.7.10.4 | ||
62 | |||
diff --git a/meta/recipes-core/systemd/systemd_197.bb b/meta/recipes-core/systemd/systemd_198.bb index 5ba3a2348a..6a8db512ca 100644 --- a/meta/recipes-core/systemd/systemd_197.bb +++ b/meta/recipes-core/systemd/systemd_198.bb | |||
@@ -9,7 +9,6 @@ LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ | |||
9 | PROVIDES = "udev" | 9 | PROVIDES = "udev" |
10 | 10 | ||
11 | PE = "1" | 11 | PE = "1" |
12 | PR = "r4" | ||
13 | 12 | ||
14 | DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0" | 13 | DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers glib-2.0" |
15 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | 14 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" |
@@ -24,12 +23,10 @@ SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \ | |||
24 | file://var-run.conf \ | 23 | file://var-run.conf \ |
25 | ${UCLIBCPATCHES} \ | 24 | ${UCLIBCPATCHES} \ |
26 | file://00-create-volatile.conf \ | 25 | file://00-create-volatile.conf \ |
27 | file://0001-systemd-analyze-rewrite-in-C.patch \ | ||
28 | file://udev-linkage.patch \ | ||
29 | file://init \ | 26 | file://init \ |
30 | " | 27 | " |
31 | SRC_URI[md5sum] = "56a860dceadfafe59f40141eb5223743" | 28 | SRC_URI[md5sum] = "26a75e2a310f8c1c1ea9ec26ddb171c5" |
32 | SRC_URI[sha256sum] = "e6857ea21ae24d7056e7b0f4c2aaaba73b8bf57025b8949c0a8af0c1bc9774b5" | 29 | SRC_URI[sha256sum] = "444492355e5ff0ad99e0691ecaff1081ee8d45901580f47ba8b74e56107c71bf" |
33 | 30 | ||
34 | UCLIBCPATCHES = "" | 31 | UCLIBCPATCHES = "" |
35 | UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \ | 32 | UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \ |
@@ -138,6 +135,7 @@ CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ | |||
138 | ${sysconfdir}/systemd/user.conf" | 135 | ${sysconfdir}/systemd/user.conf" |
139 | 136 | ||
140 | FILES_${PN} = " ${base_bindir}/* \ | 137 | FILES_${PN} = " ${base_bindir}/* \ |
138 | ${datadir}/bash-completion \ | ||
141 | ${datadir}/dbus-1/services \ | 139 | ${datadir}/dbus-1/services \ |
142 | ${datadir}/dbus-1/system-services \ | 140 | ${datadir}/dbus-1/system-services \ |
143 | ${datadir}/polkit-1 \ | 141 | ${datadir}/polkit-1 \ |
@@ -162,6 +160,8 @@ FILES_${PN} = " ${base_bindir}/* \ | |||
162 | ${bindir}/localectl \ | 160 | ${bindir}/localectl \ |
163 | ${bindir}/hostnamectl \ | 161 | ${bindir}/hostnamectl \ |
164 | ${bindir}/timedatectl \ | 162 | ${bindir}/timedatectl \ |
163 | ${bindir}/bootctl \ | ||
164 | ${bindir}/kernel-install \ | ||
165 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ | 165 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ |
166 | ${exec_prefix}/lib/systemd \ | 166 | ${exec_prefix}/lib/systemd \ |
167 | ${exec_prefix}/lib/binfmt.d \ | 167 | ${exec_prefix}/lib/binfmt.d \ |