similarity index 70%
rename from package/systemd/systemd-fix-getty-unit.patch
rename to package/systemd/systemd-01-fix-getty-unit.patch
@@ -6,11 +6,11 @@ Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
units/serial-getty@.service.m4 | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
-Index: systemd-37/units/getty@.service.m4
+Index: b/units/getty@.service.m4
===================================================================
---- systemd-37.orig/units/getty@.service.m4
-+++ systemd-37/units/getty@.service.m4
-@@ -32,7 +32,7 @@
+--- a/units/getty@.service.m4
++++ b/units/getty@.service.m4
+@@ -35,7 +35,7 @@
[Service]
Environment=TERM=linux
@@ -19,11 +19,11 @@ Index: systemd-37/units/getty@.service.m4
Restart=always
RestartSec=0
UtmpIdentifier=%I
-Index: systemd-37/units/serial-getty@.service.m4
+Index: b/units/serial-getty@.service.m4
===================================================================
---- systemd-37.orig/units/serial-getty@.service.m4
-+++ systemd-37/units/serial-getty@.service.m4
-@@ -32,7 +32,7 @@
+--- a/units/serial-getty@.service.m4
++++ b/units/serial-getty@.service.m4
+@@ -35,7 +35,7 @@
[Service]
Environment=TERM=vt100
similarity index 91%
rename from package/systemd/systemd-fix-page-size.patch
rename to package/systemd/systemd-02-fix-page-size.patch
@@ -6,8 +6,8 @@ Date: Wed Mar 21 23:47:44 2012 +0100
Let's use NAME_MAX, as suggested by Dan Walsh
-diff --git a/src/journal/journald.c b/src/journal/journald.c
-index d27cb60..87390bd 100644
+Index: b/src/journal/journald.c
+===================================================================
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -29,7 +29,6 @@
@@ -18,7 +18,7 @@ index d27cb60..87390bd 100644
#include <systemd/sd-journal.h>
#include <systemd/sd-login.h>
-@@ -2149,10 +2148,20 @@ static int process_event(Server *s, struct epoll_event *ev) {
+@@ -2141,10 +2140,20 @@
size_t label_len = 0;
union {
struct cmsghdr cmsghdr;
similarity index 60%
rename from package/systemd/systemd-uclibc-fix.patch
rename to package/systemd/systemd-03-uclibc-fix.patch
@@ -13,18 +13,23 @@ Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
src/macro.h | 15 +++++++++++++++
2 files changed, 17 insertions(+)
-Index: systemd-44/src/macro.h
+Index: b/src/macro.h
===================================================================
---- systemd-44.orig/src/macro.h
-+++ systemd-44/src/macro.h
-@@ -28,6 +28,21 @@
+--- a/src/macro.h
++++ b/src/macro.h
+@@ -28,6 +28,33 @@
#include <sys/uio.h>
#include <inttypes.h>
+#ifdef __UCLIBC__
+/* uclibc does not implement mkostemp GNU extension */
+#define mkostemp(x,y) mkstemp(x)
++/* uclibc may not define MSG_CMSG_CLOEXEC */
++#if defined HAVE_DECL_MSG_CMSG_CLOEXEC && !HAVE_DECL_MSG_CMSG_CLOEXEC
++#define MSG_CMSG_CLOEXEC 0x40000000
++#endif
+/* uclibc does not implement execvpe GNU extension */
++#ifndef HAVE_EXECVPE
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
@@ -35,14 +40,21 @@ Index: systemd-44/src/macro.h
+ environ = (char **)envp;
+ return execvp(file, argv);
+}
-+#endif
++#endif /* HAVE_EXECVPE */
++#ifndef HAVE_DUP3
++#include <asm/unistd.h>
++static inline int dup3(int oldfd, int newfd, int flags) {
++ return syscall(__NR_dup3, oldfd, newfd, flags);
++}
++#endif /* HAVE_DUP3 */
++#endif /* __UCLIBC__ */
#define _printf_attr_(a,b) __attribute__ ((format (printf, a, b)))
#define _sentinel_ __attribute__ ((sentinel))
#define _noreturn_ __attribute__((noreturn))
-Index: systemd-44/src/journal/journal-file.c
+Index: b/src/journal/journal-file.c
===================================================================
---- systemd-44.orig/src/journal/journal-file.c
-+++ systemd-44/src/journal/journal-file.c
+--- a/src/journal/journal-file.c
++++ b/src/journal/journal-file.c
@@ -229,11 +229,13 @@
}
}
@@ -57,3 +69,16 @@ Index: systemd-44/src/journal/journal-file.c
if (fstat(f->fd, &f->last_stat) < 0)
return -errno;
+Index: b/configure.ac
+===================================================================
+--- a/configure.ac
++++ b/configure.ac
+@@ -111,6 +111,8 @@
+
+ AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
+ AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
++AC_CHECK_FUNCS([execvpe dup3])
++AC_CHECK_DECLS([MSG_CMSG_CLOEXEC], [], [], [#include <sys/socket.h>])
+
+ save_LIBS="$LIBS"
+ LIBS=
@@ -22,6 +22,8 @@ ifeq ($(BR2_PACKAGE_BUSYBOX),y)
SYSTEMD_DEPENDENCIES += busybox
endif
+SYSTEMD_AUTORECONF = YES
+
SYSTEMD_CONF_OPT += \
--with-distro=other \
--disable-selinux \