From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- .../systemd/systemd/00-create-volatile.conf | 7 + ...1-Make-root-s-home-directory-configurable.patch | 180 +++++++++++++++++++++ ...ort-for-executing-scripts-under-etc-rcS.d.patch | 138 ++++++++++++++++ ...onfigure-the-list-of-system-users-files-a.patch | 176 ++++++++++++++++++++ ...o-not-install-tmpfiles-and-sysusers-files.patch | 56 +++++++ ...-Fix-navigating-backwards-missing-entries.patch | 33 ++++ ...ing.h-add-fake-__NR_memfd_create-for-MIPS.patch | 29 ++++ ...0001-systemd-user-avoid-using-system-auth.patch | 26 +++ ...ke-resolv.conf-entry-conditional-on-resol.patch | 142 ++++++++++++++++ .../systemd/systemd/binfmt-install.patch | 56 +++++++ meta/recipes-core/systemd/systemd/init | 104 ++++++++++++ .../systemd/systemd/optional_secure_getenv.patch | 19 +++ meta/recipes-core/systemd/systemd/run-ptest | 5 + .../systemd-pam-configure-check-uclibc.patch | 32 ++++ .../systemd/systemd/systemd-pam-fix-execvpe.patch | 29 ++++ .../systemd/systemd-pam-fix-fallocate.patch | 92 +++++++++++ .../systemd/systemd-pam-fix-getty-unit.patch | 35 ++++ .../systemd/systemd/systemd-pam-fix-mkostemp.patch | 30 ++++ .../recipes-core/systemd/systemd/touchscreen.rules | 18 +++ .../systemd/systemd/uclibc-get-physmem.patch | 37 +++++ .../systemd/systemd/uclibc-sysinfo_h.patch | 19 +++ 21 files changed, 1263 insertions(+) create mode 100644 meta/recipes-core/systemd/systemd/00-create-volatile.conf create mode 100644 meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch create mode 100644 meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch create mode 100644 meta/recipes-core/systemd/systemd/binfmt-install.patch create mode 100644 meta/recipes-core/systemd/systemd/init create mode 100644 meta/recipes-core/systemd/systemd/optional_secure_getenv.patch create mode 100644 meta/recipes-core/systemd/systemd/run-ptest create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch create mode 100644 meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch create mode 100644 meta/recipes-core/systemd/systemd/touchscreen.rules create mode 100644 meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch create mode 100644 meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch (limited to 'meta/recipes-core/systemd/systemd') diff --git a/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/meta/recipes-core/systemd/systemd/00-create-volatile.conf new file mode 100644 index 0000000000..9ffa88e464 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf @@ -0,0 +1,7 @@ +#This goes hand-in-hand with the base-files of OE-Core. The file must +# be sorted before 'systemd.conf' becuase this attempts to create a file +# inside /var/log. + + +d /var/volatile/log - - - - +d /var/volatile/tmp - - - - diff --git a/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch new file mode 100644 index 0000000000..c5ad29174c --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch @@ -0,0 +1,180 @@ +From 4dc8dee0435bb63cbe474004b0a8df0363fe94dd Mon Sep 17 00:00:00 2001 +From: Dan McGregor +Date: Fri, 5 Sep 2014 06:28:58 -0600 +Subject: [PATCH] Make root's home directory configurable. + +OpenEmbedded has a configurable home directory for root. Allow +systemd to be built using its idea of what root's home directory +should be. + +Upstream-Status: Pending + +Signed-off-by: Dan McGregor +--- + Makefile.am | 2 ++ + configure.ac | 7 +++++++ + src/core/unit-printf.c | 2 +- + src/nspawn/nspawn.c | 4 ++-- + src/shared/util.c | 4 ++-- + units/console-shell.service.m4.in | 4 ++-- + units/emergency.service.in | 4 ++-- + units/rescue.service.m4.in | 4 ++-- + 8 files changed, 20 insertions(+), 11 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 4028112..5d18f5c 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -191,6 +191,7 @@ AM_CPPFLAGS = \ + -DKEXEC=\"$(KEXEC)\" \ + -DLIBDIR=\"$(libdir)\" \ + -DROOTLIBDIR=\"$(rootlibdir)\" \ ++ -DROOTHOMEDIR=\"$(roothomedir)\" \ + -DTEST_DIR=\"$(abs_top_srcdir)/test\" \ + -I $(top_srcdir)/src \ + -I $(top_builddir)/src/shared \ +@@ -5584,6 +5585,7 @@ EXTRA_DIST += \ + substitutions = \ + '|rootlibexecdir=$(rootlibexecdir)|' \ + '|rootbindir=$(rootbindir)|' \ ++ '|roothomedir=$(roothomedir)|' \ + '|bindir=$(bindir)|' \ + '|SYSTEMCTL=$(rootbindir)/systemctl|' \ + '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \ +diff --git a/configure.ac b/configure.ac +index 18b7198..365bc73 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1272,6 +1272,11 @@ AC_ARG_WITH([rootlibdir], + [], + [with_rootlibdir=${libdir}]) + ++AC_ARG_WITH([roothomedir], ++ AS_HELP_STRING([--with-roothomedir=DIR], [Home directory for the root user]), ++ [], ++ [with_roothomedir=/root]) ++ + AC_ARG_WITH([pamlibdir], + AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]), + [], +@@ -1317,6 +1322,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir]) + AC_SUBST([pamconfdir], [$with_pamconfdir]) + AC_SUBST([rootprefix], [$with_rootprefix]) + AC_SUBST([rootlibdir], [$with_rootlibdir]) ++AC_SUBST([roothomedir], [$with_roothomedir]) + + AC_CONFIG_FILES([ + Makefile po/Makefile.in +@@ -1400,6 +1406,7 @@ AC_MSG_RESULT([ + include_prefix: ${INCLUDE_PREFIX} + lib dir: ${libdir} + rootlib dir: ${with_rootlibdir} ++ root home dir: ${with_roothomedir} + SysV init scripts: ${SYSTEM_SYSVINIT_PATH} + SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH} + Build Python: ${PYTHON} +diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c +index 62599d0..852d34c 100644 +--- a/src/core/unit-printf.c ++++ b/src/core/unit-printf.c +@@ -259,7 +259,7 @@ static int specifier_user_home(char specifier, void *data, void *userdata, char + * best of it if we can, but fail if we can't */ + + if (!c->user || streq(c->user, "root") || streq(c->user, "0")) +- n = strdup("/root"); ++ n = strdup(ROOTHOMEDIR); + else + return -ENOTSUP; + +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index d01da45..3e876d5 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -3312,7 +3312,7 @@ int main(int argc, char *argv[]) { + if (r < 0) + _exit(EXIT_FAILURE); + +- if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: "/root") < 0) || ++ if ((asprintf((char**)(envp + n_env++), "HOME=%s", home ? home: ROOTHOMEDIR) < 0) || + (asprintf((char**)(envp + n_env++), "USER=%s", arg_user ? arg_user : "root") < 0) || + (asprintf((char**)(envp + n_env++), "LOGNAME=%s", arg_user ? arg_user : "root") < 0)) { + log_oom(); +@@ -3402,7 +3402,7 @@ int main(int argc, char *argv[]) { + } else if (argc > optind) + execvpe(argv[optind], argv + optind, env_use); + else { +- chdir(home ? home : "/root"); ++ chdir(home ? home : ROOTHOMEDIR); + execle("/bin/bash", "-bash", NULL, env_use); + execle("/bin/sh", "-sh", NULL, env_use); + } +diff --git a/src/shared/util.c b/src/shared/util.c +index 85a570a..aef6033 100644 +--- a/src/shared/util.c ++++ b/src/shared/util.c +@@ -4377,7 +4377,7 @@ int get_user_creds( + *gid = 0; + + if (home) +- *home = "/root"; ++ *home = ROOTHOMEDIR; + + if (shell) + *shell = "/bin/sh"; +@@ -5363,7 +5363,7 @@ int get_home_dir(char **_h) { + /* Hardcode home directory for root to avoid NSS */ + u = getuid(); + if (u == 0) { +- h = strdup("/root"); ++ h = strdup(ROOTHOMEDIR); + if (!h) + return -ENOMEM; + +diff --git a/units/console-shell.service.m4.in b/units/console-shell.service.m4.in +index 3f4904a..e2af652 100644 +--- a/units/console-shell.service.m4.in ++++ b/units/console-shell.service.m4.in +@@ -15,8 +15,8 @@ After=rc-local.service + Before=getty.target + + [Service] +-Environment=HOME=/root +-WorkingDirectory=/root ++Environment=HOME=@roothomedir@ ++WorkingDirectory=@roothomedir@ + ExecStart=-/sbin/sulogin + ExecStopPost=-@SYSTEMCTL@ poweroff + Type=idle +diff --git a/units/emergency.service.in b/units/emergency.service.in +index 91fc1bb..659547e 100644 +--- a/units/emergency.service.in ++++ b/units/emergency.service.in +@@ -13,8 +13,8 @@ Conflicts=shutdown.target + Before=shutdown.target + + [Service] +-Environment=HOME=/root +-WorkingDirectory=/root ++Environment=HOME=@roothomedir@ ++WorkingDirectory=@roothomedir@ + ExecStartPre=-/bin/plymouth quit + ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.' + ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" +diff --git a/units/rescue.service.m4.in b/units/rescue.service.m4.in +index ef54369..7aad86f 100644 +--- a/units/rescue.service.m4.in ++++ b/units/rescue.service.m4.in +@@ -14,8 +14,8 @@ After=sysinit.target plymouth-start.service + Before=shutdown.target + + [Service] +-Environment=HOME=/root +-WorkingDirectory=/root ++Environment=HOME=@roothomedir@ ++WorkingDirectory=@roothomedir@ + ExecStartPre=-/bin/plymouth quit + ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.' + ExecStart=-/bin/sh -c "/sbin/sulogin; @SYSTEMCTL@ --fail --no-block default" +-- +1.9.3 + diff --git a/meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch b/meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch new file mode 100644 index 0000000000..9aa07c1b10 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch @@ -0,0 +1,138 @@ +Upstream-Status: Inappropriate [OE specific] + +Subject: add support for executing scripts under /etc/rcS.d/ + +To be compatible, all services translated from scripts under /etc/rcS.d would +run before services translated from scripts under /etc/rcN.d. + +Signed-off-by: Chen Qi +--- + src/sysv-generator/sysv-generator.c | 50 ++++++++++++++++++++++++++++--------- + 1 file changed, 38 insertions(+), 12 deletions(-) + +diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c +index 9a869ba..10c55c0 100644 +--- a/src/sysv-generator/sysv-generator.c ++++ b/src/sysv-generator/sysv-generator.c +@@ -43,7 +43,8 @@ + + typedef enum RunlevelType { + RUNLEVEL_UP, +- RUNLEVEL_DOWN ++ RUNLEVEL_DOWN, ++ RUNLEVEL_SYSINIT + } RunlevelType; + + static const struct { +@@ -58,6 +59,9 @@ static const struct { + { "rc4.d", SPECIAL_RUNLEVEL4_TARGET, RUNLEVEL_UP }, + { "rc5.d", SPECIAL_RUNLEVEL5_TARGET, RUNLEVEL_UP }, + ++ /* Debian style rcS.d, also adopted by OE */ ++ { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT}, ++ + /* Standard SysV runlevels for shutdown */ + { "rc0.d", SPECIAL_POWEROFF_TARGET, RUNLEVEL_DOWN }, + { "rc6.d", SPECIAL_REBOOT_TARGET, RUNLEVEL_DOWN } +@@ -66,7 +70,7 @@ static const struct { + directories in this order, and we want to make sure that + sysv_start_priority is known when we first load the + unit. And that value we only know from S links. Hence +- UP must be read before DOWN */ ++ UP/SYSINIT must be read before DOWN */ + }; + + typedef struct SysvStub { +@@ -82,6 +86,8 @@ typedef struct SysvStub { + char **conflicts; + bool has_lsb; + bool reload; ++ bool default_dependencies; ++ bool from_rcsd; + } SysvStub; + + const char *arg_dest = "/tmp"; +@@ -156,6 +162,9 @@ static int generate_unit_file(SysvStub *s) { + "Description=%s\n", + s->path, s->description); + ++ if (!s->default_dependencies) ++ fprintf(f, "DefaultDependencies=no\n"); ++ + if (!isempty(before)) + fprintf(f, "Before=%s\n", before); + if (!isempty(after)) +@@ -661,18 +670,30 @@ static int fix_order(SysvStub *s, Hashmap *all_services) { + if (s->has_lsb && other->has_lsb) + continue; + +- if (other->sysv_start_priority < s->sysv_start_priority) { +- r = strv_extend(&s->after, other->name); ++ /* All scripts under /etc/rcS.d should execute before scripts under ++ * /etc/rcN.d */ ++ if (!other->from_rcsd && s->from_rcsd) { ++ r = strv_extend(&s->before, other->name); + if (r < 0) + return log_oom(); +- } +- else if (other->sysv_start_priority > s->sysv_start_priority) { +- r = strv_extend(&s->before, other->name); ++ } else if (other->from_rcsd && !s->from_rcsd) { ++ r = strv_extend(&s->after, other->name); + if (r < 0) + return log_oom(); +- } +- else +- continue; ++ } else { ++ if (other->sysv_start_priority < s->sysv_start_priority) { ++ r = strv_extend(&s->after, other->name); ++ if (r < 0) ++ return log_oom(); ++ } ++ else if (other->sysv_start_priority > s->sysv_start_priority) { ++ r = strv_extend(&s->before, other->name); ++ if (r < 0) ++ return log_oom(); ++ } ++ else ++ continue; ++ } + + /* FIXME: Maybe we should compare the name here lexicographically? */ + } +@@ -725,6 +746,8 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { + return log_oom(); + + service->sysv_start_priority = -1; ++ service->default_dependencies = true; ++ service->from_rcsd = false; + service->name = name; + service->path = fpath; + +@@ -810,9 +833,11 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { + + if (de->d_name[0] == 'S') { + +- if (rcnd_table[i].type == RUNLEVEL_UP) { ++ if (rcnd_table[i].type == RUNLEVEL_UP || rcnd_table[i].type == RUNLEVEL_SYSINIT) { + service->sysv_start_priority = + MAX(a*10 + b, service->sysv_start_priority); ++ service->default_dependencies = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?false:true; ++ service->from_rcsd = (rcnd_table[i].type == RUNLEVEL_SYSINIT)?true:false; + } + + r = set_ensure_allocated(&runlevel_services[i], +@@ -825,7 +850,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { + goto finish; + + } else if (de->d_name[0] == 'K' && +- (rcnd_table[i].type == RUNLEVEL_DOWN)) { ++ (rcnd_table[i].type == RUNLEVEL_DOWN || ++ rcnd_table[i].type == RUNLEVEL_SYSINIT)) { + + r = set_ensure_allocated(&shutdown_services, + trivial_hash_func, trivial_compare_func); +-- +1.9.1 + diff --git a/meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch b/meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch new file mode 100644 index 0000000000..e0043597a2 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch @@ -0,0 +1,176 @@ +From 5a16bc264c32237e38a844d55e7a1820a31b8440 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= +Date: Fri, 28 Nov 2014 15:59:59 +0100 +Subject: [PATCH] build-sys: configure the list of system users, files and + directories + +Choose which system users defined in sysusers.d/systemd.conf and files +or directories in tmpfiles.d/systemd.conf, should be provided depending +on comile-time configuration. + +Upstream-Status: Backport +Signed-off-by: Khem Raj +--- + Makefile.am | 4 ++++ + configure.ac | 2 ++ + sysusers.d/.gitignore | 1 + + sysusers.d/{systemd.conf => systemd.conf.m4} | 8 ++++++++ + tmpfiles.d/.gitignore | 3 ++- + tmpfiles.d/{systemd.conf => systemd.conf.m4} | 2 ++ + 6 files changed, 19 insertions(+), 1 deletion(-) + rename sysusers.d/{systemd.conf => systemd.conf.m4} (77%) + rename tmpfiles.d/{systemd.conf => systemd.conf.m4} (96%) + +Index: git/Makefile.am +=================================================================== +--- git.orig/Makefile.am 2015-01-23 21:23:04.000000000 +0000 ++++ git/Makefile.am 2015-01-23 21:23:04.000000000 +0000 +@@ -5698,6 +5698,10 @@ + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ + ++sysusers.d/%: sysusers.d/%.m4 ++ $(AM_V_at)$(MKDIR_P) $(dir $@) ++ $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ ++ + tmpfiles.d/%: tmpfiles.d/%.m4 + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2015-01-23 21:23:04.000000000 +0000 ++++ git/configure.ac 2015-01-23 21:23:04.000000000 +0000 +@@ -971,6 +971,7 @@ + AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon])) + if test "x$enable_timesyncd" != "xno"; then + have_timesyncd=yes ++ M4_DEFINES="$M4_DEFINES -DENABLE_TIMESYNCD" + fi + AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"]) + +@@ -1060,6 +1061,7 @@ + AS_IF([test "x$enable_networkd" != "xno"], [ + AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled]) + have_networkd=yes ++ M4_DEFINES="$M4_DEFINES -DENABLE_NETWORKD" + ]) + AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"]) + +Index: git/sysusers.d/systemd.conf +=================================================================== +--- git.orig/sysusers.d/systemd.conf 2015-01-23 21:23:02.000000000 +0000 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,12 +0,0 @@ +-# This file is part of systemd. +-# +-# systemd is free software; you can redistribute it and/or modify it +-# under the terms of the GNU Lesser General Public License as published by +-# the Free Software Foundation; either version 2.1 of the License, or +-# (at your option) any later version. +- +-g systemd-journal - - +-u systemd-bus-proxy - "systemd Bus Proxy" +-u systemd-network - "systemd Network Management" +-u systemd-resolve - "systemd Resolver" +-u systemd-timesync - "systemd Time Synchronization" +Index: git/sysusers.d/systemd.conf.m4 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/sysusers.d/systemd.conf.m4 2015-01-23 21:26:30.000000000 +0000 +@@ -0,0 +1,20 @@ ++# This file is part of systemd. ++# ++# systemd is free software; you can redistribute it and/or modify it ++# under the terms of the GNU Lesser General Public License as published by ++# the Free Software Foundation; either version 2.1 of the License, or ++# (at your option) any later version. ++ ++g systemd-journal - - ++m4_ifdef(`ENABLE_KDBUS', ++u systemd-bus-proxy - "systemd Bus Proxy" ++)m4_dnl ++m4_ifdef(`ENABLE_NETWORKD', ++u systemd-network - "systemd Network Management" ++)m4_dnl ++m4_ifdef(`ENABLE_RESOLVED', ++u systemd-resolve - "systemd Resolver" ++)m4_dnl ++m4_ifdef(`ENABLE_TIMESYNCD', ++u systemd-timesync - "systemd Time Synchronization" ++)m4_dnl +Index: git/tmpfiles.d/systemd.conf +=================================================================== +--- git.orig/tmpfiles.d/systemd.conf 2015-01-23 21:23:02.000000000 +0000 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,32 +0,0 @@ +-# This file is part of systemd. +-# +-# systemd is free software; you can redistribute it and/or modify it +-# under the terms of the GNU Lesser General Public License as published by +-# the Free Software Foundation; either version 2.1 of the License, or +-# (at your option) any later version. +- +-# See tmpfiles.d(5) for details +- +-d /run/user 0755 root root - +-F! /run/utmp 0664 root utmp - +- +-d /run/systemd/ask-password 0755 root root - +-d /run/systemd/seats 0755 root root - +-d /run/systemd/sessions 0755 root root - +-d /run/systemd/users 0755 root root - +-d /run/systemd/machines 0755 root root - +-d /run/systemd/shutdown 0755 root root - +-d /run/systemd/netif 0755 systemd-network systemd-network - +-d /run/systemd/netif/links 0755 systemd-network systemd-network - +-d /run/systemd/netif/leases 0755 systemd-network systemd-network - +- +-d /run/log 0755 root root - +- +-z /run/log/journal 2755 root systemd-journal - - +-Z /run/log/journal/%m ~2750 root systemd-journal - - +- +-z /var/log/journal 2755 root systemd-journal - - +-z /var/log/journal/%m 2755 root systemd-journal - - +- +-d /var/lib/systemd 0755 root root - +-d /var/lib/systemd/coredump 0755 root root 3d +Index: git/tmpfiles.d/systemd.conf.m4 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/tmpfiles.d/systemd.conf.m4 2015-01-23 21:26:46.000000000 +0000 +@@ -0,0 +1,34 @@ ++# This file is part of systemd. ++# ++# systemd is free software; you can redistribute it and/or modify it ++# under the terms of the GNU Lesser General Public License as published by ++# the Free Software Foundation; either version 2.1 of the License, or ++# (at your option) any later version. ++ ++# See tmpfiles.d(5) for details ++ ++d /run/user 0755 root root - ++F! /run/utmp 0664 root utmp - ++ ++d /run/systemd/ask-password 0755 root root - ++d /run/systemd/seats 0755 root root - ++d /run/systemd/sessions 0755 root root - ++d /run/systemd/users 0755 root root - ++d /run/systemd/machines 0755 root root - ++d /run/systemd/shutdown 0755 root root - ++m4_ifdef(`ENABLE_NETWORKD', ++d /run/systemd/netif 0755 systemd-network systemd-network - ++d /run/systemd/netif/links 0755 systemd-network systemd-network - ++d /run/systemd/netif/leases 0755 systemd-network systemd-network - ++)m4_dnl ++ ++d /run/log 0755 root root - ++ ++z /run/log/journal 2755 root systemd-journal - - ++Z /run/log/journal/%m ~2750 root systemd-journal - - ++ ++z /var/log/journal 2755 root systemd-journal - - ++z /var/log/journal/%m 2755 root systemd-journal - - ++ ++d /var/lib/systemd 0755 root root - ++d /var/lib/systemd/coredump 0755 root root 3d diff --git a/meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch b/meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch new file mode 100644 index 0000000000..4795f8670f --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch @@ -0,0 +1,56 @@ +From bedd083aaedb3bbb14ef579a047bf4b4fed56d9b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= +Date: Wed, 26 Nov 2014 09:17:50 +0100 +Subject: [PATCH] build-sys: do not install tmpfiles and sysusers files by + default + +Upstream-Status: Backport + +Signed-off-by: Khem Raj + +--- + Makefile.am | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index ddd0df1..65bb176 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -2039,7 +2039,6 @@ nodist_tmpfiles_DATA = \ + dist_tmpfiles_DATA = \ + tmpfiles.d/systemd.conf \ + tmpfiles.d/systemd-nologin.conf \ +- tmpfiles.d/systemd-remote.conf \ + tmpfiles.d/tmp.conf \ + tmpfiles.d/x11.conf \ + tmpfiles.d/var.conf +@@ -2094,8 +2093,7 @@ SYSINIT_TARGET_WANTS += \ + systemd-sysusers.service + + dist_sysusers_DATA = \ +- sysusers.d/systemd.conf \ +- sysusers.d/systemd-remote.conf ++ sysusers.d/systemd.conf + + nodist_sysusers_DATA = \ + sysusers.d/basic.conf +@@ -3839,6 +3837,16 @@ systemd_journal_remote_CFLAGS = \ + systemd_journal_remote_LDADD += \ + $(MICROHTTPD_LIBS) + ++if ENABLE_SYSUSERS ++dist_sysusers_DATA += \ ++ sysusers.d/systemd-remote.conf ++endif ++ ++if ENABLE_TMPFILES ++dist_tmpfiles_DATA += \ ++ tmpfiles.d/systemd-remote.conf ++endif ++ + if HAVE_GNUTLS + systemd_journal_remote_LDADD += \ + $(GNUTLS_LIBS) +-- +1.9.1 + diff --git a/meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch b/meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch new file mode 100644 index 0000000000..911e2ff1c1 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch @@ -0,0 +1,33 @@ +From 2173cbf847fc53ca24950e77958c902edecfc207 Mon Sep 17 00:00:00 2001 +From: Olivier Brunel +Date: Fri, 5 Dec 2014 16:06:45 +0100 +Subject: [PATCH] journal: Fix navigating backwards missing entries + +With DIRECTION_UP (i.e. navigating backwards) in generic_array_bisect() when the +needle was found as the last item in the array, it wasn't actually processed as +match, resulting in entries being missed. + +https://bugs.freedesktop.org/show_bug.cgi?id=86855 + +Upstream-Status: Backport + +Signed-off-by: Jonathan Liu +--- + src/journal/journal-file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c +index 7858435..c5d2d19 100644 +--- a/src/journal/journal-file.c ++++ b/src/journal/journal-file.c +@@ -1657,7 +1657,7 @@ static int generic_array_bisect( + } + } + +- if (k > n) { ++ if (k >= n) { + if (direction == DIRECTION_UP) { + i = n; + subtract_one = true; +-- +2.1.3 diff --git a/meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch b/meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch new file mode 100644 index 0000000000..448ef1a917 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch @@ -0,0 +1,29 @@ +Upstream-Status: Backport + +Subject: missing.h: add fake __NR_memfd_create for MIPS + +We don't have the correct __NR_memfd_create syscall number yet, so set it to +0xffffffff for now to prevent compile time errors. + +Signed-off-by: Chen Qi +--- + src/shared/missing.h | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/shared/missing.h b/src/shared/missing.h +index 3ff1a21..3051cb5 100644 +--- a/src/shared/missing.h ++++ b/src/shared/missing.h +@@ -167,6 +167,9 @@ static inline int pivot_root(const char *new_root, const char *put_old) { + # define __NR_fanotify_mark 5296 + # endif + # endif ++# ifndef __NR_memfd_create ++# define __NR_memfd_create 0xffffffff /* FIXME */ ++# endif + #else + # ifndef __NR_fanotify_init + # define __NR_fanotify_init 338 +-- +1.9.1 + diff --git a/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch b/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch new file mode 100644 index 0000000000..fbde13f077 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch @@ -0,0 +1,26 @@ +Upstream-Status: Inappropriate [oe specific] + +Subject: systemd-user: avoid using system-auth + +In OE, we don't provide system-auth, instead, we use common-* files. +So modify systemd-user file to use common-* files. + +Signed-off-by: Chen Qi +--- + src/login/systemd-user | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/login/systemd-user b/src/login/systemd-user +index 8112d74..99635af 100644 +--- a/src/login/systemd-user ++++ b/src/login/systemd-user +@@ -2,5 +2,5 @@ + # + # Used by systemd --user instances. + +-account include system-auth +-session include system-auth ++account include common-account ++session include common-session +-- +1.9.1 diff --git a/meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch b/meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch new file mode 100644 index 0000000000..b5b0168149 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch @@ -0,0 +1,142 @@ +From aeb50ff0bd4bbbca74c4695072232348351d512d Mon Sep 17 00:00:00 2001 +From: Tom Gundersen +Date: Wed, 27 Aug 2014 17:45:41 +0200 +Subject: [PATCH] tmpfiles: make resolv.conf entry conditional on resolved + support + +Upstream-Status: Backport +Signed-off-by: Khem Raj + +--- + Makefile.am | 15 +++++++++++++-- + TODO | 2 -- + configure.ac | 1 + + tmpfiles.d/.gitignore | 1 + + tmpfiles.d/{etc.conf => etc.conf.m4} | 2 ++ + 5 files changed, 17 insertions(+), 4 deletions(-) + create mode 100644 tmpfiles.d/.gitignore + rename tmpfiles.d/{etc.conf => etc.conf.m4} (95%) + +Index: git/Makefile.am +=================================================================== +--- git.orig/Makefile.am 2015-01-24 00:41:20.134716451 -0800 ++++ git/Makefile.am 2015-01-24 00:41:20.126716451 -0800 +@@ -1935,14 +1935,16 @@ + units/systemd-tmpfiles-setup.service \ + units/systemd-tmpfiles-clean.service + ++nodist_tmpfiles_DATA = \ ++ tmpfiles.d/etc.conf ++ + dist_tmpfiles_DATA = \ + tmpfiles.d/systemd.conf \ + tmpfiles.d/systemd-nologin.conf \ + tmpfiles.d/systemd-remote.conf \ + tmpfiles.d/tmp.conf \ + tmpfiles.d/x11.conf \ +- tmpfiles.d/var.conf \ +- tmpfiles.d/etc.conf ++ tmpfiles.d/var.conf + + if HAVE_SYSV_COMPAT + dist_tmpfiles_DATA += \ +@@ -1965,10 +1967,14 @@ + endif + + EXTRA_DIST += \ ++ tmpfiles.d/etc.conf.m4 \ + units/systemd-tmpfiles-setup-dev.service.in \ + units/systemd-tmpfiles-setup.service.in \ + units/systemd-tmpfiles-clean.service.in + ++CLEANFILES += \ ++ tmpfiles.d/etc.conf ++ + # ------------------------------------------------------------------------------ + if ENABLE_SYSUSERS + systemd_sysusers_SOURCES = \ +@@ -5684,6 +5690,11 @@ + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ + ++tmpfiles.d/%: tmpfiles.d/%.m4 ++ $(AM_V_at)$(MKDIR_P) $(dir $@) ++ $(AM_V_M4)$(M4) -P $(M4_DEFINES) < $< > $@ ++ ++ + units/%: units/%.m4 + $(AM_V_at)$(MKDIR_P) $(dir $@) + $(AM_V_M4)$(M4) -P $(M4_DEFINES) -DFOR_SYSTEM=1 < $< > $@ +Index: git/TODO +=================================================================== +--- git.orig/TODO 2015-01-24 00:41:20.134716451 -0800 ++++ git/TODO 2015-01-24 00:41:20.126716451 -0800 +@@ -111,8 +111,6 @@ + + * Allow multiple ExecStart= for all Type= settings, so that we can cover rescue.service nicely + +-* the resolv.conf tmpfiles line should be covered by ENABLE_NETWORKD... +- + * Add a new verb "systemctl top" + + * logind: allow users to kill or lock their own sessions +Index: git/configure.ac +=================================================================== +--- git.orig/configure.ac 2015-01-24 00:41:20.134716451 -0800 ++++ git/configure.ac 2015-01-24 00:41:20.126716451 -0800 +@@ -1041,6 +1041,7 @@ + AC_ARG_ENABLE(resolved, AS_HELP_STRING([--disable-resolved], [disable resolve daemon])) + if test "x$enable_resolved" != "xno"; then + have_resolved=yes ++ M4_DEFINES="$M4_DEFINES -DENABLE_RESOLVED" + fi + AM_CONDITIONAL(ENABLE_RESOLVED, [test "$have_resolved" = "yes"]) + +Index: git/tmpfiles.d/.gitignore +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/tmpfiles.d/.gitignore 2015-01-24 00:41:20.126716451 -0800 +@@ -0,0 +1 @@ ++etc.conf +Index: git/tmpfiles.d/etc.conf +=================================================================== +--- git.orig/tmpfiles.d/etc.conf 2015-01-24 00:41:20.134716451 -0800 ++++ /dev/null 1970-01-01 00:00:00.000000000 +0000 +@@ -1,15 +0,0 @@ +-# This file is part of systemd. +-# +-# systemd is free software; you can redistribute it and/or modify it +-# under the terms of the GNU Lesser General Public License as published by +-# the Free Software Foundation; either version 2.1 of the License, or +-# (at your option) any later version. +- +-# See tmpfiles.d(5) for details +- +-L /etc/os-release - - - - ../usr/lib/os-release +-L /etc/localtime - - - - ../usr/share/zoneinfo/UTC +-L+ /etc/mtab - - - - ../proc/self/mounts +-L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf +-C /etc/nsswitch.conf - - - - +-C /etc/pam.d - - - - +Index: git/tmpfiles.d/etc.conf.m4 +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ git/tmpfiles.d/etc.conf.m4 2015-01-24 00:41:20.126716451 -0800 +@@ -0,0 +1,17 @@ ++# This file is part of systemd. ++# ++# systemd is free software; you can redistribute it and/or modify it ++# under the terms of the GNU Lesser General Public License as published by ++# the Free Software Foundation; either version 2.1 of the License, or ++# (at your option) any later version. ++ ++# See tmpfiles.d(5) for details ++ ++L /etc/os-release - - - - ../usr/lib/os-release ++L /etc/localtime - - - - ../usr/share/zoneinfo/UTC ++L+ /etc/mtab - - - - ../proc/self/mounts ++m4_ifdef(`ENABLE_RESOLVED', ++L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf ++) ++C /etc/nsswitch.conf - - - - ++C /etc/pam.d - - - - diff --git a/meta/recipes-core/systemd/systemd/binfmt-install.patch b/meta/recipes-core/systemd/systemd/binfmt-install.patch new file mode 100644 index 0000000000..c2d5099f24 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/binfmt-install.patch @@ -0,0 +1,56 @@ +Don't install dependency links at install time for the binfmt services, use +[Install] blocks so that they get created when the service is enabled like a +traditional service. + +The [Install] blocks were rejected upstream as they don't have a way to "enable" +it on install without static symlinks which can't be disabled, only masked. We +however can do that in a postinst. + +Upstream-Status: Denied +Signed-off-by: Ross Burton + +diff --git a/Makefile.am b/Makefile.am +index 7933de6..78acb6f 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3133,10 +3133,6 @@ INSTALL_DIRS += \ + $(prefix)/lib/binfmt.d \ + $(sysconfdir)/binfmt.d + +-SYSINIT_TARGET_WANTS += \ +- systemd-binfmt.service \ +- proc-sys-fs-binfmt_misc.automount +- + endif + + EXTRA_DIST += \ +diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount +index 6be3893..709adef 100644 +--- a/units/proc-sys-fs-binfmt_misc.automount ++++ b/units/proc-sys-fs-binfmt_misc.automount +@@ -16,3 +16,6 @@ ConditionPathIsReadWrite=/proc/sys/ + + [Automount] + Where=/proc/sys/fs/binfmt_misc ++ ++[Install] ++WantedBy=sysinit.target +diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in +index 02dfe77..86d3481 100644 +--- a/units/systemd-binfmt.service.in ++++ b/units/systemd-binfmt.service.in +@@ -11,6 +11,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5) + Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt + DefaultDependencies=no + Conflicts=shutdown.target ++Wants=proc-sys-fs-binfmt_misc.automount + After=systemd-readahead-collect.service systemd-readahead-replay.service proc-sys-fs-binfmt_misc.automount + Before=sysinit.target shutdown.target + ConditionPathIsReadWrite=/proc/sys/ +@@ -24,3 +25,6 @@ ConditionDirectoryNotEmpty=|/run/binfmt.d + Type=oneshot + RemainAfterExit=yes + ExecStart=@rootlibexecdir@/systemd-binfmt ++ ++[Install] ++WantedBy=sysinit.target diff --git a/meta/recipes-core/systemd/systemd/init b/meta/recipes-core/systemd/systemd/init new file mode 100644 index 0000000000..ea52be4820 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/init @@ -0,0 +1,104 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +. /etc/init.d/functions + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf + +readfile () { + filename=$1 + READDATA="" + if [ -r $filename ]; then + while read line; do + READDATA="$READDATA$line" + done < $filename + fi +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + mount -a -t tmpfs 2>/dev/null + + # cache handling + if [ "$DEVCACHE" != "" ]; then + readfile /proc/version + VERSION="$READDATA" + readfile /proc/cmdline + CMDLINE="$READDATA" + readfile /proc/devices + DEVICES="$READDATA" + readfile /proc/atags + ATAGS="$READDATA" + + if [ -e $DEVCACHE ]; then + readfile /etc/udev/cache.data + if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then + (cd /; tar xf $DEVCACHE > /dev/null 2>&1) + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache + else + echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache + fi + else + echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache + fi + fi + + # make_extra_nodes + killproc systemd-udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform + (udevadm settle --timeout=3; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name systemd-udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + status systemd-udevd + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch new file mode 100644 index 0000000000..2063268246 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch @@ -0,0 +1,19 @@ +on uclibc secure_getenv is not available +therefore default to using getenv instead + +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: git/src/shared/missing.h +=================================================================== +--- git.orig/src/shared/missing.h 2012-09-22 18:46:44.141282145 -0700 ++++ git/src/shared/missing.h 2012-09-22 18:48:44.081276570 -0700 +@@ -233,6 +233,8 @@ + #ifndef HAVE_SECURE_GETENV + # ifdef HAVE___SECURE_GETENV + # define secure_getenv __secure_getenv ++# elif defined __UCLIBC__ ++# define secure_getenv getenv + # else + # error neither secure_getenv nor __secure_getenv are available + # endif diff --git a/meta/recipes-core/systemd/systemd/run-ptest b/meta/recipes-core/systemd/systemd/run-ptest new file mode 100644 index 0000000000..a2d61c2894 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/run-ptest @@ -0,0 +1,5 @@ +#!/bin/sh + +tar -C test -xJf test/sys.tar.xz +make test/rules-test.sh.log +make test/udev-test.pl.log 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 new file mode 100644 index 0000000000..4639532236 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch @@ -0,0 +1,32 @@ +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +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 @@ + + M4_DEFINES= + ++# check for few functions not implemented in uClibc ++ ++AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate) ++ ++# check for %ms format support - assume always no if cross compiling ++ ++AC_MSG_CHECKING([whether %ms format is supported by *scanf]) ++ ++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])]) ++ + # 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])], diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch new file mode 100644 index 0000000000..7170a38af3 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch @@ -0,0 +1,29 @@ +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: systemd-209/src/nspawn/nspawn.c +=================================================================== +--- 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; + ++#include "config.h" ++ + static char *arg_directory = NULL; + static char *arg_user = NULL; + static sd_id128_t arg_uuid = {}; +@@ -2045,7 +2047,12 @@ + a[0] = (char*) "/sbin/init"; + execve(a[0], a, env_use); + } else if (argc > optind) ++#ifdef HAVE_EXECVPE + execvpe(argv[optind], argv + optind, env_use); ++#else ++ environ = env_use; ++ execvp(argv[optind], argv + optind); ++#endif /* HAVE_EXECVPE */ + else { + chdir(home ? home : "/root"); + 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 new file mode 100644 index 0000000000..f8e19ce172 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch @@ -0,0 +1,92 @@ +Upstream-Status: Denied [no desire for uclibc support] + +This patch is uclibc specific, thus not suitable for upstream. + +Signed-off-by: Khem Raj +Signed-off-by: Chen Qi +--- + src/journal/journal-file.c | 16 +++++++++++++++- + src/journal/journald-kmsg.c | 16 ++++++++++++++-- + 2 files changed, 29 insertions(+), 3 deletions(-) + +diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c +index f2f1f35..092f87b 100644 +--- a/src/journal/journal-file.c ++++ b/src/journal/journal-file.c +@@ -38,6 +38,8 @@ + #include "compress.h" + #include "fsprg.h" + ++#include "config.h" ++ + #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem)) + #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem)) + +@@ -314,7 +316,7 @@ static int journal_file_verify_header(JournalFile *f) { + + static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { + uint64_t old_size, new_size; +- int r; ++ int r = 0; + + assert(f); + +@@ -362,9 +364,21 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) + /* Note that the glibc fallocate() fallback is very + inefficient, hence we try to minimize the allocation area + as we can. */ ++#ifdef HAVE_POSIX_FALLOCATE + r = posix_fallocate(f->fd, old_size, new_size - old_size); + if (r != 0) + return -r; ++#else ++ /* Write something every 512 bytes to make sure the block is allocated */ ++ uint64_t len = new_size - old_size; ++ uint64_t offset = old_size; ++ for (offset += (len-1) % 512; len > 0; offset += 512) { ++ len -= 512; ++ if (pwrite(f->fd, "", 1, offset) != 1) ++ return -errno; ++ } ++ ++#endif /* HAVE_POSIX_FALLOCATE */ + + if (fstat(f->fd, &f->last_stat) < 0) + return -errno; +diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c +index 12992e7..dc4fa93 100644 +--- a/src/journal/journald-kmsg.c ++++ b/src/journal/journald-kmsg.c +@@ -437,6 +437,7 @@ fail: + int server_open_kernel_seqnum(Server *s) { + _cleanup_close_ int fd; + uint64_t *p; ++ int r = 0; + + assert(s); + +@@ -449,8 +450,19 @@ int server_open_kernel_seqnum(Server *s) { + log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m"); + return 0; + } +- +- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) { ++#ifdef HAVE_POSIX_FALLOCATE ++ r = posix_fallocate(fd, 0, sizeof(uint64_t)); ++#else ++ /* Use good old method to write zeros into the journal file ++ perhaps very inefficient yet working. */ ++ char *buf = alloca(sizeof(uint64_t)); ++ off_t oldpos = lseek(fd, 0, SEEK_CUR); ++ bzero(buf, sizeof(uint64_t)); ++ lseek(fd, 0, SEEK_SET); ++ r = write(fd, buf, sizeof(uint64_t)); ++ lseek(fd, oldpos, SEEK_SET); ++#endif /* HAVE_POSIX_FALLOCATE */ ++ if (r < 0) { + log_error("Failed to allocate sequential number file, ignoring: %m"); + return 0; + } +-- +1.7.9.5 + 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 new file mode 100644 index 0000000000..9b4c940984 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch @@ -0,0 +1,35 @@ +Prefer getty to agetty in console setup systemd units + +Upstream-Status: Inappropriate [configuration specific] +Signed-off-by: Maxime Ripard +--- + units/getty@.service.m4 | 2 +- + units/serial-getty@.service.m4 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +Index: git/units/getty@.service.m4 +=================================================================== +--- 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 $TERM ++ExecStart=-/sbin/getty -L %I $TERM + Type=idle + Restart=always + RestartSec=0 +Index: git/units/serial-getty@.service.m4 +=================================================================== +--- 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 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 new file mode 100644 index 0000000000..8c7aa072da --- /dev/null +++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch @@ -0,0 +1,30 @@ +Upstream-Status: Denied [no desire for uclibc support] +Signed-off-by: Khem Raj + +Index: git/src/shared/util.c +=================================================================== +--- 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; + +@@ -6222,7 +6224,13 @@ + + u = umask(077); + ++#ifdef HAVE_MKOSTEMP + fd = mkostemp(pattern, flags); ++#else ++ fd = mkstemp(pattern); ++ if (fd >= 0) fcntl(fd, F_SETFD, flags); ++#endif /* HAVE_MKOSTEMP */ ++ + if (fd < 0) + return -errno; + diff --git a/meta/recipes-core/systemd/systemd/touchscreen.rules b/meta/recipes-core/systemd/systemd/touchscreen.rules new file mode 100644 index 0000000000..d83fd1673d --- /dev/null +++ b/meta/recipes-core/systemd/systemd/touchscreen.rules @@ -0,0 +1,18 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Create a symlink to any touchscreen input device +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0" +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" 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 -- cgit v1.2.3-54-g00ecf