summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2014-03-15 22:42:32 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-19 14:19:07 +0000
commit2c1047310970d3074f15fd20c8ccd58ba916a52f (patch)
tree3b64ea6ebdfaaa712829cf29d70b901bb496bb15 /meta/recipes-core
parentac4ff568f5b2ad4f50a1b7b60797e7b797c314bb (diff)
downloadpoky-2c1047310970d3074f15fd20c8ccd58ba916a52f.tar.gz
Upgrade to systemd 211+
Fixes [YOCTO #5940] Fix checks for %ms format to be a link time check runtime checks wont work in cross compiling Add a patch to workaround missing _SC_PHYS_PAGES in uclibc (From OE-Core rev: 0f5256d4ae5ed88c62e737e3c31587d7635b5dd6) Signed-off-by: Khem Raj <raj.khem@gmail.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-uClibc-doesn-t-implement-pwritev-preadv.patch15
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch25
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch22
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch16
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch20
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch166
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch348
-rw-r--r--meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch37
-rw-r--r--meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch19
-rw-r--r--meta/recipes-core/systemd/systemd_211.bb (renamed from meta/recipes-core/systemd/systemd_208.bb)31
10 files changed, 136 insertions, 563 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
index e204a5063e..9fdb3c9ab3 100644
--- a/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
+++ b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
@@ -12,11 +12,11 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
12 src/libsystemd-bus/test-bus-memfd.c | 2 ++ 12 src/libsystemd-bus/test-bus-memfd.c | 2 ++
13 1 file changed, 2 insertions(+) 13 1 file changed, 2 insertions(+)
14 14
15diff --git a/src/libsystemd-bus/test-bus-memfd.c b/src/libsystemd-bus/test-bus-memfd.c 15Index: systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c
16index 05ef555..45e5e44 100644 16===================================================================
17--- a/src/libsystemd-bus/test-bus-memfd.c 17--- systemd-209.orig/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 15:03:09.983254602 -0800
18+++ b/src/libsystemd-bus/test-bus-memfd.c 18+++ systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 23:42:10.636652864 -0800
19@@ -145,6 +145,7 @@ int main(int argc, char *argv[]) { 19@@ -151,6 +151,7 @@
20 /* check content */ 20 /* check content */
21 assert_se(memcmp(buf, "ll", 2) == 0); 21 assert_se(memcmp(buf, "ll", 2) == 0);
22 22
@@ -24,7 +24,7 @@ index 05ef555..45e5e44 100644
24 /* writev it out*/ 24 /* writev it out*/
25 iov[0].iov_base = (char *)"ABC"; 25 iov[0].iov_base = (char *)"ABC";
26 iov[0].iov_len = 3; 26 iov[0].iov_len = 3;
27@@ -167,6 +168,7 @@ int main(int argc, char *argv[]) { 27@@ -173,6 +174,7 @@
28 assert_se(memcmp(bufv[0], "ABC", 3) == 0); 28 assert_se(memcmp(bufv[0], "ABC", 3) == 0);
29 assert_se(memcmp(bufv[1], "DEF", 3) == 0); 29 assert_se(memcmp(bufv[1], "DEF", 3) == 0);
30 assert_se(memcmp(bufv[2], "GHI", 3) == 0); 30 assert_se(memcmp(bufv[2], "GHI", 3) == 0);
@@ -32,6 +32,3 @@ index 05ef555..45e5e44 100644
32 32
33 sd_memfd_free(m); 33 sd_memfd_free(m);
34 34
35--
361.8.3.4
37
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
index d096983837..4639532236 100644
--- a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
@@ -1,11 +1,13 @@
1Upstream-Status: Denied [no desire for uclibc support] 1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com> 2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 3
4--- systemd-185.orig/configure.ac 2012-06-04 14:15:16.000000000 -0400 4Index: git/configure.ac
5+++ systemd-pam-185/configure.ac 2012-06-21 22:57:10.000000000 -0400 5===================================================================
6@@ -63,6 +63,23 @@ 6--- git.orig/configure.ac 2014-03-15 17:53:51.756340454 -0700
7+++ git/configure.ac 2014-03-15 18:07:34.888355897 -0700
8@@ -78,6 +78,24 @@
7 9
8 AC_PATH_PROG([M4], [m4]) 10 M4_DEFINES=
9 11
10+# check for few functions not implemented in uClibc 12+# check for few functions not implemented in uClibc
11+ 13+
@@ -15,15 +17,16 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15+ 17+
16+AC_MSG_CHECKING([whether %ms format is supported by *scanf]) 18+AC_MSG_CHECKING([whether %ms format is supported by *scanf])
17+ 19+
18+AC_RUN_IFELSE( 20+AC_LINK_IFELSE(
19+ [AC_LANG_PROGRAM([[ include <stdio.h> ]], 21+ [AC_LANG_PROGRAM([
20+ [[ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ; 22+ #include <stdio.h>
21+ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ; 23+ ],[
22+ return (rc==3)?0:1;]])], 24+ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
25+ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
26+ return (rc==3)?0:1;])],
23+ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])], 27+ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
24+ [AC_MSG_RESULT([no])],
25+ [AC_MSG_RESULT([no])]) 28+ [AC_MSG_RESULT([no])])
26+ 29+
27 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line 30 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
28 m4_ifdef([GTK_DOC_CHECK], [ 31 m4_ifdef([GTK_DOC_CHECK], [
29 GTK_DOC_CHECK([1.18],[--flavour no-tmpl]) 32 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
index 1d4f2732c4..7170a38af3 100644
--- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
@@ -1,11 +1,11 @@
1Upstream-Status: Denied [no desire for uclibc support] 1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com> 2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 3
4Index: git/src/nspawn/nspawn.c 4Index: systemd-209/src/nspawn/nspawn.c
5=================================================================== 5===================================================================
6--- git.orig/src/nspawn/nspawn.c 2012-09-22 17:57:05.000000000 -0700 6--- systemd-209.orig/src/nspawn/nspawn.c 2014-02-19 15:03:09.000000000 -0800
7+++ git/src/nspawn/nspawn.c 2012-09-22 18:01:41.541405768 -0700 7+++ systemd-209/src/nspawn/nspawn.c 2014-02-19 23:20:38.720628627 -0800
8@@ -63,6 +63,8 @@ 8@@ -91,6 +91,8 @@
9 LINK_GUEST 9 LINK_GUEST
10 } LinkJournal; 10 } LinkJournal;
11 11
@@ -13,17 +13,17 @@ Index: git/src/nspawn/nspawn.c
13+ 13+
14 static char *arg_directory = NULL; 14 static char *arg_directory = NULL;
15 static char *arg_user = NULL; 15 static char *arg_user = NULL;
16 static char **arg_controllers = NULL; 16 static sd_id128_t arg_uuid = {};
17@@ -1373,7 +1375,12 @@ 17@@ -2045,7 +2047,12 @@
18 a[0] = (char*) "/sbin/init"; 18 a[0] = (char*) "/sbin/init";
19 execve(a[0], a, (char**) envp); 19 execve(a[0], a, env_use);
20 } else if (argc > optind) 20 } else if (argc > optind)
21+#ifdef HAVE_EXECVPE 21+#ifdef HAVE_EXECVPE
22 execvpe(argv[optind], argv + optind, (char**) envp); 22 execvpe(argv[optind], argv + optind, env_use);
23+#else 23+#else
24+ environ = (char **)envp; 24+ environ = env_use;
25+ execvp(argv[optind], argv + optind); 25+ execvp(argv[optind], argv + optind);
26+#endif /* HAVE_EXECVPE */ 26+#endif /* HAVE_EXECVPE */
27 else { 27 else {
28 chdir(home ? home : "/root"); 28 chdir(home ? home : "/root");
29 execle("/bin/bash", "-bash", NULL, (char**) envp); 29 execle("/bin/bash", "-bash", NULL, env_use);
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
index 05223d3d6e..de73be96a7 100644
--- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
@@ -1,10 +1,10 @@
1Upstream-Status: Denied [no desire for uclibc support] 1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com> 2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 3
4Index: git/src/journal/journal-file.c 4Index: systemd-209/src/journal/journal-file.c
5=================================================================== 5===================================================================
6--- git.orig/src/journal/journal-file.c 2014-03-02 16:25:38.000000000 -0800 6--- systemd-209.orig/src/journal/journal-file.c 2014-02-12 18:42:33.000000000 -0800
7+++ git/src/journal/journal-file.c 2014-03-02 16:27:24.151238740 -0800 7+++ systemd-209/src/journal/journal-file.c 2014-02-19 23:23:19.464631643 -0800
8@@ -38,6 +38,8 @@ 8@@ -38,6 +38,8 @@
9 #include "compress.h" 9 #include "compress.h"
10 #include "fsprg.h" 10 #include "fsprg.h"
@@ -48,11 +48,11 @@ Index: git/src/journal/journal-file.c
48 48
49 if (fstat(f->fd, &f->last_stat) < 0) 49 if (fstat(f->fd, &f->last_stat) < 0)
50 return -errno; 50 return -errno;
51Index: git/src/journal/journald-kmsg.c 51Index: systemd-209/src/journal/journald-kmsg.c
52=================================================================== 52===================================================================
53--- git.orig/src/journal/journald-kmsg.c 2014-03-02 16:25:38.000000000 -0800 53--- systemd-209.orig/src/journal/journald-kmsg.c 2014-02-19 15:03:09.000000000 -0800
54+++ git/src/journal/journald-kmsg.c 2014-03-02 16:26:35.419237826 -0800 54+++ systemd-209/src/journal/journald-kmsg.c 2014-02-19 23:22:14.396630422 -0800
55@@ -408,6 +408,7 @@ 55@@ -441,6 +441,7 @@
56 56
57 int server_open_kernel_seqnum(Server *s) { 57 int server_open_kernel_seqnum(Server *s) {
58 int fd; 58 int fd;
@@ -60,7 +60,7 @@ Index: git/src/journal/journald-kmsg.c
60 uint64_t *p; 60 uint64_t *p;
61 61
62 assert(s); 62 assert(s);
63@@ -421,8 +422,19 @@ 63@@ -454,8 +455,19 @@
64 log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); 64 log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m");
65 return 0; 65 return 0;
66 } 66 }
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch
index ceb8483624..9b4c940984 100644
--- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch
@@ -7,29 +7,29 @@ Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
7 units/serial-getty@.service.m4 | 2 +- 7 units/serial-getty@.service.m4 | 2 +-
8 2 files changed, 2 insertions(+), 2 deletions(-) 8 2 files changed, 2 insertions(+), 2 deletions(-)
9 9
10Index: systemd-206/units/getty@.service.m4 10Index: git/units/getty@.service.m4
11=================================================================== 11===================================================================
12--- systemd-206.orig/units/getty@.service.m4 2013-07-21 15:43:28.000000000 -0700 12--- git.orig/units/getty@.service.m4 2014-03-15 08:16:17.000000000 -0700
13+++ systemd-206/units/getty@.service.m4 2013-08-21 08:45:48.569886828 -0700 13+++ git/units/getty@.service.m4 2014-03-15 08:21:11.007695825 -0700
14@@ -27,7 +27,7 @@ 14@@ -27,7 +27,7 @@
15 15
16 [Service] 16 [Service]
17 # the VT is cleared by TTYVTDisallocate 17 # the VT is cleared by TTYVTDisallocate
18-ExecStart=-/sbin/agetty --noclear %I 18-ExecStart=-/sbin/agetty --noclear %I $TERM
19+ExecStart=-/sbin/getty -L %I 19+ExecStart=-/sbin/getty -L %I $TERM
20 Type=idle 20 Type=idle
21 Restart=always 21 Restart=always
22 RestartSec=0 22 RestartSec=0
23Index: systemd-206/units/serial-getty@.service.m4 23Index: git/units/serial-getty@.service.m4
24=================================================================== 24===================================================================
25--- systemd-206.orig/units/serial-getty@.service.m4 2013-07-21 15:43:28.000000000 -0700 25--- git.orig/units/serial-getty@.service.m4 2014-03-15 08:16:17.000000000 -0700
26+++ systemd-206/units/serial-getty@.service.m4 2013-08-21 08:48:52.337890275 -0700 26+++ git/units/serial-getty@.service.m4 2014-03-15 08:22:31.291697331 -0700
27@@ -22,7 +22,7 @@ 27@@ -22,7 +22,7 @@
28 IgnoreOnIsolate=yes 28 IgnoreOnIsolate=yes
29 29
30 [Service] 30 [Service]
31-ExecStart=-/sbin/agetty --keep-baud %I 115200,38400,9600 31-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
32+ExecStart=-/sbin/getty -L %I 115200 32+ExecStart=-/sbin/getty -L 115200 %I $TERM
33 Type=idle 33 Type=idle
34 Restart=always 34 Restart=always
35 RestartSec=0 35 RestartSec=0
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
index 99ea5736bc..8c7aa072da 100644
--- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
@@ -1,170 +1,30 @@
1Upstream-Status: Denied [no desire for uclibc support] 1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com> 2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3 3
4Index: systemd-206/src/journal/journal-send.c 4Index: git/src/shared/util.c
5=================================================================== 5===================================================================
6--- systemd-206.orig/src/journal/journal-send.c 2013-07-21 15:43:28.000000000 -0700 6--- git.orig/src/shared/util.c 2014-03-15 15:14:21.368160908 -0700
7+++ systemd-206/src/journal/journal-send.c 2013-08-21 08:50:50.825892498 -0700 7+++ git/src/shared/util.c 2014-03-15 15:44:21.988194688 -0700
8@@ -46,6 +46,8 @@ 8@@ -85,6 +85,8 @@
9 memcpy(*_f + 10, _func, _fl); \ 9 #include "def.h"
10 } while(false) 10 #include "missing.h"
11
12+#include "config.h"
13+
14 /* We open a single fd, and we'll share it with the current process,
15 * all its threads, and all its subprocesses. This means we need to
16 * initialize it atomically, and need to operate on it atomically
17@@ -311,8 +313,13 @@
18 /* Message doesn't fit... Let's dump the data in a temporary
19 * file and just pass a file descriptor of it to the other
20 * side */
21-
22+#ifdef HAVE_MKOSTEMP
23 buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR);
24+#else
25+ buffer_fd = mkstemp(path);
26+ if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC);
27+#endif /* HAVE_MKOSTEMP */
28+
29 if (buffer_fd < 0)
30 return -errno;
31
32Index: systemd-206/src/core/manager.c
33===================================================================
34--- systemd-206.orig/src/core/manager.c 2013-07-21 15:43:28.000000000 -0700
35+++ systemd-206/src/core/manager.c 2013-08-21 08:51:35.209893331 -0700
36@@ -71,6 +71,7 @@
37 #include "audit-fd.h"
38 #include "efivars.h"
39 #include "env-util.h"
40+#include "config.h"
41
42 /* As soon as 5s passed since a unit was added to our GC queue, make sure to run a gc sweep */
43 #define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC)
44@@ -2058,7 +2059,12 @@
45 return -ENOMEM;
46
47 RUN_WITH_UMASK(0077) {
48+#ifdef HAVE_MKOSTEMP
49 fd = mkostemp(path, O_RDWR|O_CLOEXEC);
50+#else
51+ fd = mkstemp(path);
52+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
53+#endif /* HAVE_MKOSTEMP */
54 }
55
56 if (fd < 0) {
57Index: systemd-206/src/shared/util.c
58===================================================================
59--- systemd-206.orig/src/shared/util.c 2013-07-21 15:43:28.000000000 -0700
60+++ systemd-206/src/shared/util.c 2013-08-21 08:50:50.829892498 -0700
61@@ -74,6 +74,8 @@
62 #include "env-util.h"
63 #include "fileio.h"
64 11
65+#include "config.h" 12+#include "config.h"
66+ 13+
67 int saved_argc = 0; 14 int saved_argc = 0;
68 char **saved_argv = NULL; 15 char **saved_argv = NULL;
69 16
70@@ -3980,7 +3982,12 @@ 17@@ -6222,7 +6224,13 @@
71 t[k] = '.';
72 stpcpy(stpcpy(t+k+1, fn), "XXXXXX");
73
74+#ifdef HAVE_MKOSTEMP
75 fd = mkostemp(t, O_WRONLY|O_CLOEXEC);
76+#else
77+ fd = mkstemp(t);
78+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
79+#endif /* HAVE_MKOSTEMP */
80 if (fd < 0) {
81 free(t);
82 return -errno;
83Index: systemd-206/src/shared/ask-password-api.c
84===================================================================
85--- systemd-206.orig/src/shared/ask-password-api.c 2013-07-21 15:43:28.000000000 -0700
86+++ systemd-206/src/shared/ask-password-api.c 2013-08-21 08:50:50.829892498 -0700
87@@ -37,6 +37,8 @@
88
89 #include "ask-password-api.h"
90
91+#include "config.h"
92+
93 static void backspace_chars(int ttyfd, size_t p) {
94 18
95 if (ttyfd < 0) 19 u = umask(077);
96@@ -325,7 +327,12 @@
97 mkdir_p_label("/run/systemd/ask-password", 0755);
98 20
99 RUN_WITH_UMASK(0022) {
100+#ifdef HAVE_MKOSTEMP 21+#ifdef HAVE_MKOSTEMP
101 fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY); 22 fd = mkostemp(pattern, flags);
102+#else 23+#else
103+ fd = mkstemp(temp); 24+ fd = mkstemp(pattern);
104+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); 25+ if (fd >= 0) fcntl(fd, F_SETFD, flags);
105+#endif /* HAVE_MKOSTEMP */
106 }
107
108 if (fd < 0) {
109Index: systemd-206/src/journal/journalctl.c
110===================================================================
111--- systemd-206.orig/src/journal/journalctl.c 2013-07-21 15:43:28.000000000 -0700
112+++ systemd-206/src/journal/journalctl.c 2013-08-21 08:50:50.833892498 -0700
113@@ -1005,7 +1005,13 @@
114 n /= arg_interval;
115
116 close_nointr_nofail(fd);
117+#ifdef HAVE_MKOSTEMP
118 fd = mkostemp(k, O_WRONLY|O_CLOEXEC|O_NOCTTY);
119+#else
120+ fd = mkstemp(k);
121+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
122+#endif /* HAVE_MKOSTEMP */ 26+#endif /* HAVE_MKOSTEMP */
123+ 27+
124 if (fd < 0) { 28 if (fd < 0)
125 log_error("Failed to open %s: %m", k); 29 return -errno;
126 r = -errno;
127Index: systemd-206/src/journal/journal-verify.c
128===================================================================
129--- systemd-206.orig/src/journal/journal-verify.c 2013-07-21 15:43:28.000000000 -0700
130+++ systemd-206/src/journal/journal-verify.c 2013-08-21 08:50:50.833892498 -0700
131@@ -811,8 +811,12 @@
132 #endif
133 } else if (f->seal)
134 return -ENOKEY;
135-
136+#ifdef HAVE_MKOSTEMP
137 data_fd = mkostemp(data_path, O_CLOEXEC);
138+#else
139+ data_fd = mkstemp(data_path);
140+ if (data_fd >= 0) fcntl(data_fd, F_SETFD, FD_CLOEXEC);
141+#endif /* HAVE_MKOSTEMP */
142 if (data_fd < 0) {
143 log_error("Failed to create data file: %m");
144 r = -errno;
145@@ -820,7 +824,12 @@
146 }
147 unlink(data_path);
148
149+#ifdef HAVE_MKOSTEMP
150 entry_fd = mkostemp(entry_path, O_CLOEXEC);
151+#else
152+ entry_fd = mkstemp(entry_path);
153+ if (entry_fd >= 0) fcntl(entry_fd, F_SETFD, FD_CLOEXEC);
154+#endif /* HAVE_MKOSTEMP */
155 if (entry_fd < 0) {
156 log_error("Failed to create entry file: %m");
157 r = -errno;
158@@ -828,7 +837,12 @@
159 }
160 unlink(entry_path);
161 30
162+#ifdef HAVE_MKOSTEMP
163 entry_array_fd = mkostemp(entry_array_path, O_CLOEXEC);
164+#else
165+ entry_array_fd = mkstemp(entry_array_path);
166+ if (entry_array_fd >= 0) fcntl(entry_array_fd, F_SETFD, FD_CLOEXEC);
167+#endif /* HAVE_MKOSTEMP */
168 if (entry_array_fd < 0) {
169 log_error("Failed to create entry array file: %m");
170 r = -errno;
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
deleted file mode 100644
index e8a9144d86..0000000000
--- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
+++ /dev/null
@@ -1,348 +0,0 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-208/src/fsck/fsck.c
5===================================================================
6--- systemd-208.orig/src/fsck/fsck.c 2013-08-13 13:02:46.000000000 -0700
7+++ systemd-208/src/fsck/fsck.c 2013-11-05 22:01:26.776490078 -0800
8@@ -37,6 +37,8 @@
9 #include "virt.h"
10 #include "fileio.h"
11
12+#include "config.h"
13+
14 static bool arg_skip = false;
15 static bool arg_force = false;
16 static bool arg_show_progress = false;
17@@ -198,9 +200,16 @@
18 char *device;
19 double p;
20 usec_t t;
21-
22+#ifdef HAVE_MSFORMAT
23 if (fscanf(f, "%i %lu %lu %ms", &pass, &cur, &max, &device) != 4)
24- break;
25+#else
26+ device = malloc(257);
27+ if (fscanf(f, "%i %lu %lu %256s", &pass, &cur, &max, device) != 4) {
28+ free(device);
29+ }
30+
31+#endif /* HAVE_MSFORMAT */
32+ break;
33
34 /* Only show one progress counter at max */
35 if (!locked) {
36Index: systemd-208/src/core/swap.c
37===================================================================
38--- systemd-208.orig/src/core/swap.c 2013-09-26 11:20:30.000000000 -0700
39+++ systemd-208/src/core/swap.c 2013-11-05 22:01:26.776490078 -0800
40@@ -41,6 +41,8 @@
41 #include "path-util.h"
42 #include "virt.h"
43
44+#include "config.h"
45+
46 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
47 [SWAP_DEAD] = UNIT_INACTIVE,
48 [SWAP_ACTIVATING] = UNIT_ACTIVATING,
49@@ -1041,6 +1043,7 @@
50 _cleanup_free_ char *dev = NULL, *d = NULL;
51 int prio = 0, k;
52
53+#ifdef HAVE_MSFORMAT
54 k = fscanf(m->proc_swaps,
55 "%ms " /* device/file */
56 "%*s " /* type of swap */
57@@ -1048,6 +1051,16 @@
58 "%*s " /* used */
59 "%i\n", /* priority */
60 &dev, &prio);
61+#else
62+ dev = malloc(257);
63+ k = fscanf(m->proc_swaps,
64+ "%256s "/* device/file */
65+ "%*s " /* type of swap */
66+ "%*s " /* swap size */
67+ "%*s " /* used */
68+ "%i\n", /* priority */
69+ dev, &prio);
70+#endif /* HAVE_MSFORMAT */
71 if (k != 2) {
72 if (k == EOF)
73 break;
74Index: systemd-208/src/core/mount-setup.c
75===================================================================
76--- systemd-208.orig/src/core/mount-setup.c 2013-08-13 13:02:46.000000000 -0700
77+++ systemd-208/src/core/mount-setup.c 2013-11-05 22:01:26.776490078 -0800
78@@ -28,6 +28,7 @@
79 #include <assert.h>
80 #include <unistd.h>
81 #include <ftw.h>
82+#include <linux/fs.h>
83
84 #include "mount-setup.h"
85 #include "dev-setup.h"
86@@ -43,6 +44,8 @@
87 #include "virt.h"
88 #include "efivars.h"
89
90+#include "config.h"
91+
92 #ifndef TTY_GID
93 #define TTY_GID 5
94 #endif
95@@ -233,9 +236,12 @@
96 for (;;) {
97 char *controller;
98 int enabled = 0;
99-
100+#ifdef HAVE_MSFORMAT
101 if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) {
102-
103+#else
104+ controller = malloc(257);
105+ if (fscanf(f, "%256s %*i %*i %i", controller, &enabled) != 2) {
106+#endif /* HAVE_MSFORMAT */
107 if (feof(f))
108 break;
109
110Index: systemd-208/src/core/mount.c
111===================================================================
112--- systemd-208.orig/src/core/mount.c 2013-09-26 11:20:30.000000000 -0700
113+++ systemd-208/src/core/mount.c 2013-11-05 22:07:43.784497482 -0800
114@@ -43,6 +43,8 @@
115 #include "exit-status.h"
116 #include "def.h"
117
118+#include "config.h"
119+
120 static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
121 [MOUNT_DEAD] = UNIT_INACTIVE,
122 [MOUNT_MOUNTING] = UNIT_ACTIVATING,
123@@ -1559,6 +1561,7 @@
124 _cleanup_free_ char *device = NULL, *path = NULL, *options = NULL, *options2 = NULL, *fstype = NULL, *d = NULL, *p = NULL, *o = NULL;
125 int k;
126
127+#ifdef HAVE_MSFORMAT
128 k = fscanf(m->proc_self_mountinfo,
129 "%*s " /* (1) mount id */
130 "%*s " /* (2) parent id */
131@@ -1577,7 +1580,31 @@
132 &fstype,
133 &device,
134 &options2);
135-
136+#else
137+ path = malloc(257);
138+ options = malloc(257);
139+ fstype = malloc(257);
140+ device = malloc(257);
141+ options2 = malloc(257);
142+ k = fscanf(m->proc_self_mountinfo,
143+ "%*s " /* (1) mount id */
144+ "%*s " /* (2) parent id */
145+ "%*s " /* (3) major:minor */
146+ "%*s " /* (4) root */
147+ "%256s " /* (5) mount point */
148+ "%256s" /* (6) mount options */
149+ "%*[^-]" /* (7) optional fields */
150+ "- " /* (8) separator */
151+ "%256s " /* (9) file system type */
152+ "%256s" /* (10) mount source */
153+ "%256s" /* (11) mount options 2 */
154+ "%*[^\n]", /* some rubbish at the end */
155+ path,
156+ options,
157+ fstype,
158+ device,
159+ options2);
160+#endif /* HAVE_MSFORMAT */
161 if (k == EOF)
162 break;
163
164Index: systemd-208/src/core/umount.c
165===================================================================
166--- systemd-208.orig/src/core/umount.c 2013-08-13 13:02:46.000000000 -0700
167+++ systemd-208/src/core/umount.c 2013-11-05 22:01:26.776490078 -0800
168@@ -36,6 +36,8 @@
169 #include "util.h"
170 #include "virt.h"
171
172+#include "config.h"
173+
174 typedef struct MountPoint {
175 char *path;
176 dev_t devnum;
177@@ -75,7 +77,7 @@
178 MountPoint *m;
179
180 path = p = NULL;
181-
182+#ifdef HAVE_MSFORMAT
183 if ((k = fscanf(proc_self_mountinfo,
184 "%*s " /* (1) mount id */
185 "%*s " /* (2) parent id */
186@@ -90,6 +92,23 @@
187 "%*s" /* (11) mount options 2 */
188 "%*[^\n]", /* some rubbish at the end */
189 &path)) != 1) {
190+#else
191+ path = malloc(257);
192+ if ((k = fscanf(proc_self_mountinfo,
193+ "%*s " /* (1) mount id */
194+ "%*s " /* (2) parent id */
195+ "%*s " /* (3) major:minor */
196+ "%*s " /* (4) root */
197+ "%256s " /* (5) mount point */
198+ "%*s" /* (6) mount options */
199+ "%*[^-]" /* (7) optional fields */
200+ "- " /* (8) separator */
201+ "%*s " /* (9) file system type */
202+ "%*s" /* (10) mount source */
203+ "%*s" /* (11) mount options 2 */
204+ "%*[^\n]", /* some rubbish at the end */
205+ path)) != 1) {
206+#endif /* HAVE_MSFORMAT */
207 if (k == EOF)
208 break;
209
210@@ -151,7 +170,7 @@
211 MountPoint *swap;
212 char *dev = NULL, *d;
213 int k;
214-
215+#ifdef HAVE_MSFORMAT
216 if ((k = fscanf(proc_swaps,
217 "%ms " /* device/file */
218 "%*s " /* type of swap */
219@@ -159,7 +178,16 @@
220 "%*s " /* used */
221 "%*s\n", /* priority */
222 &dev)) != 1) {
223-
224+#else
225+ dev = malloc(257);
226+ if ((k = fscanf(proc_swaps,
227+ "%256s " /* device/file */
228+ "%*s " /* type of swap */
229+ "%*s " /* swap size */
230+ "%*s " /* used */
231+ "%*s\n", /* priority */
232+ dev)) != 1) {
233+#endif /* HAVE_MSFORMAT */
234 if (k == EOF)
235 break;
236
237Index: systemd-208/src/shared/socket-util.c
238===================================================================
239--- systemd-208.orig/src/shared/socket-util.c 2013-09-26 11:20:30.000000000 -0700
240+++ systemd-208/src/shared/socket-util.c 2013-11-05 22:01:26.776490078 -0800
241@@ -40,6 +40,8 @@
242 #include "missing.h"
243 #include "fileio.h"
244
245+#include "config.h"
246+
247 int socket_address_parse(SocketAddress *a, const char *s) {
248 int r;
249 char *e, *n;
250@@ -203,8 +205,16 @@
251 a->type = SOCK_RAW;
252
253 errno = 0;
254+#ifdef HAVE_MSFORMAT
255 if (sscanf(s, "%ms %u", &sfamily, &group) < 1)
256- return errno > 0 ? -errno : -EINVAL;
257+ return errno ? -errno : -EINVAL;
258+#else
259+ sfamily = malloc(257);
260+ if (sscanf(s, "%256s %u", sfamily, &group) < 1) {
261+ free(sfamily);
262+ return errno ? -errno : -EINVAL;
263+ }
264+#endif /* HAVE_MSFORMAT */
265
266 family = netlink_family_from_string(sfamily);
267 if (family < 0)
268Index: systemd-208/src/tmpfiles/tmpfiles.c
269===================================================================
270--- systemd-208.orig/src/tmpfiles/tmpfiles.c 2013-09-17 14:55:37.000000000 -0700
271+++ systemd-208/src/tmpfiles/tmpfiles.c 2013-11-05 22:01:26.776490078 -0800
272@@ -53,6 +53,8 @@
273 #include "capability.h"
274 #include "specifier.h"
275
276+#include "config.h"
277+
278 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
279 * them in the file system. This is intended to be used to create
280 * properly owned directories beneath /tmp, /var/tmp, /run, which are
281@@ -1082,6 +1084,7 @@
282 assert(line >= 1);
283 assert(buffer);
284
285+#ifdef HAVE_MSFORMAT
286 r = sscanf(buffer,
287 "%c %ms %ms %ms %ms %ms %n",
288 &type,
289@@ -1091,6 +1094,29 @@
290 &group,
291 &age,
292 &n);
293+#else
294+ i->path = malloc(257);
295+ mode = malloc(257);
296+ user = malloc(257);
297+ group = malloc(257);
298+ age = malloc(257);
299+ r = sscanf(buffer,
300+ "%c "
301+ "%256s "
302+ "%256s "
303+ "%256s "
304+ "%256s "
305+ "%256s "
306+ "%n",
307+ &type,
308+ i->path,
309+ mode,
310+ user,
311+ group,
312+ age,
313+ &n);
314+#endif /* HAVE_MSFORMAT */
315+
316 if (r < 2) {
317 log_error("[%s:%u] Syntax error.", fname, line);
318 return -EIO;
319Index: systemd-208/src/cryptsetup/cryptsetup-generator.c
320===================================================================
321--- systemd-208.orig/src/cryptsetup/cryptsetup-generator.c 2013-09-30 09:57:04.000000000 -0700
322+++ systemd-208/src/cryptsetup/cryptsetup-generator.c 2013-11-05 22:01:26.776490078 -0800
323@@ -31,6 +31,8 @@
324 #include "strv.h"
325 #include "fileio.h"
326
327+#include "config.h"
328+
329 static const char *arg_dest = "/tmp";
330 static bool arg_enabled = true;
331 static bool arg_read_crypttab = true;
332@@ -420,7 +422,16 @@
333 if (*l == '#' || *l == 0)
334 continue;
335
336+#ifdef HAVE_MSFORMAT
337 k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options);
338+#else
339+ name = malloc(257);
340+ device = malloc(257);
341+ password = malloc(257);
342+ options = malloc(257);
343+ k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options);
344+#endif /* HAVE_MSFORMAT */
345+
346 if (k < 2 || k > 4) {
347 log_error("Failed to parse /etc/crypttab:%u, ignoring.", n);
348 r = EXIT_FAILURE;
diff --git a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
new file mode 100644
index 0000000000..39dfc9e2ea
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
@@ -0,0 +1,37 @@
1bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc
2
3Upstream-Status: Inappropriate [uclibc-specific]
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: git/src/shared/util.c
8===================================================================
9--- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700
10+++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700
11@@ -6332,11 +6332,24 @@
12
13 /* We return this as uint64_t in case we are running as 32bit
14 * process on a 64bit kernel with huge amounts of memory */
15-
16+#ifdef __UCLIBC__
17+ char line[128];
18+ FILE *f = fopen("/proc/meminfo", "r");
19+ if (f == NULL)
20+ return 0;
21+ while (!feof(f) && fgets(line, sizeof(line)-1, f)) {
22+ if (sscanf(line, "MemTotal: %l kB", &mem) == 1) {
23+ mem *= 1024;
24+ break;
25+ }
26+ }
27+ fclose(f);
28+ return (uint64_t) mem;
29+#else
30 mem = sysconf(_SC_PHYS_PAGES);
31 assert(mem > 0);
32-
33 return (uint64_t) mem * (uint64_t) page_size();
34+#endif
35 }
36
37 char* mount_test_option(const char *haystack, const char *needle) {
diff --git a/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch
new file mode 100644
index 0000000000..15645dee11
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch
@@ -0,0 +1,19 @@
1Dont include sys/sysinfo.h on uclibc it conflicts with linux/sysinfo.h
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Inappropriate [uclibc specific]
5
6Index: systemd-209/src/readahead/readahead-common.c
7===================================================================
8--- systemd-209.orig/src/readahead/readahead-common.c 2014-02-12 18:42:33.810685053 -0800
9+++ systemd-209/src/readahead/readahead-common.c 2014-02-19 23:49:31.856661142 -0800
10@@ -22,7 +22,9 @@
11 #include <errno.h>
12 #include <stdlib.h>
13 #include <string.h>
14+#ifndef __UCLIBC__
15 #include <sys/sysinfo.h>
16+#endif
17 #include <sys/inotify.h>
18 #include <fcntl.h>
19 #include <sys/mman.h>
diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_211.bb
index 98da15c434..044aab5a00 100644
--- a/meta/recipes-core/systemd/systemd_208.bb
+++ b/meta/recipes-core/systemd/systemd_211.bb
@@ -17,14 +17,22 @@ SECTION = "base/shell"
17 17
18inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest 18inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest
19 19
20SRCREV = "255eb046a7bcb90e60a3a54302bc1250c1aed26a" 20SRCREV = "3a450ec5c6adf3057bcedd6cc19c10617abc35a5"
21 21
22PV = "208+git${SRCPV}" 22PV = "211+git${SRCPV}"
23 23
24SRC_URI = "git://anongit.freedesktop.org/systemd/systemd-stable;branch=v208-stable;protocol=git \ 24SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \
25 file://binfmt-install.patch \ 25 file://binfmt-install.patch \
26 file://systemd-pam-configure-check-uclibc.patch \
27 file://systemd-pam-fix-execvpe.patch \
28 file://systemd-pam-fix-fallocate.patch \
29 file://systemd-pam-fix-mkostemp.patch \
30 file://optional_secure_getenv.patch \
31 file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
32 file://uclibc-sysinfo_h.patch \
33 file://uclibc-get-physmem.patch \
34 \
26 file://touchscreen.rules \ 35 file://touchscreen.rules \
27 ${UCLIBCPATCHES} \
28 file://00-create-volatile.conf \ 36 file://00-create-volatile.conf \
29 file://init \ 37 file://init \
30 file://run-ptest \ 38 file://run-ptest \
@@ -32,17 +40,10 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd-stable;branch=v208-stab
32 40
33S = "${WORKDIR}/git" 41S = "${WORKDIR}/git"
34 42
35UCLIBCPATCHES = "" 43SRC_URI_append_libc-uclibc = "\
36UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \
37 file://systemd-pam-fix-execvpe.patch \
38 file://systemd-pam-fix-fallocate.patch \
39 file://systemd-pam-fix-getty-unit.patch \ 44 file://systemd-pam-fix-getty-unit.patch \
40 file://systemd-pam-fix-mkostemp.patch \
41 file://systemd-pam-fix-msformat.patch \
42 file://optional_secure_getenv.patch \
43 file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
44 " 45 "
45LDFLAGS_libc-uclibc_append = " -lrt" 46LDFLAGS_append_libc-uclibc = " -lrt"
46 47
47GTKDOC_DOCDIR = "${S}/docs/" 48GTKDOC_DOCDIR = "${S}/docs/"
48 49
@@ -74,6 +75,7 @@ EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
74 --disable-manpages \ 75 --disable-manpages \
75 --disable-coredump \ 76 --disable-coredump \
76 --disable-introspection \ 77 --disable-introspection \
78 --disable-kdbus \
77 --enable-split-usr \ 79 --enable-split-usr \
78 --without-python \ 80 --without-python \
79 --with-sysvrcnd-path=${sysconfdir} \ 81 --with-sysvrcnd-path=${sysconfdir} \
@@ -92,6 +94,8 @@ do_configure_prepend() {
92 cp -r ${S}/units ${S}/units.pre_sed 94 cp -r ${S}/units ${S}/units.pre_sed
93 fi 95 fi
94 sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service* 96 sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
97 sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am
98 sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am
95} 99}
96 100
97do_install() { 101do_install() {
@@ -215,6 +219,7 @@ FILES_${PN} = " ${base_bindir}/* \
215 ${libdir}/libnss_myhostname.so.2 \ 219 ${libdir}/libnss_myhostname.so.2 \
216 /cgroup \ 220 /cgroup \
217 ${bindir}/systemd* \ 221 ${bindir}/systemd* \
222 ${bindir}/busctl \
218 ${bindir}/localectl \ 223 ${bindir}/localectl \
219 ${bindir}/hostnamectl \ 224 ${bindir}/hostnamectl \
220 ${bindir}/timedatectl \ 225 ${bindir}/timedatectl \