From 0f5256d4ae5ed88c62e737e3c31587d7635b5dd6 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Sat, 15 Mar 2014 22:42:32 -0700 Subject: 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 Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- ...1-uClibc-doesn-t-implement-pwritev-preadv.patch | 15 +- .../systemd-pam-configure-check-uclibc.patch | 25 +- .../systemd/systemd/systemd-pam-fix-execvpe.patch | 22 +- .../systemd/systemd-pam-fix-fallocate.patch | 16 +- .../systemd/systemd-pam-fix-getty-unit.patch | 20 +- .../systemd/systemd/systemd-pam-fix-mkostemp.patch | 166 +--------- .../systemd/systemd/systemd-pam-fix-msformat.patch | 348 -------------------- .../systemd/systemd/uclibc-get-physmem.patch | 37 +++ .../systemd/systemd/uclibc-sysinfo_h.patch | 19 ++ meta/recipes-core/systemd/systemd_208.bb | 347 -------------------- meta/recipes-core/systemd/systemd_211.bb | 352 +++++++++++++++++++++ 11 files changed, 470 insertions(+), 897 deletions(-) delete mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch create mode 100644 meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch create mode 100644 meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch delete mode 100644 meta/recipes-core/systemd/systemd_208.bb create mode 100644 meta/recipes-core/systemd/systemd_211.bb (limited to 'meta/recipes-core') 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 src/libsystemd-bus/test-bus-memfd.c | 2 ++ 1 file changed, 2 insertions(+) -diff --git a/src/libsystemd-bus/test-bus-memfd.c b/src/libsystemd-bus/test-bus-memfd.c -index 05ef555..45e5e44 100644 ---- a/src/libsystemd-bus/test-bus-memfd.c -+++ b/src/libsystemd-bus/test-bus-memfd.c -@@ -145,6 +145,7 @@ int main(int argc, char *argv[]) { +Index: systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c +=================================================================== +--- systemd-209.orig/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 15:03:09.983254602 -0800 ++++ systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 23:42:10.636652864 -0800 +@@ -151,6 +151,7 @@ /* check content */ assert_se(memcmp(buf, "ll", 2) == 0); @@ -24,7 +24,7 @@ index 05ef555..45e5e44 100644 /* writev it out*/ iov[0].iov_base = (char *)"ABC"; iov[0].iov_len = 3; -@@ -167,6 +168,7 @@ int main(int argc, char *argv[]) { +@@ -173,6 +174,7 @@ assert_se(memcmp(bufv[0], "ABC", 3) == 0); assert_se(memcmp(bufv[1], "DEF", 3) == 0); assert_se(memcmp(bufv[2], "GHI", 3) == 0); @@ -32,6 +32,3 @@ index 05ef555..45e5e44 100644 sd_memfd_free(m); --- -1.8.3.4 - 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 @@ Upstream-Status: Denied [no desire for uclibc support] Signed-off-by: Khem Raj ---- systemd-185.orig/configure.ac 2012-06-04 14:15:16.000000000 -0400 -+++ systemd-pam-185/configure.ac 2012-06-21 22:57:10.000000000 -0400 -@@ -63,6 +63,23 @@ +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2014-03-15 17:53:51.756340454 -0700 ++++ git/configure.ac 2014-03-15 18:07:34.888355897 -0700 +@@ -78,6 +78,24 @@ - AC_PATH_PROG([M4], [m4]) + M4_DEFINES= +# check for few functions not implemented in uClibc + @@ -15,15 +17,16 @@ Signed-off-by: Khem Raj + +AC_MSG_CHECKING([whether %ms format is supported by *scanf]) + -+AC_RUN_IFELSE( -+ [AC_LANG_PROGRAM([[ include ]], -+ [[ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ; -+ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ; -+ return (rc==3)?0:1;]])], ++AC_LINK_IFELSE( ++ [AC_LANG_PROGRAM([ ++ #include ++ ],[ ++ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ; ++ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ; ++ return (rc==3)?0:1;])], + [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])], -+ [AC_MSG_RESULT([no])], + [AC_MSG_RESULT([no])]) + # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line m4_ifdef([GTK_DOC_CHECK], [ - GTK_DOC_CHECK([1.18],[--flavour no-tmpl]) + 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 @@ Upstream-Status: Denied [no desire for uclibc support] Signed-off-by: Khem Raj -Index: git/src/nspawn/nspawn.c +Index: systemd-209/src/nspawn/nspawn.c =================================================================== ---- git.orig/src/nspawn/nspawn.c 2012-09-22 17:57:05.000000000 -0700 -+++ git/src/nspawn/nspawn.c 2012-09-22 18:01:41.541405768 -0700 -@@ -63,6 +63,8 @@ +--- systemd-209.orig/src/nspawn/nspawn.c 2014-02-19 15:03:09.000000000 -0800 ++++ systemd-209/src/nspawn/nspawn.c 2014-02-19 23:20:38.720628627 -0800 +@@ -91,6 +91,8 @@ LINK_GUEST } LinkJournal; @@ -13,17 +13,17 @@ Index: git/src/nspawn/nspawn.c + static char *arg_directory = NULL; static char *arg_user = NULL; - static char **arg_controllers = NULL; -@@ -1373,7 +1375,12 @@ + static sd_id128_t arg_uuid = {}; +@@ -2045,7 +2047,12 @@ a[0] = (char*) "/sbin/init"; - execve(a[0], a, (char**) envp); + execve(a[0], a, env_use); } else if (argc > optind) +#ifdef HAVE_EXECVPE - execvpe(argv[optind], argv + optind, (char**) envp); + execvpe(argv[optind], argv + optind, env_use); +#else -+ environ = (char **)envp; ++ environ = env_use; + execvp(argv[optind], argv + optind); -+#endif /* HAVE_EXECVPE */ ++#endif /* HAVE_EXECVPE */ else { chdir(home ? home : "/root"); - execle("/bin/bash", "-bash", NULL, (char**) envp); + 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 @@ Upstream-Status: Denied [no desire for uclibc support] Signed-off-by: Khem Raj -Index: git/src/journal/journal-file.c +Index: systemd-209/src/journal/journal-file.c =================================================================== ---- git.orig/src/journal/journal-file.c 2014-03-02 16:25:38.000000000 -0800 -+++ git/src/journal/journal-file.c 2014-03-02 16:27:24.151238740 -0800 +--- systemd-209.orig/src/journal/journal-file.c 2014-02-12 18:42:33.000000000 -0800 ++++ systemd-209/src/journal/journal-file.c 2014-02-19 23:23:19.464631643 -0800 @@ -38,6 +38,8 @@ #include "compress.h" #include "fsprg.h" @@ -48,11 +48,11 @@ Index: git/src/journal/journal-file.c if (fstat(f->fd, &f->last_stat) < 0) return -errno; -Index: git/src/journal/journald-kmsg.c +Index: systemd-209/src/journal/journald-kmsg.c =================================================================== ---- git.orig/src/journal/journald-kmsg.c 2014-03-02 16:25:38.000000000 -0800 -+++ git/src/journal/journald-kmsg.c 2014-03-02 16:26:35.419237826 -0800 -@@ -408,6 +408,7 @@ +--- systemd-209.orig/src/journal/journald-kmsg.c 2014-02-19 15:03:09.000000000 -0800 ++++ systemd-209/src/journal/journald-kmsg.c 2014-02-19 23:22:14.396630422 -0800 +@@ -441,6 +441,7 @@ int server_open_kernel_seqnum(Server *s) { int fd; @@ -60,7 +60,7 @@ Index: git/src/journal/journald-kmsg.c uint64_t *p; assert(s); -@@ -421,8 +422,19 @@ +@@ -454,8 +455,19 @@ log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); return 0; } 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 units/serial-getty@.service.m4 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -Index: systemd-206/units/getty@.service.m4 +Index: git/units/getty@.service.m4 =================================================================== ---- systemd-206.orig/units/getty@.service.m4 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/units/getty@.service.m4 2013-08-21 08:45:48.569886828 -0700 +--- git.orig/units/getty@.service.m4 2014-03-15 08:16:17.000000000 -0700 ++++ git/units/getty@.service.m4 2014-03-15 08:21:11.007695825 -0700 @@ -27,7 +27,7 @@ [Service] # the VT is cleared by TTYVTDisallocate --ExecStart=-/sbin/agetty --noclear %I -+ExecStart=-/sbin/getty -L %I +-ExecStart=-/sbin/agetty --noclear %I $TERM ++ExecStart=-/sbin/getty -L %I $TERM Type=idle Restart=always RestartSec=0 -Index: systemd-206/units/serial-getty@.service.m4 +Index: git/units/serial-getty@.service.m4 =================================================================== ---- systemd-206.orig/units/serial-getty@.service.m4 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/units/serial-getty@.service.m4 2013-08-21 08:48:52.337890275 -0700 +--- git.orig/units/serial-getty@.service.m4 2014-03-15 08:16:17.000000000 -0700 ++++ git/units/serial-getty@.service.m4 2014-03-15 08:22:31.291697331 -0700 @@ -22,7 +22,7 @@ IgnoreOnIsolate=yes [Service] --ExecStart=-/sbin/agetty --keep-baud %I 115200,38400,9600 -+ExecStart=-/sbin/getty -L %I 115200 +-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM ++ExecStart=-/sbin/getty -L 115200 %I $TERM Type=idle Restart=always 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 @@ Upstream-Status: Denied [no desire for uclibc support] Signed-off-by: Khem Raj -Index: systemd-206/src/journal/journal-send.c +Index: git/src/shared/util.c =================================================================== ---- systemd-206.orig/src/journal/journal-send.c 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/src/journal/journal-send.c 2013-08-21 08:50:50.825892498 -0700 -@@ -46,6 +46,8 @@ - memcpy(*_f + 10, _func, _fl); \ - } while(false) - -+#include "config.h" -+ - /* We open a single fd, and we'll share it with the current process, - * all its threads, and all its subprocesses. This means we need to - * initialize it atomically, and need to operate on it atomically -@@ -311,8 +313,13 @@ - /* Message doesn't fit... Let's dump the data in a temporary - * file and just pass a file descriptor of it to the other - * side */ -- -+#ifdef HAVE_MKOSTEMP - buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR); -+#else -+ buffer_fd = mkstemp(path); -+ if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC); -+#endif /* HAVE_MKOSTEMP */ -+ - if (buffer_fd < 0) - return -errno; - -Index: systemd-206/src/core/manager.c -=================================================================== ---- systemd-206.orig/src/core/manager.c 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/src/core/manager.c 2013-08-21 08:51:35.209893331 -0700 -@@ -71,6 +71,7 @@ - #include "audit-fd.h" - #include "efivars.h" - #include "env-util.h" -+#include "config.h" - - /* As soon as 5s passed since a unit was added to our GC queue, make sure to run a gc sweep */ - #define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC) -@@ -2058,7 +2059,12 @@ - return -ENOMEM; - - RUN_WITH_UMASK(0077) { -+#ifdef HAVE_MKOSTEMP - fd = mkostemp(path, O_RDWR|O_CLOEXEC); -+#else -+ fd = mkstemp(path); -+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); -+#endif /* HAVE_MKOSTEMP */ - } - - if (fd < 0) { -Index: systemd-206/src/shared/util.c -=================================================================== ---- systemd-206.orig/src/shared/util.c 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/src/shared/util.c 2013-08-21 08:50:50.829892498 -0700 -@@ -74,6 +74,8 @@ - #include "env-util.h" - #include "fileio.h" +--- git.orig/src/shared/util.c 2014-03-15 15:14:21.368160908 -0700 ++++ git/src/shared/util.c 2014-03-15 15:44:21.988194688 -0700 +@@ -85,6 +85,8 @@ + #include "def.h" + #include "missing.h" +#include "config.h" + int saved_argc = 0; char **saved_argv = NULL; -@@ -3980,7 +3982,12 @@ - t[k] = '.'; - stpcpy(stpcpy(t+k+1, fn), "XXXXXX"); - -+#ifdef HAVE_MKOSTEMP - fd = mkostemp(t, O_WRONLY|O_CLOEXEC); -+#else -+ fd = mkstemp(t); -+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); -+#endif /* HAVE_MKOSTEMP */ - if (fd < 0) { - free(t); - return -errno; -Index: systemd-206/src/shared/ask-password-api.c -=================================================================== ---- systemd-206.orig/src/shared/ask-password-api.c 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/src/shared/ask-password-api.c 2013-08-21 08:50:50.829892498 -0700 -@@ -37,6 +37,8 @@ - - #include "ask-password-api.h" - -+#include "config.h" -+ - static void backspace_chars(int ttyfd, size_t p) { +@@ -6222,7 +6224,13 @@ - if (ttyfd < 0) -@@ -325,7 +327,12 @@ - mkdir_p_label("/run/systemd/ask-password", 0755); + u = umask(077); - RUN_WITH_UMASK(0022) { +#ifdef HAVE_MKOSTEMP - fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY); + fd = mkostemp(pattern, flags); +#else -+ fd = mkstemp(temp); -+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); -+#endif /* HAVE_MKOSTEMP */ - } - - if (fd < 0) { -Index: systemd-206/src/journal/journalctl.c -=================================================================== ---- systemd-206.orig/src/journal/journalctl.c 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/src/journal/journalctl.c 2013-08-21 08:50:50.833892498 -0700 -@@ -1005,7 +1005,13 @@ - n /= arg_interval; - - close_nointr_nofail(fd); -+#ifdef HAVE_MKOSTEMP - fd = mkostemp(k, O_WRONLY|O_CLOEXEC|O_NOCTTY); -+#else -+ fd = mkstemp(k); -+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC); ++ fd = mkstemp(pattern); ++ if (fd >= 0) fcntl(fd, F_SETFD, flags); +#endif /* HAVE_MKOSTEMP */ + - if (fd < 0) { - log_error("Failed to open %s: %m", k); - r = -errno; -Index: systemd-206/src/journal/journal-verify.c -=================================================================== ---- systemd-206.orig/src/journal/journal-verify.c 2013-07-21 15:43:28.000000000 -0700 -+++ systemd-206/src/journal/journal-verify.c 2013-08-21 08:50:50.833892498 -0700 -@@ -811,8 +811,12 @@ - #endif - } else if (f->seal) - return -ENOKEY; -- -+#ifdef HAVE_MKOSTEMP - data_fd = mkostemp(data_path, O_CLOEXEC); -+#else -+ data_fd = mkstemp(data_path); -+ if (data_fd >= 0) fcntl(data_fd, F_SETFD, FD_CLOEXEC); -+#endif /* HAVE_MKOSTEMP */ - if (data_fd < 0) { - log_error("Failed to create data file: %m"); - r = -errno; -@@ -820,7 +824,12 @@ - } - unlink(data_path); - -+#ifdef HAVE_MKOSTEMP - entry_fd = mkostemp(entry_path, O_CLOEXEC); -+#else -+ entry_fd = mkstemp(entry_path); -+ if (entry_fd >= 0) fcntl(entry_fd, F_SETFD, FD_CLOEXEC); -+#endif /* HAVE_MKOSTEMP */ - if (entry_fd < 0) { - log_error("Failed to create entry file: %m"); - r = -errno; -@@ -828,7 +837,12 @@ - } - unlink(entry_path); + if (fd < 0) + return -errno; -+#ifdef HAVE_MKOSTEMP - entry_array_fd = mkostemp(entry_array_path, O_CLOEXEC); -+#else -+ entry_array_fd = mkstemp(entry_array_path); -+ if (entry_array_fd >= 0) fcntl(entry_array_fd, F_SETFD, FD_CLOEXEC); -+#endif /* HAVE_MKOSTEMP */ - if (entry_array_fd < 0) { - log_error("Failed to create entry array file: %m"); - 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 @@ -Upstream-Status: Denied [no desire for uclibc support] -Signed-off-by: Khem Raj - -Index: systemd-208/src/fsck/fsck.c -=================================================================== ---- systemd-208.orig/src/fsck/fsck.c 2013-08-13 13:02:46.000000000 -0700 -+++ systemd-208/src/fsck/fsck.c 2013-11-05 22:01:26.776490078 -0800 -@@ -37,6 +37,8 @@ - #include "virt.h" - #include "fileio.h" - -+#include "config.h" -+ - static bool arg_skip = false; - static bool arg_force = false; - static bool arg_show_progress = false; -@@ -198,9 +200,16 @@ - char *device; - double p; - usec_t t; -- -+#ifdef HAVE_MSFORMAT - if (fscanf(f, "%i %lu %lu %ms", &pass, &cur, &max, &device) != 4) -- break; -+#else -+ device = malloc(257); -+ if (fscanf(f, "%i %lu %lu %256s", &pass, &cur, &max, device) != 4) { -+ free(device); -+ } -+ -+#endif /* HAVE_MSFORMAT */ -+ break; - - /* Only show one progress counter at max */ - if (!locked) { -Index: systemd-208/src/core/swap.c -=================================================================== ---- systemd-208.orig/src/core/swap.c 2013-09-26 11:20:30.000000000 -0700 -+++ systemd-208/src/core/swap.c 2013-11-05 22:01:26.776490078 -0800 -@@ -41,6 +41,8 @@ - #include "path-util.h" - #include "virt.h" - -+#include "config.h" -+ - static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = { - [SWAP_DEAD] = UNIT_INACTIVE, - [SWAP_ACTIVATING] = UNIT_ACTIVATING, -@@ -1041,6 +1043,7 @@ - _cleanup_free_ char *dev = NULL, *d = NULL; - int prio = 0, k; - -+#ifdef HAVE_MSFORMAT - k = fscanf(m->proc_swaps, - "%ms " /* device/file */ - "%*s " /* type of swap */ -@@ -1048,6 +1051,16 @@ - "%*s " /* used */ - "%i\n", /* priority */ - &dev, &prio); -+#else -+ dev = malloc(257); -+ k = fscanf(m->proc_swaps, -+ "%256s "/* device/file */ -+ "%*s " /* type of swap */ -+ "%*s " /* swap size */ -+ "%*s " /* used */ -+ "%i\n", /* priority */ -+ dev, &prio); -+#endif /* HAVE_MSFORMAT */ - if (k != 2) { - if (k == EOF) - break; -Index: systemd-208/src/core/mount-setup.c -=================================================================== ---- systemd-208.orig/src/core/mount-setup.c 2013-08-13 13:02:46.000000000 -0700 -+++ systemd-208/src/core/mount-setup.c 2013-11-05 22:01:26.776490078 -0800 -@@ -28,6 +28,7 @@ - #include - #include - #include -+#include - - #include "mount-setup.h" - #include "dev-setup.h" -@@ -43,6 +44,8 @@ - #include "virt.h" - #include "efivars.h" - -+#include "config.h" -+ - #ifndef TTY_GID - #define TTY_GID 5 - #endif -@@ -233,9 +236,12 @@ - for (;;) { - char *controller; - int enabled = 0; -- -+#ifdef HAVE_MSFORMAT - if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) { -- -+#else -+ controller = malloc(257); -+ if (fscanf(f, "%256s %*i %*i %i", controller, &enabled) != 2) { -+#endif /* HAVE_MSFORMAT */ - if (feof(f)) - break; - -Index: systemd-208/src/core/mount.c -=================================================================== ---- systemd-208.orig/src/core/mount.c 2013-09-26 11:20:30.000000000 -0700 -+++ systemd-208/src/core/mount.c 2013-11-05 22:07:43.784497482 -0800 -@@ -43,6 +43,8 @@ - #include "exit-status.h" - #include "def.h" - -+#include "config.h" -+ - static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = { - [MOUNT_DEAD] = UNIT_INACTIVE, - [MOUNT_MOUNTING] = UNIT_ACTIVATING, -@@ -1559,6 +1561,7 @@ - _cleanup_free_ char *device = NULL, *path = NULL, *options = NULL, *options2 = NULL, *fstype = NULL, *d = NULL, *p = NULL, *o = NULL; - int k; - -+#ifdef HAVE_MSFORMAT - k = fscanf(m->proc_self_mountinfo, - "%*s " /* (1) mount id */ - "%*s " /* (2) parent id */ -@@ -1577,7 +1580,31 @@ - &fstype, - &device, - &options2); -- -+#else -+ path = malloc(257); -+ options = malloc(257); -+ fstype = malloc(257); -+ device = malloc(257); -+ options2 = malloc(257); -+ k = fscanf(m->proc_self_mountinfo, -+ "%*s " /* (1) mount id */ -+ "%*s " /* (2) parent id */ -+ "%*s " /* (3) major:minor */ -+ "%*s " /* (4) root */ -+ "%256s " /* (5) mount point */ -+ "%256s" /* (6) mount options */ -+ "%*[^-]" /* (7) optional fields */ -+ "- " /* (8) separator */ -+ "%256s " /* (9) file system type */ -+ "%256s" /* (10) mount source */ -+ "%256s" /* (11) mount options 2 */ -+ "%*[^\n]", /* some rubbish at the end */ -+ path, -+ options, -+ fstype, -+ device, -+ options2); -+#endif /* HAVE_MSFORMAT */ - if (k == EOF) - break; - -Index: systemd-208/src/core/umount.c -=================================================================== ---- systemd-208.orig/src/core/umount.c 2013-08-13 13:02:46.000000000 -0700 -+++ systemd-208/src/core/umount.c 2013-11-05 22:01:26.776490078 -0800 -@@ -36,6 +36,8 @@ - #include "util.h" - #include "virt.h" - -+#include "config.h" -+ - typedef struct MountPoint { - char *path; - dev_t devnum; -@@ -75,7 +77,7 @@ - MountPoint *m; - - path = p = NULL; -- -+#ifdef HAVE_MSFORMAT - if ((k = fscanf(proc_self_mountinfo, - "%*s " /* (1) mount id */ - "%*s " /* (2) parent id */ -@@ -90,6 +92,23 @@ - "%*s" /* (11) mount options 2 */ - "%*[^\n]", /* some rubbish at the end */ - &path)) != 1) { -+#else -+ path = malloc(257); -+ if ((k = fscanf(proc_self_mountinfo, -+ "%*s " /* (1) mount id */ -+ "%*s " /* (2) parent id */ -+ "%*s " /* (3) major:minor */ -+ "%*s " /* (4) root */ -+ "%256s " /* (5) mount point */ -+ "%*s" /* (6) mount options */ -+ "%*[^-]" /* (7) optional fields */ -+ "- " /* (8) separator */ -+ "%*s " /* (9) file system type */ -+ "%*s" /* (10) mount source */ -+ "%*s" /* (11) mount options 2 */ -+ "%*[^\n]", /* some rubbish at the end */ -+ path)) != 1) { -+#endif /* HAVE_MSFORMAT */ - if (k == EOF) - break; - -@@ -151,7 +170,7 @@ - MountPoint *swap; - char *dev = NULL, *d; - int k; -- -+#ifdef HAVE_MSFORMAT - if ((k = fscanf(proc_swaps, - "%ms " /* device/file */ - "%*s " /* type of swap */ -@@ -159,7 +178,16 @@ - "%*s " /* used */ - "%*s\n", /* priority */ - &dev)) != 1) { -- -+#else -+ dev = malloc(257); -+ if ((k = fscanf(proc_swaps, -+ "%256s " /* device/file */ -+ "%*s " /* type of swap */ -+ "%*s " /* swap size */ -+ "%*s " /* used */ -+ "%*s\n", /* priority */ -+ dev)) != 1) { -+#endif /* HAVE_MSFORMAT */ - if (k == EOF) - break; - -Index: systemd-208/src/shared/socket-util.c -=================================================================== ---- systemd-208.orig/src/shared/socket-util.c 2013-09-26 11:20:30.000000000 -0700 -+++ systemd-208/src/shared/socket-util.c 2013-11-05 22:01:26.776490078 -0800 -@@ -40,6 +40,8 @@ - #include "missing.h" - #include "fileio.h" - -+#include "config.h" -+ - int socket_address_parse(SocketAddress *a, const char *s) { - int r; - char *e, *n; -@@ -203,8 +205,16 @@ - a->type = SOCK_RAW; - - errno = 0; -+#ifdef HAVE_MSFORMAT - if (sscanf(s, "%ms %u", &sfamily, &group) < 1) -- return errno > 0 ? -errno : -EINVAL; -+ return errno ? -errno : -EINVAL; -+#else -+ sfamily = malloc(257); -+ if (sscanf(s, "%256s %u", sfamily, &group) < 1) { -+ free(sfamily); -+ return errno ? -errno : -EINVAL; -+ } -+#endif /* HAVE_MSFORMAT */ - - family = netlink_family_from_string(sfamily); - if (family < 0) -Index: systemd-208/src/tmpfiles/tmpfiles.c -=================================================================== ---- systemd-208.orig/src/tmpfiles/tmpfiles.c 2013-09-17 14:55:37.000000000 -0700 -+++ systemd-208/src/tmpfiles/tmpfiles.c 2013-11-05 22:01:26.776490078 -0800 -@@ -53,6 +53,8 @@ - #include "capability.h" - #include "specifier.h" - -+#include "config.h" -+ - /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates - * them in the file system. This is intended to be used to create - * properly owned directories beneath /tmp, /var/tmp, /run, which are -@@ -1082,6 +1084,7 @@ - assert(line >= 1); - assert(buffer); - -+#ifdef HAVE_MSFORMAT - r = sscanf(buffer, - "%c %ms %ms %ms %ms %ms %n", - &type, -@@ -1091,6 +1094,29 @@ - &group, - &age, - &n); -+#else -+ i->path = malloc(257); -+ mode = malloc(257); -+ user = malloc(257); -+ group = malloc(257); -+ age = malloc(257); -+ r = sscanf(buffer, -+ "%c " -+ "%256s " -+ "%256s " -+ "%256s " -+ "%256s " -+ "%256s " -+ "%n", -+ &type, -+ i->path, -+ mode, -+ user, -+ group, -+ age, -+ &n); -+#endif /* HAVE_MSFORMAT */ -+ - if (r < 2) { - log_error("[%s:%u] Syntax error.", fname, line); - return -EIO; -Index: systemd-208/src/cryptsetup/cryptsetup-generator.c -=================================================================== ---- systemd-208.orig/src/cryptsetup/cryptsetup-generator.c 2013-09-30 09:57:04.000000000 -0700 -+++ systemd-208/src/cryptsetup/cryptsetup-generator.c 2013-11-05 22:01:26.776490078 -0800 -@@ -31,6 +31,8 @@ - #include "strv.h" - #include "fileio.h" - -+#include "config.h" -+ - static const char *arg_dest = "/tmp"; - static bool arg_enabled = true; - static bool arg_read_crypttab = true; -@@ -420,7 +422,16 @@ - if (*l == '#' || *l == 0) - continue; - -+#ifdef HAVE_MSFORMAT - k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options); -+#else -+ name = malloc(257); -+ device = malloc(257); -+ password = malloc(257); -+ options = malloc(257); -+ k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options); -+#endif /* HAVE_MSFORMAT */ -+ - if (k < 2 || k > 4) { - log_error("Failed to parse /etc/crypttab:%u, ignoring.", n); - 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 @@ +bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc + +Upstream-Status: Inappropriate [uclibc-specific] + +Signed-off-by: Khem Raj + +Index: git/src/shared/util.c +=================================================================== +--- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700 ++++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700 +@@ -6332,11 +6332,24 @@ + + /* We return this as uint64_t in case we are running as 32bit + * process on a 64bit kernel with huge amounts of memory */ +- ++#ifdef __UCLIBC__ ++ char line[128]; ++ FILE *f = fopen("/proc/meminfo", "r"); ++ if (f == NULL) ++ return 0; ++ while (!feof(f) && fgets(line, sizeof(line)-1, f)) { ++ if (sscanf(line, "MemTotal: %l kB", &mem) == 1) { ++ mem *= 1024; ++ break; ++ } ++ } ++ fclose(f); ++ return (uint64_t) mem; ++#else + mem = sysconf(_SC_PHYS_PAGES); + assert(mem > 0); +- + return (uint64_t) mem * (uint64_t) page_size(); ++#endif + } + + 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 @@ +Dont include sys/sysinfo.h on uclibc it conflicts with linux/sysinfo.h + +Signed-off-by: Khem Raj +Upstream-Status: Inappropriate [uclibc specific] + +Index: systemd-209/src/readahead/readahead-common.c +=================================================================== +--- systemd-209.orig/src/readahead/readahead-common.c 2014-02-12 18:42:33.810685053 -0800 ++++ systemd-209/src/readahead/readahead-common.c 2014-02-19 23:49:31.856661142 -0800 +@@ -22,7 +22,9 @@ + #include + #include + #include ++#ifndef __UCLIBC__ + #include ++#endif + #include + #include + #include diff --git a/meta/recipes-core/systemd/systemd_208.bb b/meta/recipes-core/systemd/systemd_208.bb deleted file mode 100644 index 98da15c434..0000000000 --- a/meta/recipes-core/systemd/systemd_208.bb +++ /dev/null @@ -1,347 +0,0 @@ -SUMMARY = "System and service manager for Linux, replacing SysVinit" -HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" - -LICENSE = "GPLv2 & LGPLv2.1 & MIT" -LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ - file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \ - file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed" - -PROVIDES = "udev" - -PE = "1" - -DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux" -DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" - -SECTION = "base/shell" - -inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest - -SRCREV = "255eb046a7bcb90e60a3a54302bc1250c1aed26a" - -PV = "208+git${SRCPV}" - -SRC_URI = "git://anongit.freedesktop.org/systemd/systemd-stable;branch=v208-stable;protocol=git \ - file://binfmt-install.patch \ - file://touchscreen.rules \ - ${UCLIBCPATCHES} \ - file://00-create-volatile.conf \ - file://init \ - file://run-ptest \ - " - -S = "${WORKDIR}/git" - -UCLIBCPATCHES = "" -UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \ - file://systemd-pam-fix-execvpe.patch \ - file://systemd-pam-fix-fallocate.patch \ - file://systemd-pam-fix-getty-unit.patch \ - file://systemd-pam-fix-mkostemp.patch \ - file://systemd-pam-fix-msformat.patch \ - file://optional_secure_getenv.patch \ - file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \ - " -LDFLAGS_libc-uclibc_append = " -lrt" - -GTKDOC_DOCDIR = "${S}/docs/" - -PACKAGECONFIG ??= "xz tcp-wrappers" -# Sign the journal for anti-tampering -PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" -# regardless of PACKAGECONFIG, libgcrypt is always required to expand -# the AM_PATH_LIBGCRYPT autoconf macro -DEPENDS += "libgcrypt" -# Compress the journal -PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" -PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers" -PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" -PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" - -CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill" - -# Helper variables to clarify locations. This mirrors the logic in systemd's -# build system. -rootprefix ?= "${base_prefix}" -rootlibdir ?= "${base_libdir}" -rootlibexecdir = "${rootprefix}/lib" - -# The gtk+ tools should get built as a separate recipe e.g. systemd-tools -EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ - --with-rootlibdir=${rootlibdir} \ - ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ - --enable-xz \ - --disable-manpages \ - --disable-coredump \ - --disable-introspection \ - --enable-split-usr \ - --without-python \ - --with-sysvrcnd-path=${sysconfdir} \ - --with-firmware-path=/lib/firmware \ - ac_cv_path_KILL=${base_bindir}/kill \ - " -# uclibc does not have NSS -EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " - -do_configure_prepend() { - export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}" - export KMOD="${base_bindir}/kmod" - if [ -d ${S}/units.pre_sed ] ; then - cp -r ${S}/units.pre_sed ${S}/units - else - cp -r ${S}/units ${S}/units.pre_sed - fi - sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service* -} - -do_install() { - autotools_do_install - install -d ${D}/${base_sbindir} - # Provided by a separate recipe - rm ${D}${systemd_unitdir}/system/serial-getty* -f - - # Provide support for initramfs - [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init - [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd - - # Create machine-id - # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable - touch ${D}${sysconfdir}/machine-id - - install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ - - install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ - - if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then - install -d ${D}${sysconfdir}/init.d - install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd - sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd - fi - - # Delete journal README, as log can be symlinked inside volatile. - rm -f ${D}/${localstatedir}/log/README -} - -do_install_ptest () { - install -d ${D}${PTEST_PATH}/test - cp -rf ${S}/test/* ${D}${PTEST_PATH}/test - install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/ - install -d ${D}${PTEST_PATH}/build-aux - cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ - cp -rf ${B}/rules ${D}${PTEST_PATH}/ - # This directory needs to be there for udev-test.pl to work. - install -d ${D}${libdir}/udev/rules.d - cp ${B}/Makefile ${D}${PTEST_PATH}/ - cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test - sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl - sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile - sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile -} - -python populate_packages_prepend (){ - systemdlibdir = d.getVar("rootlibdir", True) - do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) -} -PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*" - -PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \ - ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh" - -SYSTEMD_PACKAGES = "${PN}-binfmt" -SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" - -USERADD_PACKAGES = "${PN}" -USERADD_PARAM_${PN} += "--system systemd-journal-gateway" -GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" - -FILES_${PN}-analyze = "${bindir}/systemd-analyze" - -FILES_${PN}-initramfs = "/init" -RDEPENDS_${PN}-initramfs = "${PN}" - -# The test cases need perl and bash to run correctly. -RDEPENDS_${PN}-ptest += "perl bash" -FILES_${PN}-ptest += "${libdir}/udev/rules.d" - -FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug" - -FILES_${PN}-gui = "${bindir}/systemadm" - -FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ - ${systemd_unitdir}/system/systemd-vconsole-setup.service \ - ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" - -FILES_${PN}-kernel-install = "${bindir}/kernel-install \ - ${sysconfdir}/kernel/ \ - ${exec_prefix}/lib/kernel \ - " -FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ - " - -FILES_${PN}-zsh = "${datadir}/zsh/site-functions" - -FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ - ${exec_prefix}/lib/binfmt.d \ - ${rootlibexecdir}/systemd/systemd-binfmt \ - ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ - ${systemd_unitdir}/system/systemd-binfmt.service" -RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" - -RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts" - -CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ - ${sysconfdir}/systemd/logind.conf \ - ${sysconfdir}/systemd/system.conf \ - ${sysconfdir}/systemd/user.conf" - -FILES_${PN} = " ${base_bindir}/* \ - ${datadir}/bash-completion \ - ${datadir}/dbus-1/services \ - ${datadir}/dbus-1/system-services \ - ${datadir}/polkit-1 \ - ${datadir}/${BPN} \ - ${sysconfdir}/bash_completion.d/ \ - ${sysconfdir}/dbus-1/ \ - ${sysconfdir}/machine-id \ - ${sysconfdir}/modules-load.d/ \ - ${sysconfdir}/sysctl.d/ \ - ${sysconfdir}/systemd/ \ - ${sysconfdir}/tmpfiles.d/ \ - ${sysconfdir}/xdg/ \ - ${sysconfdir}/init.d/README \ - ${rootlibexecdir}/systemd/* \ - ${systemd_unitdir}/* \ - ${base_libdir}/security/*.so \ - ${libdir}/libnss_myhostname.so.2 \ - /cgroup \ - ${bindir}/systemd* \ - ${bindir}/localectl \ - ${bindir}/hostnamectl \ - ${bindir}/timedatectl \ - ${bindir}/bootctl \ - ${bindir}/kernel-install \ - ${exec_prefix}/lib/tmpfiles.d/*.conf \ - ${exec_prefix}/lib/systemd \ - ${exec_prefix}/lib/modules-load.d \ - ${exec_prefix}/lib/sysctl.d \ - ${localstatedir} \ - /lib/udev/rules.d/70-uaccess.rules \ - /lib/udev/rules.d/71-seat.rules \ - /lib/udev/rules.d/73-seat-late.rules \ - /lib/udev/rules.d/99-systemd.rules \ - ${@base_contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \ - " - -FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" -FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" - -RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" - -RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \ - util-linux-agetty \ - util-linux-fsck e2fsprogs-e2fsck \ - kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ -" - -PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb" - -FILES_udev-dbg += "/lib/udev/.debug" - -RDEPENDS_udev += "udev-utils" -RPROVIDES_udev = "hotplug" -RRECOMMENDS_udev += "udev-hwdb" - -RDEPENDS_udev-hwdb += "udev-utils" - -FILES_udev += "${base_sbindir}/udevd \ - ${rootlibexecdir}/systemd/systemd-udevd \ - ${rootlibexecdir}/udev/accelerometer \ - ${rootlibexecdir}/udev/ata_id \ - ${rootlibexecdir}/udev/cdrom_id \ - ${rootlibexecdir}/udev/collect \ - ${rootlibexecdir}/udev/findkeyboards \ - ${rootlibexecdir}/udev/keyboard-force-release.sh \ - ${rootlibexecdir}/udev/keymap \ - ${rootlibexecdir}/udev/mtd_probe \ - ${rootlibexecdir}/udev/scsi_id \ - ${rootlibexecdir}/udev/v4l_id \ - ${rootlibexecdir}/udev/keymaps \ - ${rootlibexecdir}/udev/rules.d/4*.rules \ - ${rootlibexecdir}/udev/rules.d/5*.rules \ - ${rootlibexecdir}/udev/rules.d/6*.rules \ - ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \ - ${rootlibexecdir}/udev/rules.d/75*.rules \ - ${rootlibexecdir}/udev/rules.d/78*.rules \ - ${rootlibexecdir}/udev/rules.d/8*.rules \ - ${rootlibexecdir}/udev/rules.d/95*.rules \ - ${sysconfdir}/udev \ - ${sysconfdir}/init.d/systemd-udevd \ - ${systemd_unitdir}/system/*udev* \ - ${systemd_unitdir}/system/*.wants/*udev* \ - " - -FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm" - -FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" - -INITSCRIPT_PACKAGES = "udev" -INITSCRIPT_NAME_udev = "systemd-udevd" -INITSCRIPT_PARAMS_udev = "start 03 S ." - -python __anonymous() { - if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): - d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") -} - -# TODO: -# u-a for runlevel and telinit - -ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" - -ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" -ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" -ALTERNATIVE_PRIORITY[init] ?= "300" - -ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" -ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" -ALTERNATIVE_PRIORITY[halt] ?= "300" - -ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" -ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" -ALTERNATIVE_PRIORITY[reboot] ?= "300" - -ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" -ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" -ALTERNATIVE_PRIORITY[shutdown] ?= "300" - -ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" -ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" -ALTERNATIVE_PRIORITY[poweroff] ?= "300" - -ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" -ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" -ALTERNATIVE_PRIORITY[runlevel] ?= "300" - -pkg_postinst_udev-hwdb () { - if test -n "$D"; then - ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ - --root $D - else - udevadm hwdb --update - fi -} - -pkg_prerm_udev-hwdb () { - if test -n "$D"; then - exit 1 - fi - - rm -f ${sysconfdir}/udev/hwdb.bin -} - -# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so -# that we don't build both udev and systemd in world builds. -python () { - if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): - raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") -} diff --git a/meta/recipes-core/systemd/systemd_211.bb b/meta/recipes-core/systemd/systemd_211.bb new file mode 100644 index 0000000000..044aab5a00 --- /dev/null +++ b/meta/recipes-core/systemd/systemd_211.bb @@ -0,0 +1,352 @@ +SUMMARY = "System and service manager for Linux, replacing SysVinit" +HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" + +LICENSE = "GPLv2 & LGPLv2.1 & MIT" +LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ + file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \ + file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed" + +PROVIDES = "udev" + +PE = "1" + +DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux" +DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" + +SECTION = "base/shell" + +inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest + +SRCREV = "3a450ec5c6adf3057bcedd6cc19c10617abc35a5" + +PV = "211+git${SRCPV}" + +SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \ + file://binfmt-install.patch \ + file://systemd-pam-configure-check-uclibc.patch \ + file://systemd-pam-fix-execvpe.patch \ + file://systemd-pam-fix-fallocate.patch \ + file://systemd-pam-fix-mkostemp.patch \ + file://optional_secure_getenv.patch \ + file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \ + file://uclibc-sysinfo_h.patch \ + file://uclibc-get-physmem.patch \ + \ + file://touchscreen.rules \ + file://00-create-volatile.conf \ + file://init \ + file://run-ptest \ + " + +S = "${WORKDIR}/git" + +SRC_URI_append_libc-uclibc = "\ + file://systemd-pam-fix-getty-unit.patch \ + " +LDFLAGS_append_libc-uclibc = " -lrt" + +GTKDOC_DOCDIR = "${S}/docs/" + +PACKAGECONFIG ??= "xz tcp-wrappers" +# Sign the journal for anti-tampering +PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" +# regardless of PACKAGECONFIG, libgcrypt is always required to expand +# the AM_PATH_LIBGCRYPT autoconf macro +DEPENDS += "libgcrypt" +# Compress the journal +PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" +PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers" +PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" +PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" + +CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill" + +# Helper variables to clarify locations. This mirrors the logic in systemd's +# build system. +rootprefix ?= "${base_prefix}" +rootlibdir ?= "${base_libdir}" +rootlibexecdir = "${rootprefix}/lib" + +# The gtk+ tools should get built as a separate recipe e.g. systemd-tools +EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ + --with-rootlibdir=${rootlibdir} \ + ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ + --enable-xz \ + --disable-manpages \ + --disable-coredump \ + --disable-introspection \ + --disable-kdbus \ + --enable-split-usr \ + --without-python \ + --with-sysvrcnd-path=${sysconfdir} \ + --with-firmware-path=/lib/firmware \ + ac_cv_path_KILL=${base_bindir}/kill \ + " +# uclibc does not have NSS +EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " + +do_configure_prepend() { + export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}" + export KMOD="${base_bindir}/kmod" + if [ -d ${S}/units.pre_sed ] ; then + cp -r ${S}/units.pre_sed ${S}/units + else + cp -r ${S}/units ${S}/units.pre_sed + fi + sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service* + sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am + sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am +} + +do_install() { + autotools_do_install + install -d ${D}/${base_sbindir} + # Provided by a separate recipe + rm ${D}${systemd_unitdir}/system/serial-getty* -f + + # Provide support for initramfs + [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init + [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd + + # Create machine-id + # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable + touch ${D}${sysconfdir}/machine-id + + install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ + + install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ + + if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd + sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd + fi + + # Delete journal README, as log can be symlinked inside volatile. + rm -f ${D}/${localstatedir}/log/README +} + +do_install_ptest () { + install -d ${D}${PTEST_PATH}/test + cp -rf ${S}/test/* ${D}${PTEST_PATH}/test + install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/ + install -d ${D}${PTEST_PATH}/build-aux + cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ + cp -rf ${B}/rules ${D}${PTEST_PATH}/ + # This directory needs to be there for udev-test.pl to work. + install -d ${D}${libdir}/udev/rules.d + cp ${B}/Makefile ${D}${PTEST_PATH}/ + cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test + sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl + sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile + sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile +} + +python populate_packages_prepend (){ + systemdlibdir = d.getVar("rootlibdir", True) + do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) +} +PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*" + +PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \ + ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh" + +SYSTEMD_PACKAGES = "${PN}-binfmt" +SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" + +USERADD_PACKAGES = "${PN}" +USERADD_PARAM_${PN} += "--system systemd-journal-gateway" +GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" + +FILES_${PN}-analyze = "${bindir}/systemd-analyze" + +FILES_${PN}-initramfs = "/init" +RDEPENDS_${PN}-initramfs = "${PN}" + +# The test cases need perl and bash to run correctly. +RDEPENDS_${PN}-ptest += "perl bash" +FILES_${PN}-ptest += "${libdir}/udev/rules.d" + +FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug" + +FILES_${PN}-gui = "${bindir}/systemadm" + +FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ + ${systemd_unitdir}/system/systemd-vconsole-setup.service \ + ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" + +FILES_${PN}-kernel-install = "${bindir}/kernel-install \ + ${sysconfdir}/kernel/ \ + ${exec_prefix}/lib/kernel \ + " +FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ + " + +FILES_${PN}-zsh = "${datadir}/zsh/site-functions" + +FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ + ${exec_prefix}/lib/binfmt.d \ + ${rootlibexecdir}/systemd/systemd-binfmt \ + ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ + ${systemd_unitdir}/system/systemd-binfmt.service" +RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" + +RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts" + +CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ + ${sysconfdir}/systemd/logind.conf \ + ${sysconfdir}/systemd/system.conf \ + ${sysconfdir}/systemd/user.conf" + +FILES_${PN} = " ${base_bindir}/* \ + ${datadir}/bash-completion \ + ${datadir}/dbus-1/services \ + ${datadir}/dbus-1/system-services \ + ${datadir}/polkit-1 \ + ${datadir}/${BPN} \ + ${sysconfdir}/bash_completion.d/ \ + ${sysconfdir}/dbus-1/ \ + ${sysconfdir}/machine-id \ + ${sysconfdir}/modules-load.d/ \ + ${sysconfdir}/sysctl.d/ \ + ${sysconfdir}/systemd/ \ + ${sysconfdir}/tmpfiles.d/ \ + ${sysconfdir}/xdg/ \ + ${sysconfdir}/init.d/README \ + ${rootlibexecdir}/systemd/* \ + ${systemd_unitdir}/* \ + ${base_libdir}/security/*.so \ + ${libdir}/libnss_myhostname.so.2 \ + /cgroup \ + ${bindir}/systemd* \ + ${bindir}/busctl \ + ${bindir}/localectl \ + ${bindir}/hostnamectl \ + ${bindir}/timedatectl \ + ${bindir}/bootctl \ + ${bindir}/kernel-install \ + ${exec_prefix}/lib/tmpfiles.d/*.conf \ + ${exec_prefix}/lib/systemd \ + ${exec_prefix}/lib/modules-load.d \ + ${exec_prefix}/lib/sysctl.d \ + ${localstatedir} \ + /lib/udev/rules.d/70-uaccess.rules \ + /lib/udev/rules.d/71-seat.rules \ + /lib/udev/rules.d/73-seat-late.rules \ + /lib/udev/rules.d/99-systemd.rules \ + ${@base_contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \ + " + +FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" +FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" + +RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" + +RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \ + util-linux-agetty \ + util-linux-fsck e2fsprogs-e2fsck \ + kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ +" + +PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb" + +FILES_udev-dbg += "/lib/udev/.debug" + +RDEPENDS_udev += "udev-utils" +RPROVIDES_udev = "hotplug" +RRECOMMENDS_udev += "udev-hwdb" + +RDEPENDS_udev-hwdb += "udev-utils" + +FILES_udev += "${base_sbindir}/udevd \ + ${rootlibexecdir}/systemd/systemd-udevd \ + ${rootlibexecdir}/udev/accelerometer \ + ${rootlibexecdir}/udev/ata_id \ + ${rootlibexecdir}/udev/cdrom_id \ + ${rootlibexecdir}/udev/collect \ + ${rootlibexecdir}/udev/findkeyboards \ + ${rootlibexecdir}/udev/keyboard-force-release.sh \ + ${rootlibexecdir}/udev/keymap \ + ${rootlibexecdir}/udev/mtd_probe \ + ${rootlibexecdir}/udev/scsi_id \ + ${rootlibexecdir}/udev/v4l_id \ + ${rootlibexecdir}/udev/keymaps \ + ${rootlibexecdir}/udev/rules.d/4*.rules \ + ${rootlibexecdir}/udev/rules.d/5*.rules \ + ${rootlibexecdir}/udev/rules.d/6*.rules \ + ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \ + ${rootlibexecdir}/udev/rules.d/75*.rules \ + ${rootlibexecdir}/udev/rules.d/78*.rules \ + ${rootlibexecdir}/udev/rules.d/8*.rules \ + ${rootlibexecdir}/udev/rules.d/95*.rules \ + ${sysconfdir}/udev \ + ${sysconfdir}/init.d/systemd-udevd \ + ${systemd_unitdir}/system/*udev* \ + ${systemd_unitdir}/system/*.wants/*udev* \ + " + +FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm" + +FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" + +INITSCRIPT_PACKAGES = "udev" +INITSCRIPT_NAME_udev = "systemd-udevd" +INITSCRIPT_PARAMS_udev = "start 03 S ." + +python __anonymous() { + if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): + d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") +} + +# TODO: +# u-a for runlevel and telinit + +ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" + +ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" +ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" +ALTERNATIVE_PRIORITY[init] ?= "300" + +ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" +ALTERNATIVE_PRIORITY[halt] ?= "300" + +ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" +ALTERNATIVE_PRIORITY[reboot] ?= "300" + +ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" +ALTERNATIVE_PRIORITY[shutdown] ?= "300" + +ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" +ALTERNATIVE_PRIORITY[poweroff] ?= "300" + +ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" +ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" +ALTERNATIVE_PRIORITY[runlevel] ?= "300" + +pkg_postinst_udev-hwdb () { + if test -n "$D"; then + ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ + --root $D + else + udevadm hwdb --update + fi +} + +pkg_prerm_udev-hwdb () { + if test -n "$D"; then + exit 1 + fi + + rm -f ${sysconfdir}/udev/hwdb.bin +} + +# As this recipe builds udev, respect systemd being in DISTRO_FEATURES so +# that we don't build both udev and systemd in world builds. +python () { + if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): + raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") +} -- cgit v1.2.3