diff options
author | Khem Raj <raj.khem@gmail.com> | 2012-09-03 16:55:05 +0000 |
---|---|---|
committer | Koen Kooi <koen@dominion.thruhere.net> | 2012-09-08 11:36:53 +0200 |
commit | 008ad8750226733c3e771565d8c60089cb1108ab (patch) | |
tree | c4c11d94aff7772592a3f53a9f71ea1a051c0ff1 | |
parent | 8d87ca7f803d053e2cdc1f6322581e7852af01fa (diff) | |
download | meta-openembedded-008ad8750226733c3e771565d8c60089cb1108ab.tar.gz |
systemd: Upgrade to 189
Fix running and building on uclibc
Currently it doesnt work on uclibc-git
only on 0.9.33 but thats a regression in
uclibc most likely
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
10 files changed, 682 insertions, 435 deletions
diff --git a/meta-systemd/recipes-core/systemd/systemd/format-replace-m-uclibc.patch b/meta-systemd/recipes-core/systemd/systemd/format-replace-m-uclibc.patch deleted file mode 100644 index a2885fa2c..000000000 --- a/meta-systemd/recipes-core/systemd/systemd/format-replace-m-uclibc.patch +++ /dev/null | |||
@@ -1,381 +0,0 @@ | |||
1 | Patch from Henning. %m is a glibc only thing. For uclibc we need to do it | ||
2 | differently. So we use static strings instead of mallocing them and free'ing | ||
3 | |||
4 | I dont know if upstream systemd have plans to make systemd work on non | ||
5 | glibc system libraries if not then this patch would not make sense for | ||
6 | upstream | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | |||
10 | Index: git/src/mount-setup.c | ||
11 | =================================================================== | ||
12 | --- git.orig/src/mount-setup.c 2012-06-23 17:48:06.153735209 -0700 | ||
13 | +++ git/src/mount-setup.c 2012-06-23 17:48:07.109735255 -0700 | ||
14 | @@ -184,10 +184,10 @@ | ||
15 | (void) fgets(buf, sizeof(buf), f); | ||
16 | |||
17 | for (;;) { | ||
18 | - char *controller; | ||
19 | + char controller[30]; | ||
20 | int enabled = 0; | ||
21 | |||
22 | - if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) { | ||
23 | + if (fscanf(f, "%s %*i %*i %i", controller, &enabled) != 2) { | ||
24 | |||
25 | if (feof(f)) | ||
26 | break; | ||
27 | @@ -198,14 +198,12 @@ | ||
28 | } | ||
29 | |||
30 | if (!enabled) { | ||
31 | - free(controller); | ||
32 | continue; | ||
33 | } | ||
34 | |||
35 | r = set_put(controllers, controller); | ||
36 | if (r < 0) { | ||
37 | log_error("Failed to add controller to set."); | ||
38 | - free(controller); | ||
39 | goto finish; | ||
40 | } | ||
41 | } | ||
42 | @@ -275,7 +273,6 @@ | ||
43 | p.fatal = false; | ||
44 | |||
45 | r = mount_one(&p, true); | ||
46 | - free(controller); | ||
47 | free(where); | ||
48 | |||
49 | if (r < 0) { | ||
50 | Index: git/src/socket-util.c | ||
51 | =================================================================== | ||
52 | --- git.orig/src/socket-util.c 2012-06-23 17:48:06.177735209 -0700 | ||
53 | +++ git/src/socket-util.c 2012-06-23 17:48:07.109735255 -0700 | ||
54 | @@ -192,7 +192,7 @@ | ||
55 | int socket_address_parse_netlink(SocketAddress *a, const char *s) { | ||
56 | int family; | ||
57 | unsigned group = 0; | ||
58 | - char* sfamily = NULL; | ||
59 | + char sfamily[50]; | ||
60 | assert(a); | ||
61 | assert(s); | ||
62 | |||
63 | @@ -200,17 +200,14 @@ | ||
64 | a->type = SOCK_RAW; | ||
65 | |||
66 | errno = 0; | ||
67 | - if (sscanf(s, "%ms %u", &sfamily, &group) < 1) | ||
68 | + if (sscanf(s, "%49s %u", &sfamily, &group) < 1) | ||
69 | return errno ? -errno : -EINVAL; | ||
70 | |||
71 | if ((family = netlink_family_from_string(sfamily)) < 0) | ||
72 | if (safe_atoi(sfamily, &family) < 0) { | ||
73 | - free(sfamily); | ||
74 | return -EINVAL; | ||
75 | } | ||
76 | |||
77 | - free(sfamily); | ||
78 | - | ||
79 | a->sockaddr.nl.nl_family = AF_NETLINK; | ||
80 | a->sockaddr.nl.nl_groups = group; | ||
81 | |||
82 | Index: git/src/swap.c | ||
83 | =================================================================== | ||
84 | --- git.orig/src/swap.c 2012-06-23 17:48:06.181735209 -0700 | ||
85 | +++ git/src/swap.c 2012-06-23 17:48:07.113735256 -0700 | ||
86 | @@ -1060,11 +1060,12 @@ | ||
87 | (void) fscanf(m->proc_swaps, "%*s %*s %*s %*s %*s\n"); | ||
88 | |||
89 | for (i = 1;; i++) { | ||
90 | - char *dev = NULL, *d; | ||
91 | + char *d; | ||
92 | + char dev[20]; | ||
93 | int prio = 0, k; | ||
94 | |||
95 | if ((k = fscanf(m->proc_swaps, | ||
96 | - "%ms " /* device/file */ | ||
97 | + "%19s " /* device/file */ | ||
98 | "%*s " /* type of swap */ | ||
99 | "%*s " /* swap size */ | ||
100 | "%*s " /* used */ | ||
101 | @@ -1075,12 +1076,10 @@ | ||
102 | break; | ||
103 | |||
104 | log_warning("Failed to parse /proc/swaps:%u.", i); | ||
105 | - free(dev); | ||
106 | continue; | ||
107 | } | ||
108 | |||
109 | d = cunescape(dev); | ||
110 | - free(dev); | ||
111 | |||
112 | if (!d) | ||
113 | return -ENOMEM; | ||
114 | Index: git/src/tmpfiles.c | ||
115 | =================================================================== | ||
116 | --- git.orig/src/tmpfiles.c 2012-06-23 17:48:06.189735211 -0700 | ||
117 | +++ git/src/tmpfiles.c 2012-06-24 12:52:14.857057613 -0700 | ||
118 | @@ -73,8 +73,8 @@ | ||
119 | typedef struct Item { | ||
120 | ItemType type; | ||
121 | |||
122 | - char *path; | ||
123 | - char *argument; | ||
124 | + char path[50]; | ||
125 | + char argument[50]; | ||
126 | uid_t uid; | ||
127 | gid_t gid; | ||
128 | mode_t mode; | ||
129 | @@ -858,8 +858,6 @@ | ||
130 | static void item_free(Item *i) { | ||
131 | assert(i); | ||
132 | |||
133 | - free(i->path); | ||
134 | - free(i->argument); | ||
135 | free(i); | ||
136 | } | ||
137 | |||
138 | @@ -906,7 +904,7 @@ | ||
139 | |||
140 | static int parse_line(const char *fname, unsigned line, const char *buffer) { | ||
141 | Item *i, *existing; | ||
142 | - char *mode = NULL, *user = NULL, *group = NULL, *age = NULL; | ||
143 | + char mode[50], user[50], group[50], age[50]; | ||
144 | char type; | ||
145 | Hashmap *h; | ||
146 | int r, n = -1; | ||
147 | @@ -923,18 +921,18 @@ | ||
148 | |||
149 | if (sscanf(buffer, | ||
150 | "%c " | ||
151 | - "%ms " | ||
152 | - "%ms " | ||
153 | - "%ms " | ||
154 | - "%ms " | ||
155 | - "%ms " | ||
156 | + "%s " | ||
157 | + "%s " | ||
158 | + "%s " | ||
159 | + "%s " | ||
160 | + "%s " | ||
161 | "%n", | ||
162 | &type, | ||
163 | &i->path, | ||
164 | - &mode, | ||
165 | - &user, | ||
166 | - &group, | ||
167 | - &age, | ||
168 | + mode, | ||
169 | + user, | ||
170 | + group, | ||
171 | + age, | ||
172 | &n) < 2) { | ||
173 | log_error("[%s:%u] Syntax error.", fname, line); | ||
174 | r = -EIO; | ||
175 | @@ -944,7 +942,7 @@ | ||
176 | if (n >= 0) { | ||
177 | n += strspn(buffer+n, WHITESPACE); | ||
178 | if (buffer[n] != 0 && (buffer[n] != '-' || buffer[n+1] != 0)) { | ||
179 | - i->argument = unquote(buffer+n, "\""); | ||
180 | + strcpy(i->argument, unquote(buffer+n, "\"")); | ||
181 | if (!i->argument) { | ||
182 | log_error("Out of memory"); | ||
183 | return -ENOMEM; | ||
184 | @@ -1096,11 +1094,6 @@ | ||
185 | r = 0; | ||
186 | |||
187 | finish: | ||
188 | - free(user); | ||
189 | - free(group); | ||
190 | - free(mode); | ||
191 | - free(age); | ||
192 | - | ||
193 | if (i) | ||
194 | item_free(i); | ||
195 | |||
196 | Index: git/src/mount.c | ||
197 | =================================================================== | ||
198 | --- git.orig/src/mount.c 2012-06-23 17:48:06.153735209 -0700 | ||
199 | +++ git/src/mount.c 2012-06-23 17:48:07.113735256 -0700 | ||
200 | @@ -24,6 +24,7 @@ | ||
201 | #include <mntent.h> | ||
202 | #include <sys/epoll.h> | ||
203 | #include <signal.h> | ||
204 | +#include <string.h> | ||
205 | |||
206 | #include "unit.h" | ||
207 | #include "mount.h" | ||
208 | @@ -1591,7 +1592,13 @@ | ||
209 | static int mount_load_proc_self_mountinfo(Manager *m, bool set_flags) { | ||
210 | int r = 0; | ||
211 | unsigned i; | ||
212 | - char *device, *path, *options, *options2, *fstype, *d, *p, *o; | ||
213 | + char *d, *p, *o; | ||
214 | + char device[50]; | ||
215 | + char path[50]; | ||
216 | + char options[50]; | ||
217 | + char options2[50]; | ||
218 | + char fstype[50]; | ||
219 | + | ||
220 | |||
221 | assert(m); | ||
222 | |||
223 | @@ -1600,26 +1607,26 @@ | ||
224 | for (i = 1;; i++) { | ||
225 | int k; | ||
226 | |||
227 | - device = path = options = options2 = fstype = d = p = o = NULL; | ||
228 | + d = p = o = NULL; | ||
229 | |||
230 | if ((k = fscanf(m->proc_self_mountinfo, | ||
231 | "%*s " /* (1) mount id */ | ||
232 | "%*s " /* (2) parent id */ | ||
233 | "%*s " /* (3) major:minor */ | ||
234 | "%*s " /* (4) root */ | ||
235 | - "%ms " /* (5) mount point */ | ||
236 | - "%ms" /* (6) mount options */ | ||
237 | + "%49s " /* (5) mount point */ | ||
238 | + "%49s" /* (6) mount options */ | ||
239 | "%*[^-]" /* (7) optional fields */ | ||
240 | "- " /* (8) separator */ | ||
241 | - "%ms " /* (9) file system type */ | ||
242 | - "%ms" /* (10) mount source */ | ||
243 | - "%ms" /* (11) mount options 2 */ | ||
244 | + "%49s " /* (9) file system type */ | ||
245 | + "%49s" /* (10) mount source */ | ||
246 | + "%49s" /* (11) mount options 2 */ | ||
247 | "%*[^\n]", /* some rubbish at the end */ | ||
248 | - &path, | ||
249 | - &options, | ||
250 | - &fstype, | ||
251 | - &device, | ||
252 | - &options2)) != 5) { | ||
253 | + path, | ||
254 | + options, | ||
255 | + fstype, | ||
256 | + device, | ||
257 | + options2)) != 5) { | ||
258 | |||
259 | if (k == EOF) | ||
260 | break; | ||
261 | @@ -1643,22 +1650,12 @@ | ||
262 | r = k; | ||
263 | |||
264 | clean_up: | ||
265 | - free(device); | ||
266 | - free(path); | ||
267 | - free(options); | ||
268 | - free(options2); | ||
269 | - free(fstype); | ||
270 | free(d); | ||
271 | free(p); | ||
272 | free(o); | ||
273 | } | ||
274 | |||
275 | finish: | ||
276 | - free(device); | ||
277 | - free(path); | ||
278 | - free(options); | ||
279 | - free(options2); | ||
280 | - free(fstype); | ||
281 | free(d); | ||
282 | free(p); | ||
283 | free(o); | ||
284 | Index: git/src/umount.c | ||
285 | =================================================================== | ||
286 | --- git.orig/src/umount.c 2012-06-23 17:48:06.189735211 -0700 | ||
287 | +++ git/src/umount.c 2012-06-23 17:48:07.113735256 -0700 | ||
288 | @@ -60,7 +60,9 @@ | ||
289 | |||
290 | static int mount_points_list_get(MountPoint **head) { | ||
291 | FILE *proc_self_mountinfo; | ||
292 | - char *path, *p; | ||
293 | + char *p; | ||
294 | + char path[50]; | ||
295 | + | ||
296 | unsigned int i; | ||
297 | int r; | ||
298 | |||
299 | @@ -72,17 +74,17 @@ | ||
300 | for (i = 1;; i++) { | ||
301 | int k; | ||
302 | MountPoint *m; | ||
303 | - char *root; | ||
304 | + char root[50]; | ||
305 | bool skip_ro; | ||
306 | |||
307 | - path = p = NULL; | ||
308 | + p = NULL; | ||
309 | |||
310 | if ((k = fscanf(proc_self_mountinfo, | ||
311 | "%*s " /* (1) mount id */ | ||
312 | "%*s " /* (2) parent id */ | ||
313 | "%*s " /* (3) major:minor */ | ||
314 | - "%ms " /* (4) root */ | ||
315 | - "%ms " /* (5) mount point */ | ||
316 | + "%49s " /* (4) root */ | ||
317 | + "%49s " /* (5) mount point */ | ||
318 | "%*s" /* (6) mount options */ | ||
319 | "%*[^-]" /* (7) optional fields */ | ||
320 | "- " /* (8) separator */ | ||
321 | @@ -90,24 +92,21 @@ | ||
322 | "%*s" /* (10) mount source */ | ||
323 | "%*s" /* (11) mount options 2 */ | ||
324 | "%*[^\n]", /* some rubbish at the end */ | ||
325 | - &root, | ||
326 | - &path)) != 2) { | ||
327 | + root, | ||
328 | + path)) != 2) { | ||
329 | if (k == EOF) | ||
330 | break; | ||
331 | |||
332 | log_warning("Failed to parse /proc/self/mountinfo:%u.", i); | ||
333 | |||
334 | - free(path); | ||
335 | continue; | ||
336 | } | ||
337 | |||
338 | /* If we encounter a bind mount, don't try to remount | ||
339 | * the source dir too early */ | ||
340 | skip_ro = !streq(root, "/"); | ||
341 | - free(root); | ||
342 | |||
343 | p = cunescape(path); | ||
344 | - free(path); | ||
345 | |||
346 | if (!p) { | ||
347 | r = -ENOMEM; | ||
348 | @@ -152,28 +151,28 @@ | ||
349 | |||
350 | for (i = 2;; i++) { | ||
351 | MountPoint *swap; | ||
352 | - char *dev = NULL, *d; | ||
353 | + char *d; | ||
354 | + char dev[50]; | ||
355 | + | ||
356 | int k; | ||
357 | |||
358 | if ((k = fscanf(proc_swaps, | ||
359 | - "%ms " /* device/file */ | ||
360 | + "%50s " /* device/file */ | ||
361 | "%*s " /* type of swap */ | ||
362 | "%*s " /* swap size */ | ||
363 | "%*s " /* used */ | ||
364 | "%*s\n", /* priority */ | ||
365 | - &dev)) != 1) { | ||
366 | + dev)) != 1) { | ||
367 | |||
368 | if (k == EOF) | ||
369 | break; | ||
370 | |||
371 | log_warning("Failed to parse /proc/swaps:%u.", i); | ||
372 | |||
373 | - free(dev); | ||
374 | continue; | ||
375 | } | ||
376 | |||
377 | if (endswith(dev, "(deleted)")) { | ||
378 | - free(dev); | ||
379 | continue; | ||
380 | } | ||
381 | |||
diff --git a/meta-systemd/recipes-core/systemd/systemd/paper-over-mkostemp.patch b/meta-systemd/recipes-core/systemd/systemd/paper-over-mkostemp.patch deleted file mode 100644 index ae4f6def3..000000000 --- a/meta-systemd/recipes-core/systemd/systemd/paper-over-mkostemp.patch +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | uclibc does not have mkostemp() so we redefine it to use mkstemp() | ||
2 | |||
3 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
4 | |||
5 | Index: git/src/shared/macro.h | ||
6 | =================================================================== | ||
7 | --- git.orig/src/shared/macro.h 2012-08-23 22:13:18.618931300 -0700 | ||
8 | +++ git/src/shared/macro.h 2012-08-23 22:15:05.558935366 -0700 | ||
9 | @@ -27,6 +27,10 @@ | ||
10 | #include <sys/uio.h> | ||
11 | #include <inttypes.h> | ||
12 | |||
13 | +#ifdef __UCLIBC__ | ||
14 | +/* uclibc does not implement mkostemp GNU extention */ | ||
15 | +#define mkostemp(x,y) mkstemp(x) | ||
16 | +#endif | ||
17 | #define _printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||
18 | #define _sentinel_ __attribute__ ((sentinel)) | ||
19 | #define _noreturn_ __attribute__((noreturn)) | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch new file mode 100644 index 000000000..1bfc3bdb1 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | --- systemd-185.orig/configure.ac 2012-06-04 14:15:16.000000000 -0400 | ||
2 | +++ systemd-pam-185/configure.ac 2012-06-21 22:57:10.000000000 -0400 | ||
3 | @@ -63,6 +63,23 @@ | ||
4 | |||
5 | AC_PATH_PROG([M4], [m4]) | ||
6 | |||
7 | +# check for few functions not implemented in uClibc | ||
8 | + | ||
9 | +AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate) | ||
10 | + | ||
11 | +# check for %ms format support - assume always no if cross compiling | ||
12 | + | ||
13 | +AC_MSG_CHECKING([whether %ms format is supported by *scanf]) | ||
14 | + | ||
15 | +AC_RUN_IFELSE( | ||
16 | + [AC_LANG_PROGRAM([[ include <stdio.h> ]], | ||
17 | + [[ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ; | ||
18 | + int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ; | ||
19 | + return (rc==3)?0:1;]])], | ||
20 | + [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])], | ||
21 | + [AC_MSG_RESULT([no])], | ||
22 | + [AC_MSG_RESULT([no])]) | ||
23 | + | ||
24 | # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line | ||
25 | m4_ifdef([GTK_DOC_CHECK], [ | ||
26 | GTK_DOC_CHECK([1.18],[--flavour no-tmpl]) | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch new file mode 100644 index 000000000..ea8b3ffb1 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | --- systemd-pam-185/src/nspawn/nspawn.c.orig 2012-06-21 05:31:24.000000000 -0400 | ||
2 | +++ systemd-pam-185/src/nspawn/nspawn.c 2012-06-21 05:29:50.000000000 -0400 | ||
3 | @@ -61,6 +61,8 @@ | ||
4 | #include "path-util.h" | ||
5 | #include "loopback-setup.h" | ||
6 | |||
7 | +#include "config.h" | ||
8 | + | ||
9 | static char *arg_directory = NULL; | ||
10 | static char *arg_user = NULL; | ||
11 | static char **arg_controllers = NULL; | ||
12 | @@ -1315,9 +1317,14 @@ | ||
13 | |||
14 | a[0] = (char*) "/sbin/init"; | ||
15 | execve(a[0], a, (char**) envp); | ||
16 | - } else if (argc > optind) | ||
17 | - execvpe(argv[optind], argv + optind, (char**) envp); | ||
18 | - else { | ||
19 | + } else if (argc > optind) { | ||
20 | +#ifdef HAVE_EXECVPE | ||
21 | + execvpe(argv[optind], argv + optind, (char**) envp); | ||
22 | +#else | ||
23 | + environ = (char **)envp; | ||
24 | + execvp(argv[optind], argv + optind); | ||
25 | +#endif /* HAVE_EXECVPE */ | ||
26 | + } else { | ||
27 | chdir(home ? home : "/root"); | ||
28 | execle("/bin/bash", "-bash", NULL, (char**) envp); | ||
29 | } | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch new file mode 100644 index 000000000..089ba6469 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | Index: git/src/journal/journal-file.c | ||
2 | =================================================================== | ||
3 | --- git.orig/src/journal/journal-file.c 2012-09-02 09:49:15.126089594 -0700 | ||
4 | +++ git/src/journal/journal-file.c 2012-09-02 09:49:17.118089670 -0700 | ||
5 | @@ -34,6 +34,8 @@ | ||
6 | #include "compress.h" | ||
7 | #include "fsprg.h" | ||
8 | |||
9 | +#include "config.h" | ||
10 | + | ||
11 | #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem)) | ||
12 | #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem)) | ||
13 | |||
14 | @@ -262,7 +264,7 @@ | ||
15 | |||
16 | static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { | ||
17 | uint64_t old_size, new_size; | ||
18 | - int r; | ||
19 | + int r = 0; | ||
20 | |||
21 | assert(f); | ||
22 | |||
23 | @@ -307,10 +309,25 @@ | ||
24 | /* Note that the glibc fallocate() fallback is very | ||
25 | inefficient, hence we try to minimize the allocation area | ||
26 | as we can. */ | ||
27 | +#ifdef HAVE_POSIX_ALLOCATE | ||
28 | r = posix_fallocate(f->fd, old_size, new_size - old_size); | ||
29 | if (r != 0) | ||
30 | return -r; | ||
31 | |||
32 | +#else | ||
33 | + /* Use good old method to write zeros into the journal file | ||
34 | + perhaps very inefficient yet working. */ | ||
35 | + if(new_size > old_size) { | ||
36 | + char *buf = alloca(new_size - old_size); | ||
37 | + off_t oldpos = lseek(f->fd, 0, SEEK_CUR); | ||
38 | + bzero(buf, new_size - old_size); | ||
39 | + lseek(f->fd, old_size, SEEK_SET); | ||
40 | + r = write(f->fd, buf, new_size - old_size); | ||
41 | + lseek(f->fd, oldpos, SEEK_SET); | ||
42 | + } | ||
43 | + if (r < 0) | ||
44 | + return -errno; | ||
45 | +#endif /* HAVE_POSIX_FALLOCATE */ | ||
46 | if (fstat(f->fd, &f->last_stat) < 0) | ||
47 | return -errno; | ||
48 | |||
49 | Index: git/src/journal/journald-kmsg.c | ||
50 | =================================================================== | ||
51 | --- git.orig/src/journal/journald-kmsg.c 2012-09-02 09:49:15.130089595 -0700 | ||
52 | +++ git/src/journal/journald-kmsg.c 2012-09-02 12:26:17.326447895 -0700 | ||
53 | @@ -404,6 +404,7 @@ | ||
54 | |||
55 | int server_open_kernel_seqnum(Server *s) { | ||
56 | int fd; | ||
57 | + int r = 0; | ||
58 | uint64_t *p; | ||
59 | |||
60 | assert(s); | ||
61 | @@ -417,8 +418,19 @@ | ||
62 | log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); | ||
63 | return 0; | ||
64 | } | ||
65 | - | ||
66 | - if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) { | ||
67 | +#ifdef HAVE_POSIX_ALLOCATE | ||
68 | + r = posix_fallocate(fd, 0, sizeof(uint64_t)); | ||
69 | +#else | ||
70 | + /* Use good old method to write zeros into the journal file | ||
71 | + perhaps very inefficient yet working. */ | ||
72 | + char *buf = alloca(sizeof(uint64_t)); | ||
73 | + off_t oldpos = lseek(fd, 0, SEEK_CUR); | ||
74 | + bzero(buf, sizeof(uint64_t)); | ||
75 | + lseek(fd, 0, SEEK_SET); | ||
76 | + r = write(fd, buf, sizeof(uint64_t)); | ||
77 | + lseek(fd, oldpos, SEEK_SET); | ||
78 | +#endif /* HAVE_POSIX_FALLOCATE */ | ||
79 | + if (r < 0) { | ||
80 | log_error("Failed to allocate sequential number file, ignoring: %m"); | ||
81 | close_nointr_nofail(fd); | ||
82 | return 0; | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch new file mode 100644 index 000000000..3e5ea71e0 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | Prefer getty to agetty in console setup systemd units | ||
2 | |||
3 | Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> | ||
4 | --- | ||
5 | units/getty@.service.m4 | 2 +- | ||
6 | units/serial-getty@.service.m4 | 2 +- | ||
7 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
8 | |||
9 | Index: systemd-37/units/getty@.service.m4 | ||
10 | =================================================================== | ||
11 | --- systemd-37.orig/units/getty@.service.m4 | ||
12 | +++ systemd-37/units/getty@.service.m4 | ||
13 | @@ -41,7 +41,7 @@ | ||
14 | |||
15 | [Service] | ||
16 | Environment=TERM=linux | ||
17 | # the VT is cleared by TTYVTDisallocate | ||
18 | -ExecStart=-/sbin/agetty --noclear %I 38400 | ||
19 | +ExecStart=-/sbin/getty -L %I 115200 linux | ||
20 | Type=idle | ||
21 | Restart=always | ||
22 | RestartSec=0 | ||
23 | Index: systemd-37/units/serial-getty@.service.m4 | ||
24 | =================================================================== | ||
25 | --- systemd-37.orig/units/serial-getty@.service.m4 | ||
26 | +++ systemd-37/units/serial-getty@.service.m4 | ||
27 | @@ -37,7 +37,7 @@ | ||
28 | |||
29 | [Service] | ||
30 | Environment=TERM=vt102 | ||
31 | -ExecStart=-/sbin/agetty -s %I 115200,38400,9600 | ||
32 | +ExecStart=-/sbin/getty -L %I 115200 vt100 | ||
33 | Type=idle | ||
34 | Restart=always | ||
35 | RestartSec=0 | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch new file mode 100644 index 000000000..8de9a3a32 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch | |||
@@ -0,0 +1,166 @@ | |||
1 | Index: git/src/journal/journal-send.c | ||
2 | =================================================================== | ||
3 | --- git.orig/src/journal/journal-send.c 2012-09-02 00:10:08.748768268 -0700 | ||
4 | +++ git/src/journal/journal-send.c 2012-09-02 00:10:10.508768335 -0700 | ||
5 | @@ -34,6 +34,8 @@ | ||
6 | |||
7 | #define SNDBUF_SIZE (8*1024*1024) | ||
8 | |||
9 | +#include "config.h" | ||
10 | + | ||
11 | /* We open a single fd, and we'll share it with the current process, | ||
12 | * all its threads, and all its subprocesses. This means we need to | ||
13 | * initialize it atomically, and need to operate on it atomically | ||
14 | @@ -293,7 +295,12 @@ | ||
15 | * file and just pass a file descriptor of it to the other | ||
16 | * side */ | ||
17 | |||
18 | +#ifdef HAVE_MKOSTEMP | ||
19 | buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR); | ||
20 | +#else | ||
21 | + buffer_fd = mkstemp(path); | ||
22 | + if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC); | ||
23 | +#endif /* HAVE_MKOSTEMP */ | ||
24 | if (buffer_fd < 0) { | ||
25 | r = -errno; | ||
26 | goto finish; | ||
27 | Index: git/src/core/manager.c | ||
28 | =================================================================== | ||
29 | --- git.orig/src/core/manager.c 2012-09-02 00:10:08.732768266 -0700 | ||
30 | +++ git/src/core/manager.c 2012-09-02 00:10:10.512768334 -0700 | ||
31 | @@ -67,6 +67,8 @@ | ||
32 | #include "cgroup-util.h" | ||
33 | #include "path-util.h" | ||
34 | |||
35 | +#include "config.h" | ||
36 | + | ||
37 | /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */ | ||
38 | #define GC_QUEUE_ENTRIES_MAX 16 | ||
39 | |||
40 | @@ -1701,7 +1703,12 @@ | ||
41 | return -ENOMEM; | ||
42 | |||
43 | saved_umask = umask(0077); | ||
44 | +#ifdef HAVE_MKOSTEMP | ||
45 | fd = mkostemp(path, O_RDWR|O_CLOEXEC); | ||
46 | +#else | ||
47 | + fd = mkstemp(path); | ||
48 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); | ||
49 | +#endif /* HAVE_MKOSTEMP */ | ||
50 | umask(saved_umask); | ||
51 | |||
52 | if (fd < 0) { | ||
53 | Index: git/src/shared/util.c | ||
54 | =================================================================== | ||
55 | --- git.orig/src/shared/util.c 2012-09-02 00:10:08.784768269 -0700 | ||
56 | +++ git/src/shared/util.c 2012-09-02 00:10:10.512768334 -0700 | ||
57 | @@ -68,6 +68,8 @@ | ||
58 | #include "exit-status.h" | ||
59 | #include "hashmap.h" | ||
60 | |||
61 | +#include "config.h" | ||
62 | + | ||
63 | int saved_argc = 0; | ||
64 | char **saved_argv = NULL; | ||
65 | |||
66 | @@ -4519,7 +4521,12 @@ | ||
67 | t[k] = '.'; | ||
68 | stpcpy(stpcpy(t+k+1, fn), "XXXXXX"); | ||
69 | |||
70 | +#ifdef HAVE_MKOSTEMP | ||
71 | fd = mkostemp(t, O_WRONLY|O_CLOEXEC); | ||
72 | +#else | ||
73 | + fd = mkstemp(t); | ||
74 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); | ||
75 | +#endif /* HAVE_MKOSTEMP */ | ||
76 | if (fd < 0) { | ||
77 | free(t); | ||
78 | return -errno; | ||
79 | Index: git/src/shared/ask-password-api.c | ||
80 | =================================================================== | ||
81 | --- git.orig/src/shared/ask-password-api.c 2012-09-02 00:10:08.772768268 -0700 | ||
82 | +++ git/src/shared/ask-password-api.c 2012-09-02 00:10:10.512768334 -0700 | ||
83 | @@ -37,6 +37,8 @@ | ||
84 | |||
85 | #include "ask-password-api.h" | ||
86 | |||
87 | +#include "config.h" | ||
88 | + | ||
89 | static void backspace_chars(int ttyfd, size_t p) { | ||
90 | |||
91 | if (ttyfd < 0) | ||
92 | @@ -326,7 +328,12 @@ | ||
93 | mkdir_p_label("/run/systemd/ask-password", 0755); | ||
94 | |||
95 | u = umask(0022); | ||
96 | +#ifdef HAVE_MKOSTEMP | ||
97 | fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY); | ||
98 | +#else | ||
99 | + fd = mkstemp(temp); | ||
100 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); | ||
101 | +#endif /* HAVE_MKOSTEMP */ | ||
102 | umask(u); | ||
103 | |||
104 | if (fd < 0) { | ||
105 | Index: git/src/journal/journalctl.c | ||
106 | =================================================================== | ||
107 | --- git.orig/src/journal/journalctl.c 2012-09-02 00:10:08.752768267 -0700 | ||
108 | +++ git/src/journal/journalctl.c 2012-09-02 00:18:41.928787779 -0700 | ||
109 | @@ -540,7 +540,13 @@ | ||
110 | n /= arg_interval; | ||
111 | |||
112 | close_nointr_nofail(fd); | ||
113 | +#ifdef HAVE_MKOSTEMP | ||
114 | fd = mkostemp(k, O_WRONLY|O_CLOEXEC|O_NOCTTY); | ||
115 | +#else | ||
116 | + fd = mkstemp(k); | ||
117 | + if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); | ||
118 | +#endif /* HAVE_MKOSTEMP */ | ||
119 | + | ||
120 | if (fd < 0) { | ||
121 | log_error("Failed to open %s: %m", k); | ||
122 | r = -errno; | ||
123 | Index: git/src/journal/journal-verify.c | ||
124 | =================================================================== | ||
125 | --- git.orig/src/journal/journal-verify.c 2012-09-02 00:10:08.752768267 -0700 | ||
126 | +++ git/src/journal/journal-verify.c 2012-09-02 00:24:10.268800268 -0700 | ||
127 | @@ -693,8 +693,12 @@ | ||
128 | #endif | ||
129 | } else if (f->seal) | ||
130 | return -ENOKEY; | ||
131 | - | ||
132 | +#ifdef HAVE_MKOSTEMP | ||
133 | data_fd = mkostemp(data_path, O_CLOEXEC); | ||
134 | +#else | ||
135 | + data_fd = mkstemp(data_path); | ||
136 | + if (data_fd >= 0) fcntl(data_fd, F_SETFD, FD_CLOEXEC); | ||
137 | +#endif /* HAVE_MKOSTEMP */ | ||
138 | if (data_fd < 0) { | ||
139 | log_error("Failed to create data file: %m"); | ||
140 | r = -errno; | ||
141 | @@ -702,7 +706,12 @@ | ||
142 | } | ||
143 | unlink(data_path); | ||
144 | |||
145 | +#ifdef HAVE_MKOSTEMP | ||
146 | entry_fd = mkostemp(entry_path, O_CLOEXEC); | ||
147 | +#else | ||
148 | + entry_fd = mkstemp(entry_path); | ||
149 | + if (entry_fd >= 0) fcntl(entry_fd, F_SETFD, FD_CLOEXEC); | ||
150 | +#endif /* HAVE_MKOSTEMP */ | ||
151 | if (entry_fd < 0) { | ||
152 | log_error("Failed to create entry file: %m"); | ||
153 | r = -errno; | ||
154 | @@ -710,7 +719,12 @@ | ||
155 | } | ||
156 | unlink(entry_path); | ||
157 | |||
158 | +#ifdef HAVE_MKOSTEMP | ||
159 | entry_array_fd = mkostemp(entry_array_path, O_CLOEXEC); | ||
160 | +#else | ||
161 | + entry_array_fd = mkstemp(entry_array_path); | ||
162 | + if (entry_array_fd >= 0) fcntl(entry_array_fd, F_SETFD, FD_CLOEXEC); | ||
163 | +#endif /* HAVE_MKOSTEMP */ | ||
164 | if (entry_array_fd < 0) { | ||
165 | log_error("Failed to create entry array file: %m"); | ||
166 | r = -errno; | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch new file mode 100644 index 000000000..ee6332983 --- /dev/null +++ b/meta-systemd/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch | |||
@@ -0,0 +1,335 @@ | |||
1 | --- systemd-pam-185/src/fsck/fsck.c.orig 2012-06-22 23:22:22.000000000 -0400 | ||
2 | +++ systemd-pam-185/src/fsck/fsck.c 2012-06-22 21:15:56.000000000 -0400 | ||
3 | @@ -36,6 +36,8 @@ | ||
4 | #include "bus-errors.h" | ||
5 | #include "virt.h" | ||
6 | |||
7 | +#include "config.h" | ||
8 | + | ||
9 | static bool arg_skip = false; | ||
10 | static bool arg_force = false; | ||
11 | static bool arg_show_progress = false; | ||
12 | @@ -193,9 +195,16 @@ | ||
13 | char *device; | ||
14 | double p; | ||
15 | usec_t t; | ||
16 | - | ||
17 | +#ifdef HAVE_MSFORMAT | ||
18 | if (fscanf(f, "%i %lu %lu %ms", &pass, &cur, &max, &device) != 4) | ||
19 | - break; | ||
20 | +#else | ||
21 | + device = malloc(257); | ||
22 | + if (fscanf(f, "%i %lu %lu %256s", &pass, &cur, &max, device) != 4) { | ||
23 | + free(device); | ||
24 | + } | ||
25 | + | ||
26 | +#endif /* HAVE_MSFORMAT */ | ||
27 | + break; | ||
28 | |||
29 | /* Only show one progress counter at max */ | ||
30 | if (!locked) { | ||
31 | --- systemd-pam-185/src/core/swap.c.orig 2012-06-22 23:22:55.000000000 -0400 | ||
32 | +++ systemd-pam-185/src/core/swap.c 2012-06-22 21:17:10.000000000 -0400 | ||
33 | @@ -40,6 +40,8 @@ | ||
34 | #include "def.h" | ||
35 | #include "path-util.h" | ||
36 | |||
37 | +#include "config.h" | ||
38 | + | ||
39 | static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = { | ||
40 | [SWAP_DEAD] = UNIT_INACTIVE, | ||
41 | [SWAP_ACTIVATING] = UNIT_ACTIVATING, | ||
42 | @@ -1038,7 +1040,7 @@ | ||
43 | for (i = 1;; i++) { | ||
44 | char *dev = NULL, *d; | ||
45 | int prio = 0, k; | ||
46 | - | ||
47 | +#ifdef HAVE_MSFORMAT | ||
48 | if ((k = fscanf(m->proc_swaps, | ||
49 | "%ms " /* device/file */ | ||
50 | "%*s " /* type of swap */ | ||
51 | @@ -1046,10 +1048,18 @@ | ||
52 | "%*s " /* used */ | ||
53 | "%i\n", /* priority */ | ||
54 | &dev, &prio)) != 2) { | ||
55 | - | ||
56 | +#else | ||
57 | + dev = malloc(257); | ||
58 | + if ((k = fscanf(m->proc_swaps, | ||
59 | + "%256s " /* device/file */ | ||
60 | + "%*s " /* type of swap */ | ||
61 | + "%*s " /* swap size */ | ||
62 | + "%*s " /* used */ | ||
63 | + "%i\n", /* priority */ | ||
64 | + dev, &prio)) != 2) { | ||
65 | +#endif /* HAVE_MSFORMAT */ | ||
66 | if (k == EOF) | ||
67 | break; | ||
68 | - | ||
69 | log_warning("Failed to parse /proc/swaps:%u.", i); | ||
70 | free(dev); | ||
71 | continue; | ||
72 | --- systemd-pam-185/src/core/mount-setup.c.orig 2012-06-22 23:23:41.000000000 -0400 | ||
73 | +++ systemd-pam-185/src/core/mount-setup.c 2012-06-22 21:19:44.000000000 -0400 | ||
74 | @@ -28,6 +28,7 @@ | ||
75 | #include <assert.h> | ||
76 | #include <unistd.h> | ||
77 | #include <ftw.h> | ||
78 | +#include <linux/fs.h> | ||
79 | |||
80 | #include "mount-setup.h" | ||
81 | #include "dev-setup.h" | ||
82 | @@ -41,6 +41,8 @@ | ||
83 | #include "path-util.h" | ||
84 | #include "missing.h" | ||
85 | |||
86 | +#include "config.h" | ||
87 | + | ||
88 | #ifndef TTY_GID | ||
89 | #define TTY_GID 5 | ||
90 | #endif | ||
91 | @@ -200,9 +202,12 @@ | ||
92 | for (;;) { | ||
93 | char *controller; | ||
94 | int enabled = 0; | ||
95 | - | ||
96 | +#ifdef HAVE_MSFORMAT | ||
97 | if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) { | ||
98 | - | ||
99 | +#else | ||
100 | + controller = malloc(257); | ||
101 | + if (fscanf(f, "%256s %*i %*i %i", controller, &enabled) != 2) { | ||
102 | +#endif /* HAVE_MSFORMAT */ | ||
103 | if (feof(f)) | ||
104 | break; | ||
105 | |||
106 | --- systemd-pam-185/src/core/mount.c.orig 2012-06-22 23:24:17.000000000 -0400 | ||
107 | +++ systemd-pam-185/src/core/mount.c 2012-06-22 22:51:21.000000000 -0400 | ||
108 | @@ -41,6 +41,8 @@ | ||
109 | #include "exit-status.h" | ||
110 | #include "def.h" | ||
111 | |||
112 | +#include "config.h" | ||
113 | + | ||
114 | static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = { | ||
115 | [MOUNT_DEAD] = UNIT_INACTIVE, | ||
116 | [MOUNT_MOUNTING] = UNIT_ACTIVATING, | ||
117 | @@ -1514,7 +1516,7 @@ | ||
118 | int k; | ||
119 | |||
120 | device = path = options = options2 = fstype = d = p = o = NULL; | ||
121 | - | ||
122 | +#ifdef HAVE_MSFORMAT | ||
123 | if ((k = fscanf(m->proc_self_mountinfo, | ||
124 | "%*s " /* (1) mount id */ | ||
125 | "%*s " /* (2) parent id */ | ||
126 | @@ -1533,7 +1535,31 @@ | ||
127 | &fstype, | ||
128 | &device, | ||
129 | &options2)) != 5) { | ||
130 | - | ||
131 | +#else | ||
132 | + path = malloc(257); | ||
133 | + options = malloc(257); | ||
134 | + fstype = malloc(257); | ||
135 | + device = malloc(257); | ||
136 | + options2 = malloc(257); | ||
137 | + if ((k = fscanf(m->proc_self_mountinfo, | ||
138 | + "%*s " /* (1) mount id */ | ||
139 | + "%*s " /* (2) parent id */ | ||
140 | + "%*s " /* (3) major:minor */ | ||
141 | + "%*s " /* (4) root */ | ||
142 | + "%256s " /* (5) mount point */ | ||
143 | + "%256s" /* (6) mount options */ | ||
144 | + "%*[^-]" /* (7) optional fields */ | ||
145 | + "- " /* (8) separator */ | ||
146 | + "%256s " /* (9) file system type */ | ||
147 | + "%256s" /* (10) mount source */ | ||
148 | + "%256s" /* (11) mount options 2 */ | ||
149 | + "%*[^\n]", /* some rubbish at the end */ | ||
150 | + path, | ||
151 | + options, | ||
152 | + fstype, | ||
153 | + device, | ||
154 | + options2)) != 5) { | ||
155 | +#endif /* HAVE_MSFORMAT */ | ||
156 | if (k == EOF) | ||
157 | break; | ||
158 | |||
159 | --- systemd-pam-185/src/core/umount.c.orig 2012-06-22 23:24:37.000000000 -0400 | ||
160 | +++ systemd-pam-185/src/core/umount.c 2012-06-22 22:56:15.000000000 -0400 | ||
161 | @@ -35,6 +35,8 @@ | ||
162 | #include "path-util.h" | ||
163 | #include "util.h" | ||
164 | |||
165 | +#include "config.h" | ||
166 | + | ||
167 | typedef struct MountPoint { | ||
168 | char *path; | ||
169 | dev_t devnum; | ||
170 | @@ -74,7 +76,7 @@ | ||
171 | MountPoint *m; | ||
172 | |||
173 | path = p = NULL; | ||
174 | - | ||
175 | +#ifdef HAVE_MSFORMAT | ||
176 | if ((k = fscanf(proc_self_mountinfo, | ||
177 | "%*s " /* (1) mount id */ | ||
178 | "%*s " /* (2) parent id */ | ||
179 | @@ -89,6 +91,23 @@ | ||
180 | "%*s" /* (11) mount options 2 */ | ||
181 | "%*[^\n]", /* some rubbish at the end */ | ||
182 | &path)) != 1) { | ||
183 | +#else | ||
184 | + path = malloc(257); | ||
185 | + if ((k = fscanf(proc_self_mountinfo, | ||
186 | + "%*s " /* (1) mount id */ | ||
187 | + "%*s " /* (2) parent id */ | ||
188 | + "%*s " /* (3) major:minor */ | ||
189 | + "%*s " /* (4) root */ | ||
190 | + "%256s " /* (5) mount point */ | ||
191 | + "%*s" /* (6) mount options */ | ||
192 | + "%*[^-]" /* (7) optional fields */ | ||
193 | + "- " /* (8) separator */ | ||
194 | + "%*s " /* (9) file system type */ | ||
195 | + "%*s" /* (10) mount source */ | ||
196 | + "%*s" /* (11) mount options 2 */ | ||
197 | + "%*[^\n]", /* some rubbish at the end */ | ||
198 | + path)) != 1) { | ||
199 | +#endif /* HAVE_MSFORMAT */ | ||
200 | if (k == EOF) | ||
201 | break; | ||
202 | |||
203 | @@ -150,7 +169,7 @@ | ||
204 | MountPoint *swap; | ||
205 | char *dev = NULL, *d; | ||
206 | int k; | ||
207 | - | ||
208 | +#ifdef HAVE_MSFORMAT | ||
209 | if ((k = fscanf(proc_swaps, | ||
210 | "%ms " /* device/file */ | ||
211 | "%*s " /* type of swap */ | ||
212 | @@ -158,7 +177,16 @@ | ||
213 | "%*s " /* used */ | ||
214 | "%*s\n", /* priority */ | ||
215 | &dev)) != 1) { | ||
216 | - | ||
217 | +#else | ||
218 | + dev = malloc(257); | ||
219 | + if ((k = fscanf(proc_swaps, | ||
220 | + "%256s " /* device/file */ | ||
221 | + "%*s " /* type of swap */ | ||
222 | + "%*s " /* swap size */ | ||
223 | + "%*s " /* used */ | ||
224 | + "%*s\n", /* priority */ | ||
225 | + dev)) != 1) { | ||
226 | +#endif /* HAVE_MSFORMAT */ | ||
227 | if (k == EOF) | ||
228 | break; | ||
229 | |||
230 | --- systemd-pam-185/src/shared/socket-util.c.orig 2012-06-22 23:25:00.000000000 -0400 | ||
231 | +++ systemd-pam-185/src/shared/socket-util.c 2012-06-22 22:59:27.000000000 -0400 | ||
232 | @@ -39,6 +39,8 @@ | ||
233 | #include "socket-util.h" | ||
234 | #include "missing.h" | ||
235 | |||
236 | +#include "config.h" | ||
237 | + | ||
238 | int socket_address_parse(SocketAddress *a, const char *s) { | ||
239 | int r; | ||
240 | char *e, *n; | ||
241 | @@ -201,8 +203,16 @@ | ||
242 | a->type = SOCK_RAW; | ||
243 | |||
244 | errno = 0; | ||
245 | - if (sscanf(s, "%ms %u", &sfamily, &group) < 1) | ||
246 | +#ifdef HAVE_MSFORMAT | ||
247 | + if (sscanf(s, "%ms %u", &sfamily, &group) < 1) | ||
248 | + return errno ? -errno : -EINVAL; | ||
249 | +#else | ||
250 | + sfamily = malloc(257); | ||
251 | + if (sscanf(s, "%256s %u", sfamily, &group) < 1) { | ||
252 | + free(sfamily); | ||
253 | return errno ? -errno : -EINVAL; | ||
254 | + } | ||
255 | +#endif /* HAVE_MSFORMAT */ | ||
256 | |||
257 | if ((family = netlink_family_from_string(sfamily)) < 0) | ||
258 | if (safe_atoi(sfamily, &family) < 0) { | ||
259 | --- systemd-pam-185/src/tmpfiles/tmpfiles.c.orig 2012-06-22 23:25:21.000000000 -0400 | ||
260 | +++ systemd-pam-185/src/tmpfiles/tmpfiles.c 2012-06-22 23:13:49.000000000 -0400 | ||
261 | @@ -48,6 +48,8 @@ | ||
262 | #include "set.h" | ||
263 | #include "conf-files.h" | ||
264 | |||
265 | +#include "config.h" | ||
266 | + | ||
267 | /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates | ||
268 | * them in the file system. This is intended to be used to create | ||
269 | * properly owned directories beneath /tmp, /var/tmp, /run, which are | ||
270 | @@ -970,7 +972,7 @@ | ||
271 | i = new0(Item, 1); | ||
272 | if (!i) | ||
273 | return log_oom(); | ||
274 | - | ||
275 | +#ifdef HAVE_MSFORMAT | ||
276 | if (sscanf(buffer, | ||
277 | "%c " | ||
278 | "%ms " | ||
279 | @@ -986,6 +988,28 @@ | ||
280 | &group, | ||
281 | &age, | ||
282 | &n) < 2) { | ||
283 | +#else | ||
284 | + i->path = malloc(257); | ||
285 | + mode = malloc(257); | ||
286 | + user = malloc(257); | ||
287 | + group = malloc(257); | ||
288 | + age = malloc(257); | ||
289 | + if (sscanf(buffer, | ||
290 | + "%c " | ||
291 | + "%256s " | ||
292 | + "%256s " | ||
293 | + "%256s " | ||
294 | + "%256s " | ||
295 | + "%256s " | ||
296 | + "%n", | ||
297 | + &type, | ||
298 | + i->path, | ||
299 | + mode, | ||
300 | + user, | ||
301 | + group, | ||
302 | + age, | ||
303 | + &n) < 2) { | ||
304 | +#endif /* HAVE_MSFORMAT */ | ||
305 | log_error("[%s:%u] Syntax error.", fname, line); | ||
306 | r = -EIO; | ||
307 | goto finish; | ||
308 | --- systemd-pam-185/src/cryptsetup/cryptsetup-generator.c.orig 2012-06-22 23:25:47.000000000 -0400 | ||
309 | +++ systemd-pam-185/src/cryptsetup/cryptsetup-generator.c 2012-06-22 23:16:35.000000000 -0400 | ||
310 | @@ -30,6 +30,8 @@ | ||
311 | #include "virt.h" | ||
312 | #include "strv.h" | ||
313 | |||
314 | +#include "config.h" | ||
315 | + | ||
316 | static const char *arg_dest = "/tmp"; | ||
317 | static bool arg_enabled = true; | ||
318 | static bool arg_read_crypttab = true; | ||
319 | @@ -421,8 +423,15 @@ | ||
320 | l = strstrip(line); | ||
321 | if (*l == '#' || *l == 0) | ||
322 | continue; | ||
323 | - | ||
324 | +#ifdef HAVE_MSFORMAT | ||
325 | k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options); | ||
326 | +#else | ||
327 | + name = malloc(257); | ||
328 | + device = malloc(257); | ||
329 | + password = malloc(257); | ||
330 | + options = malloc(257); | ||
331 | + k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options); | ||
332 | +#endif /* HAVE_MSFORMAT */ | ||
333 | if (k < 2 || k > 4) { | ||
334 | log_error("Failed to parse /etc/crypttab:%u, ignoring.", n); | ||
335 | r = EXIT_FAILURE; | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd/use-cross-cpp.patch b/meta-systemd/recipes-core/systemd/systemd/use-cross-cpp.patch deleted file mode 100644 index 8a4371ec7..000000000 --- a/meta-systemd/recipes-core/systemd/systemd/use-cross-cpp.patch +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | hardcoding cpp does not work when cross compiling systemd. | ||
2 | since it will use the include headers from host system and | ||
3 | syscalls are different for different architectures. | ||
4 | |||
5 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Index: systemd-187/Makefile.am | ||
10 | =================================================================== | ||
11 | --- systemd-187.orig/Makefile.am 2012-07-29 16:39:57.628405921 -0700 | ||
12 | +++ systemd-187/Makefile.am 2012-07-29 16:40:37.248405921 -0700 | ||
13 | @@ -1026,7 +1026,7 @@ | ||
14 | src/core/syscall-to-name.h | ||
15 | |||
16 | src/core/syscall-list.txt: Makefile | ||
17 | - $(AM_V_GEN)cpp $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@ | ||
18 | + $(AM_V_GEN)$(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include sys/syscall.h < /dev/null | $(AWK) '/^#define[ \t]+__NR_[^ ]+[ \t]+[0-9]/ { sub(/__NR_/, "", $$2); print $$2; }' > $@ | ||
19 | |||
20 | src/core/syscall-from-name.gperf: src/core/syscall-list.txt Makefile | ||
21 | $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct syscall_name { const char* name; int id; };"; print "%null-strings"; print "%%";} { printf "%s, __NR_%s\n", $$1, $$1 }' < $< > $@ | ||
22 | @@ -2199,7 +2199,7 @@ | ||
23 | |||
24 | src/udev/keymap/keys.txt: Makefile | ||
25 | $(AM_V_at)mkdir -p src/udev/keymap | ||
26 | - $(AM_V_GEN)cpp $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@ | ||
27 | + $(AM_V_GEN)$(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM -include linux/input.h < /dev/null | $(AWK) '/^#define[ \t]+KEY_[^ ]+[ \t]+[0-9]/ { if ($$2 != "KEY_MAX") { print $$2 } }' | sed 's/^KEY_COFFEE$$/KEY_SCREENLOCK/' > $@ | ||
28 | |||
29 | src/udev/keymap/keys-from-name.gperf: src/udev/keymap/keys.txt Makefile | ||
30 | $(AM_V_GEN)$(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@ | ||
diff --git a/meta-systemd/recipes-core/systemd/systemd_git.bb b/meta-systemd/recipes-core/systemd/systemd_git.bb index 549651268..09bc6357c 100644 --- a/meta-systemd/recipes-core/systemd/systemd_git.bb +++ b/meta-systemd/recipes-core/systemd/systemd_git.bb | |||
@@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ | |||
8 | 8 | ||
9 | PROVIDES = "udev" | 9 | PROVIDES = "udev" |
10 | 10 | ||
11 | DEPENDS = "xz kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers usbutils glib-2.0" | 11 | DEPENDS = "xz kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers usbutils glib-2.0 libgcrypt" |
12 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | 12 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" |
13 | 13 | ||
14 | SERIAL_CONSOLE ?= "115200 /dev/ttyS0" | 14 | SERIAL_CONSOLE ?= "115200 /dev/ttyS0" |
@@ -19,15 +19,14 @@ inherit gitpkgv | |||
19 | PKGV = "v${GITPKGVTAG}" | 19 | PKGV = "v${GITPKGVTAG}" |
20 | 20 | ||
21 | PV = "git" | 21 | PV = "git" |
22 | PR = "r5" | 22 | PR = "r6" |
23 | 23 | ||
24 | inherit useradd pkgconfig autotools perlnative | 24 | inherit useradd pkgconfig autotools perlnative |
25 | 25 | ||
26 | SRCREV = "3fd89536883ea9e24e69f28de0d11cd7cffb42ce" | 26 | SRCREV = "38a60d7112d33ffd596b23e8df53d75a7c09e71b" |
27 | 27 | ||
28 | SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \ | 28 | SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \ |
29 | file://use-rootlibdir.patch \ | 29 | file://use-rootlibdir.patch \ |
30 | file://use-cross-cpp.patch \ | ||
31 | file://gtk-doc.make \ | 30 | file://gtk-doc.make \ |
32 | file://touchscreen.rules \ | 31 | file://touchscreen.rules \ |
33 | file://modprobe.rules \ | 32 | file://modprobe.rules \ |
@@ -35,7 +34,12 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;protocol=git \ | |||
35 | ${UCLIBCPATCHES} \ | 34 | ${UCLIBCPATCHES} \ |
36 | " | 35 | " |
37 | UCLIBCPATCHES = "" | 36 | UCLIBCPATCHES = "" |
38 | UCLIBCPATCHES_libc-uclibc = "file://paper-over-mkostemp.patch \ | 37 | UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \ |
38 | file://systemd-pam-fix-execvpe.patch \ | ||
39 | file://systemd-pam-fix-fallocate.patch \ | ||
40 | file://systemd-pam-fix-getty-unit.patch \ | ||
41 | file://systemd-pam-fix-mkostemp.patch \ | ||
42 | file://systemd-pam-fix-msformat.patch \ | ||
39 | " | 43 | " |
40 | LDFLAGS_libc-uclibc_append = " -lrt" | 44 | LDFLAGS_libc-uclibc_append = " -lrt" |
41 | 45 | ||