diff options
Diffstat (limited to 'meta/recipes-core/systemd')
29 files changed, 1023 insertions, 724 deletions
diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service index 6dd335c0bc..182167befe 100644 --- a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service +++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service @@ -21,7 +21,7 @@ IgnoreOnIsolate=yes [Service] Environment="TERM=xterm" -ExecStart=-/sbin/agetty -8 --keep-baud %I @BAUDRATE@ $TERM +ExecStart=-/sbin/agetty -8 -L --keep-baud %I @BAUDRATE@ $TERM Type=idle Restart=always RestartSec=0 diff --git a/meta/recipes-core/systemd/systemd-systemctl-native.bb b/meta/recipes-core/systemd/systemd-systemctl-native.bb index 72bc77df4f..fbdc9c0a18 100644 --- a/meta/recipes-core/systemd/systemd-systemctl-native.bb +++ b/meta/recipes-core/systemd/systemd-systemctl-native.bb @@ -9,6 +9,8 @@ inherit native SRC_URI = "file://systemctl" +S = "${WORKDIR}" + do_install() { install -d ${D}${bindir} install -m 0755 ${WORKDIR}/systemctl ${D}${bindir} diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl index b37f27abfb..6e163bd5c2 100755 --- a/meta/recipes-core/systemd/systemd-systemctl/systemctl +++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl @@ -77,18 +77,31 @@ for service in $services; do exit 0 fi - echo "Try to find location of $service..." + service_base_file=`echo $service | sed 's/\(@\).*\(\.[^.]\+\)/\1\2/'` + if [ -z `echo $service | sed '/@/p;d'` ]; then + echo "Try to find location of $service..." + service_template=false + else + echo "Try to find location of template $service_base_file of instance $service..." + service_template=true + if [ -z `echo $service | sed 's/^.\+@\(.*\)\.[^.]\+/\1/'` ]; then + instance_specified=false + else + instance_specified=true + fi + fi + # find service file for p in $ROOT/etc/systemd/system \ $ROOT/lib/systemd/system \ $ROOT/usr/lib/systemd/system; do - if [ -e $p/$service ]; then - service_file=$p/$service + if [ -e $p/$service_base_file ]; then + service_file=$p/$service_base_file service_file=${service_file##$ROOT} fi done if [ -z "$service_file" ]; then - echo "'$service' couldn't be found; exiting with error" + echo "'$service_base_file' couldn't be found; exiting with error" exit 1 fi echo "Found $service in $service_file" @@ -115,13 +128,29 @@ for service in $services; do for r in $wanted_by; do echo "WantedBy=$r found in $service" if [ "$action" = "enable" ]; then + enable_service=$service + if [ "$service_template" = true -a "$instance_specified" = false ]; then + default_instance=$(sed '/^DefaultInstance[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file") + if [ -z $default_instance ]; then + echo "Template unit without instance or DefaultInstance directive, nothing to enable" + continue + else + echo "Found DefaultInstance $default_instance, enabling it" + enable_service=$(echo $service | sed "s/@/@$default_instance/") + fi + fi mkdir -p $ROOT/etc/systemd/system/$r.wants - ln -s $service_file $ROOT/etc/systemd/system/$r.wants - echo "Enabled $service for $wanted_by." + ln -s $service_file $ROOT/etc/systemd/system/$r.wants/$enable_service + echo "Enabled $enable_service for $wanted_by." else - rm -f $ROOT/etc/systemd/system/$r.wants/$service - rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants - echo "Disabled $service for $wanted_by." + if [ "$service_template" = true -a "$instance_specified" = false ]; then + disable_service="$ROOT/etc/systemd/system/$r.wants/`echo $service | sed 's/@/@*/'`" + else + disable_service="$ROOT/etc/systemd/system/$r.wants/$service" + fi + rm -f $disable_service + [ -d $ROOT/etc/systemd/system/$r.wants ] && rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants + echo "Disabled ${disable_service##$ROOT/etc/systemd/system/$r.wants/} for $wanted_by." fi done diff --git a/meta/recipes-core/systemd/systemd/00-create-volatile.conf b/meta/recipes-core/systemd/systemd/00-create-volatile.conf index 9ffa88e464..87cbe1e7d3 100644 --- a/meta/recipes-core/systemd/systemd/00-create-volatile.conf +++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf @@ -4,4 +4,4 @@ d /var/volatile/log - - - - -d /var/volatile/tmp - - - - +d /var/volatile/tmp 1777 - - 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 deleted file mode 100644 index e0043597a2..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-build-sys-configure-the-list-of-system-users-files-a.patch +++ /dev/null @@ -1,176 +0,0 @@ -From 5a16bc264c32237e38a844d55e7a1820a31b8440 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <l.stelmach@samsung.com> -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 <raj.khem@gmail.com> ---- - 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 deleted file mode 100644 index 4795f8670f..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch +++ /dev/null @@ -1,56 +0,0 @@ -From bedd083aaedb3bbb14ef579a047bf4b4fed56d9b Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= <l.stelmach@samsung.com> -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 <raj.khem@gmail.com> - ---- - 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 deleted file mode 100644 index 911e2ff1c1..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-journal-Fix-navigating-backwards-missing-entries.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 2173cbf847fc53ca24950e77958c902edecfc207 Mon Sep 17 00:00:00 2001 -From: Olivier Brunel <jjk@jjacky.com> -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 <net147@gmail.com> ---- - 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 deleted file mode 100644 index 448ef1a917..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch +++ /dev/null @@ -1,29 +0,0 @@ -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 <Qi.Chen@windriver.com> ---- - 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-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 deleted file mode 100644 index b5b0168149..0000000000 --- a/meta/recipes-core/systemd/systemd/0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch +++ /dev/null @@ -1,142 +0,0 @@ -From aeb50ff0bd4bbbca74c4695072232348351d512d Mon Sep 17 00:00:00 2001 -From: Tom Gundersen <teg@jklm.no> -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 <raj.khem@gmail.com> - ---- - 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/0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch b/meta/recipes-core/systemd/systemd/0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch new file mode 100644 index 0000000000..b6ab5effc2 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch @@ -0,0 +1,44 @@ +From 100e50604efc4032001a2de6a6b47853c0003817 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:29:15 +0000 +Subject: [PATCH 01/11] units: Prefer getty to agetty in console setup systemd + units + +Upstream-Status: Inappropriate [configuration specific] + +Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + units/getty@.service.m4 | 2 +- + units/serial-getty@.service.m4 | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 +index 46164ab..bdf6ec8 100644 +--- a/units/getty@.service.m4 ++++ b/units/getty@.service.m4 +@@ -27,7 +27,7 @@ ConditionPathExists=/dev/tty0 + + [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 +diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4 +index 4522d0d..e6d499d 100644 +--- a/units/serial-getty@.service.m4 ++++ b/units/serial-getty@.service.m4 +@@ -22,7 +22,7 @@ Before=getty.target + IgnoreOnIsolate=yes + + [Service] +-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM ++ExecStart=-/sbin/getty -L 115200 %I $TERM + Type=idle + Restart=always + UtmpIdentifier=%I +-- +2.1.4 + diff --git a/meta/recipes-core/systemd/systemd/0002-shared-missing.h-fall-back-to-insecure-getenv.patch b/meta/recipes-core/systemd/systemd/0002-shared-missing.h-fall-back-to-insecure-getenv.patch new file mode 100644 index 0000000000..1cf7840976 --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0002-shared-missing.h-fall-back-to-insecure-getenv.patch @@ -0,0 +1,25 @@ +From 03baade6db2cf83b44a157818ba827d725449bb0 Mon Sep 17 00:00:00 2001 +From: Emil Renner Berthing <systemd@esmil.dk> +Date: Thu, 18 Sep 2014 15:24:47 +0200 +Subject: [PATCH 02/11] shared/missing.h: fall back to insecure getenv + +--- + src/shared/missing.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/shared/missing.h b/src/shared/missing.h +index b33a70c..11cca04 100644 +--- a/src/shared/missing.h ++++ b/src/shared/missing.h +@@ -366,7 +366,7 @@ static inline int name_to_handle_at(int fd, const char *name, struct file_handle + # ifdef HAVE___SECURE_GETENV + # define secure_getenv __secure_getenv + # else +-# error "neither secure_getenv nor __secure_getenv are available" ++# define secure_getenv getenv + # endif + #endif + +-- +2.1.4 + diff --git a/meta/recipes-core/systemd/systemd/binfmt-install.patch b/meta/recipes-core/systemd/systemd/0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch index c2d5099f24..c14cc6fdd6 100644 --- a/meta/recipes-core/systemd/systemd/binfmt-install.patch +++ b/meta/recipes-core/systemd/systemd/0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch @@ -1,19 +1,33 @@ -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. +From 184a89caacfa00f07e7275bca592bd7dda1b541e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:03:44 +0000 +Subject: [PATCH 03/11] binfmt: Don't install dependency links at install time + for the binfmt services -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 +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 <ross.burton@intel.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + Makefile.am | 4 ---- + units/proc-sys-fs-binfmt_misc.automount | 3 +++ + units/systemd-binfmt.service.in | 5 +++++ + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am -index 7933de6..78acb6f 100644 +index ba63f68..0fb3f9f 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -3133,10 +3133,6 @@ INSTALL_DIRS += \ +@@ -4838,10 +4838,6 @@ INSTALL_DIRS += \ $(prefix)/lib/binfmt.d \ $(sysconfdir)/binfmt.d @@ -36,21 +50,25 @@ index 6be3893..709adef 100644 +[Install] +WantedBy=sysinit.target diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in -index 02dfe77..86d3481 100644 +index 34a5d52..617462b 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) +@@ -11,6 +11,8 @@ 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 ++ + After=proc-sys-fs-binfmt_misc.automount Before=sysinit.target shutdown.target ConditionPathIsReadWrite=/proc/sys/ -@@ -24,3 +25,6 @@ ConditionDirectoryNotEmpty=|/run/binfmt.d +@@ -24,3 +26,6 @@ ConditionDirectoryNotEmpty=|/run/binfmt.d Type=oneshot RemainAfterExit=yes ExecStart=@rootlibexecdir@/systemd-binfmt + +[Install] +WantedBy=sysinit.target +-- +2.1.4 + diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch b/meta/recipes-core/systemd/systemd/0004-configure-Check-for-additional-features-that-uclibc-.patch index 4639532236..dddb7da690 100644 --- a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch +++ b/meta/recipes-core/systemd/systemd/0004-configure-Check-for-additional-features-that-uclibc-.patch @@ -1,11 +1,24 @@ +From 4e2e8dbf3f23ab7dca32286cc0f37bff6ac49e22 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:05:45 +0000 +Subject: [PATCH 04/11] configure: Check for additional features that uclibc + doesnt support + +This helps in supporting uclibc which does not have all features that +glibc might have + Upstream-Status: Denied [no desire for uclibc support] + Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + configure.ac | 18 ++++++++++++++++++ + 1 file changed, 18 insertions(+) -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 @@ +diff --git a/configure.ac b/configure.ac +index 9a2235b..a5b2e6e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -103,6 +103,24 @@ AS_IF([! ln --relative --help > /dev/null 2>&1], [AC_MSG_ERROR([*** ln doesn't s M4_DEFINES= @@ -30,3 +43,6 @@ Index: git/configure.ac # 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])], +-- +2.1.4 + diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch index 7170a38af3..85279d68c2 100644 --- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch +++ b/meta/recipes-core/systemd/systemd/0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch @@ -1,20 +1,29 @@ +From a7417c2e6950d55c22c1b0d15783898b8ff229ef Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:10:37 +0000 +Subject: [PATCH 05/11] nspawn: Use execvpe only when libc supports it + Upstream-Status: Denied [no desire for uclibc support] + Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/nspawn/nspawn.c | 7 +++++++ + 1 file changed, 7 insertions(+) -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; +diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c +index 0d8d199..b597edb 100644 +--- a/src/nspawn/nspawn.c ++++ b/src/nspawn/nspawn.c +@@ -129,6 +129,8 @@ typedef enum Volatile { + VOLATILE_STATE, + } Volatile; +#include "config.h" + static char *arg_directory = NULL; + static char *arg_template = NULL; static char *arg_user = NULL; - static sd_id128_t arg_uuid = {}; -@@ -2045,7 +2047,12 @@ +@@ -4257,7 +4259,12 @@ int main(int argc, char *argv[]) { a[0] = (char*) "/sbin/init"; execve(a[0], a, env_use); } else if (argc > optind) @@ -23,7 +32,10 @@ Index: systemd-209/src/nspawn/nspawn.c +#else + environ = env_use; + execvp(argv[optind], argv + optind); -+#endif /* HAVE_EXECVPE */ ++#endif /* HAVE_EXECVPE */ else { chdir(home ? home : "/root"); execle("/bin/bash", "-bash", NULL, env_use); +-- +2.1.4 + diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch b/meta/recipes-core/systemd/systemd/0006-journal-Use-posix-fallocate-only-if-available.patch index f8e19ce172..631dd77465 100644 --- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch +++ b/meta/recipes-core/systemd/systemd/0006-journal-Use-posix-fallocate-only-if-available.patch @@ -1,19 +1,24 @@ -Upstream-Status: Denied [no desire for uclibc support] +From 34a61b6c9eed3fad360066fb63132ebc7e0aaaa6 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:12:48 +0000 +Subject: [PATCH 06/11] journal: Use posix fallocate only if available + +Some architecture ports in uclibc did not support it in past -This patch is uclibc specific, thus not suitable for upstream. +Upstream-Status: Denied [no desire for uclibc support] Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Chen Qi <Qi.Chen@windriver.com> --- - src/journal/journal-file.c | 16 +++++++++++++++- - src/journal/journald-kmsg.c | 16 ++++++++++++++-- - 2 files changed, 29 insertions(+), 3 deletions(-) + src/journal/journal-file.c | 16 +++++++++++++++- + src/journal/journald-kmsg.c | 15 ++++++++++++++- + 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c -index f2f1f35..092f87b 100644 +index 2845e05..9431171 100644 --- a/src/journal/journal-file.c +++ b/src/journal/journal-file.c -@@ -38,6 +38,8 @@ +@@ -36,6 +36,8 @@ #include "compress.h" #include "fsprg.h" @@ -22,7 +27,7 @@ index f2f1f35..092f87b 100644 #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) { +@@ -354,7 +356,7 @@ static int journal_file_fstat(JournalFile *f) { static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) { uint64_t old_size, new_size; @@ -31,7 +36,7 @@ index f2f1f35..092f87b 100644 assert(f); -@@ -362,9 +364,21 @@ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) +@@ -418,9 +420,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. */ @@ -51,13 +56,13 @@ index f2f1f35..092f87b 100644 + +#endif /* HAVE_POSIX_FALLOCATE */ - if (fstat(f->fd, &f->last_stat) < 0) - return -errno; + f->header->arena_size = htole64(new_size - le64toh(f->header->header_size)); + diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c -index 12992e7..dc4fa93 100644 +index c4216c4..a998ed5 100644 --- a/src/journal/journald-kmsg.c +++ b/src/journal/journald-kmsg.c -@@ -437,6 +437,7 @@ fail: +@@ -436,6 +436,7 @@ fail: int server_open_kernel_seqnum(Server *s) { _cleanup_close_ int fd; uint64_t *p; @@ -65,28 +70,27 @@ index 12992e7..dc4fa93 100644 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"); +@@ -449,7 +450,19 @@ int server_open_kernel_seqnum(Server *s) { 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); ++ /* 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"); ++ if (r < 0) { + log_error_errno(errno, "Failed to allocate sequential number file, ignoring: %m"); return 0; } -- -1.7.9.5 +2.1.4 diff --git a/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch b/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch new file mode 100644 index 0000000000..29c20c010f --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0007-util-Use-mkostemp-only-if-libc-supports-it.patch @@ -0,0 +1,42 @@ +From f771407d3e0288ca0c06a894194d3ddad69b9a8e Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:17:05 +0000 +Subject: [PATCH 07/11] util: Use mkostemp only if libc supports it + +Upstream-Status: Denied [no desire for uclibc support] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/shared/util.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/shared/util.c b/src/shared/util.c +index dc65280..72f4665 100644 +--- a/src/shared/util.c ++++ b/src/shared/util.c +@@ -97,6 +97,8 @@ + #include "def.h" + #include "sparse-endian.h" + ++#include "config.h" ++ + int saved_argc = 0; + char **saved_argv = NULL; + +@@ -6682,7 +6684,13 @@ int mkostemp_safe(char *pattern, int flags) { + + 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; + +-- +2.1.4 + diff --git a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch index 39dfc9e2ea..5297625c93 100644 --- a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch +++ b/meta/recipes-core/systemd/systemd/0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch @@ -1,18 +1,24 @@ -bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc +From b45ea3bfd6635744c8a6b74d0ac701b44bb1d294 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:19:37 +0000 +Subject: [PATCH 08/11] util: bypass unimplemented _SC_PHYS_PAGES system + configuration API on uclibc Upstream-Status: Inappropriate [uclibc-specific] Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/shared/util.c | 15 +++++++++++++++ + 1 file changed, 15 insertions(+) -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 @@ - +diff --git a/src/shared/util.c b/src/shared/util.c +index 72f4665..cbbe3b1 100644 +--- a/src/shared/util.c ++++ b/src/shared/util.c +@@ -6793,10 +6793,25 @@ uint64_t physical_memory(void) { /* 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"); @@ -29,9 +35,12 @@ Index: git/src/shared/util.c +#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) { + void hexdump(FILE *f, const void *p, size_t s) { +-- +2.1.4 + 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/0009-sysv-generator-add-support-for-executing-scripts-und.patch index 9aa07c1b10..9ea3e83e52 100644 --- a/meta/recipes-core/systemd/systemd/0001-add-support-for-executing-scripts-under-etc-rcS.d.patch +++ b/meta/recipes-core/systemd/systemd/0009-sysv-generator-add-support-for-executing-scripts-und.patch @@ -1,20 +1,25 @@ -Upstream-Status: Inappropriate [OE specific] - -Subject: add support for executing scripts under /etc/rcS.d/ +From 8791b5b3934c55694872b6915a67340683ead91b Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:22:52 +0000 +Subject: [PATCH 09/11] sysv-generator: 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. +Upstream-Status: Inappropriate [OE specific] + Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> --- 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 +index bd67f32..6756cc6 100644 --- a/src/sysv-generator/sysv-generator.c +++ b/src/sysv-generator/sysv-generator.c -@@ -43,7 +43,8 @@ +@@ -42,7 +42,8 @@ typedef enum RunlevelType { RUNLEVEL_UP, @@ -24,9 +29,9 @@ index 9a869ba..10c55c0 100644 } 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 }, +@@ -57,6 +58,9 @@ static const struct { + { "rc4.d", SPECIAL_MULTI_USER_TARGET, RUNLEVEL_UP }, + { "rc5.d", SPECIAL_GRAPHICAL_TARGET, RUNLEVEL_UP }, + /* Debian style rcS.d, also adopted by OE */ + { "rcS.d", SPECIAL_SYSINIT_TARGET, RUNLEVEL_SYSINIT}, @@ -34,7 +39,7 @@ index 9a869ba..10c55c0 100644 /* 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 { +@@ -65,7 +69,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 @@ -43,7 +48,7 @@ index 9a869ba..10c55c0 100644 }; typedef struct SysvStub { -@@ -82,6 +86,8 @@ typedef struct SysvStub { +@@ -81,6 +85,8 @@ typedef struct SysvStub { char **conflicts; bool has_lsb; bool reload; @@ -52,7 +57,7 @@ index 9a869ba..10c55c0 100644 } SysvStub; const char *arg_dest = "/tmp"; -@@ -156,6 +162,9 @@ static int generate_unit_file(SysvStub *s) { +@@ -183,6 +189,9 @@ static int generate_unit_file(SysvStub *s) { "Description=%s\n", s->path, s->description); @@ -62,7 +67,7 @@ index 9a869ba..10c55c0 100644 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) { +@@ -704,18 +713,30 @@ static int fix_order(SysvStub *s, Hashmap *all_services) { if (s->has_lsb && other->has_lsb) continue; @@ -101,7 +106,7 @@ index 9a869ba..10c55c0 100644 /* FIXME: Maybe we should compare the name here lexicographically? */ } -@@ -725,6 +746,8 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { +@@ -778,6 +799,8 @@ static int enumerate_sysv(LookupPaths lp, Hashmap *all_services) { return log_oom(); service->sysv_start_priority = -1; @@ -110,7 +115,7 @@ index 9a869ba..10c55c0 100644 service->name = name; service->path = fpath; -@@ -810,9 +833,11 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { +@@ -864,9 +887,11 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { if (de->d_name[0] == 'S') { @@ -122,8 +127,8 @@ index 9a869ba..10c55c0 100644 + 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) { + r = set_ensure_allocated(&runlevel_services[i], NULL); +@@ -878,7 +903,8 @@ static int set_dependencies_from_rcnd(LookupPaths lp, Hashmap *all_services) { goto finish; } else if (de->d_name[0] == 'K' && @@ -131,8 +136,8 @@ index 9a869ba..10c55c0 100644 + (rcnd_table[i].type == RUNLEVEL_DOWN || + rcnd_table[i].type == RUNLEVEL_SYSINIT)) { - r = set_ensure_allocated(&shutdown_services, - trivial_hash_func, trivial_compare_func); + r = set_ensure_allocated(&shutdown_services, NULL); + if (r < 0) -- -1.9.1 +2.1.4 diff --git a/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0010-Make-root-s-home-directory-configurable.patch index c5ad29174c..b65fe423a5 100644 --- a/meta/recipes-core/systemd/systemd/0001-Make-root-s-home-directory-configurable.patch +++ b/meta/recipes-core/systemd/systemd/0010-Make-root-s-home-directory-configurable.patch @@ -1,7 +1,7 @@ -From 4dc8dee0435bb63cbe474004b0a8df0363fe94dd Mon Sep 17 00:00:00 2001 -From: Dan McGregor <dan.mcgregor@usask.ca> -Date: Fri, 5 Sep 2014 06:28:58 -0600 -Subject: [PATCH] Make root's home directory configurable. +From 3dc731c1d270e2e143de621db9bd898299fd849d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:24:49 +0000 +Subject: [PATCH 10/11] 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 @@ -10,6 +10,7 @@ should be. Upstream-Status: Pending Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca> +Signed-off-by: Khem Raj <raj.khem@gmail.com> --- Makefile.am | 2 ++ configure.ac | 7 +++++++ @@ -18,22 +19,23 @@ Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca> src/shared/util.c | 4 ++-- units/console-shell.service.m4.in | 4 ++-- units/emergency.service.in | 4 ++-- - units/rescue.service.m4.in | 4 ++-- + units/rescue.service.in | 4 ++-- 8 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am -index 4028112..5d18f5c 100644 +index 0fb3f9f..4623963 100644 --- a/Makefile.am +++ b/Makefile.am -@@ -191,6 +191,7 @@ AM_CPPFLAGS = \ +@@ -199,7 +199,8 @@ AM_CPPFLAGS = \ -DKEXEC=\"$(KEXEC)\" \ -DLIBDIR=\"$(libdir)\" \ -DROOTLIBDIR=\"$(rootlibdir)\" \ + -DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \ + -DROOTHOMEDIR=\"$(roothomedir)\" \ -DTEST_DIR=\"$(abs_top_srcdir)/test\" \ -I $(top_srcdir)/src \ -I $(top_builddir)/src/shared \ -@@ -5584,6 +5585,7 @@ EXTRA_DIST += \ +@@ -6342,6 +6343,7 @@ EXTRA_DIST += \ substitutions = \ '|rootlibexecdir=$(rootlibexecdir)|' \ '|rootbindir=$(rootbindir)|' \ @@ -42,13 +44,13 @@ index 4028112..5d18f5c 100644 '|SYSTEMCTL=$(rootbindir)/systemctl|' \ '|SYSTEMD_NOTIFY=$(rootbindir)/systemd-notify|' \ diff --git a/configure.ac b/configure.ac -index 18b7198..365bc73 100644 +index a5b2e6e..55bb7d8 100644 --- a/configure.ac +++ b/configure.ac -@@ -1272,6 +1272,11 @@ AC_ARG_WITH([rootlibdir], +@@ -1428,6 +1428,11 @@ AC_ARG_WITH([rootlibdir], [], [with_rootlibdir=${libdir}]) - + +AC_ARG_WITH([roothomedir], + AS_HELP_STRING([--with-roothomedir=DIR], [Home directory for the root user]), + [], @@ -57,15 +59,15 @@ index 18b7198..365bc73 100644 AC_ARG_WITH([pamlibdir], AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]), [], -@@ -1317,6 +1322,7 @@ AC_SUBST([pamlibdir], [$with_pamlibdir]) +@@ -1518,6 +1523,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([ +@@ -1617,6 +1623,7 @@ AC_MSG_RESULT([ include_prefix: ${INCLUDE_PREFIX} lib dir: ${libdir} rootlib dir: ${with_rootlibdir} @@ -74,34 +76,34 @@ index 18b7198..365bc73 100644 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 +index 97135db..14d12f1 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 +index b597edb..0b32673 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c -@@ -3312,7 +3312,7 @@ int main(int argc, char *argv[]) { +@@ -4192,7 +4192,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); +@@ -4266,7 +4266,7 @@ int main(int argc, char *argv[]) { + execvp(argv[optind], argv + optind); + #endif /* HAVE_EXECVPE */ else { - chdir(home ? home : "/root"); + chdir(home ? home : ROOTHOMEDIR); @@ -109,19 +111,19 @@ index d01da45..3e876d5 100644 execle("/bin/sh", "-sh", NULL, env_use); } diff --git a/src/shared/util.c b/src/shared/util.c -index 85a570a..aef6033 100644 +index cbbe3b1..a0e3cc5 100644 --- a/src/shared/util.c +++ b/src/shared/util.c -@@ -4377,7 +4377,7 @@ int get_user_creds( +@@ -4609,7 +4609,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) { +@@ -5611,7 +5611,7 @@ int get_home_dir(char **_h) { /* Hardcode home directory for root to avoid NSS */ u = getuid(); if (u == 0) { @@ -129,52 +131,52 @@ index 85a570a..aef6033 100644 + 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 +index 5c80722..efde5f0 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 + ExecStart=-@SULOGIN@ ExecStopPost=-@SYSTEMCTL@ poweroff Type=idle diff --git a/units/emergency.service.in b/units/emergency.service.in -index 91fc1bb..659547e 100644 +index 2695d7b..7f47b73 100644 --- a/units/emergency.service.in +++ b/units/emergency.service.in -@@ -13,8 +13,8 @@ Conflicts=shutdown.target +@@ -14,8 +14,8 @@ Conflicts=rescue.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 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 + ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\ntry again to boot into default mode.' + ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --fail --no-block default" +diff --git a/units/rescue.service.in b/units/rescue.service.in +index de73fee..47f3593 100644 +--- a/units/rescue.service.in ++++ b/units/rescue.service.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" + ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" or ^D to\\nboot into default mode.' + ExecStart=-/bin/sh -c "@SULOGIN@; @SYSTEMCTL@ --fail --no-block default" -- -1.9.3 +2.1.4 diff --git a/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch b/meta/recipes-core/systemd/systemd/0011-systemd-user-avoid-using-system-auth.patch index fbde13f077..e562bca100 100644 --- a/meta/recipes-core/systemd/systemd/0001-systemd-user-avoid-using-system-auth.patch +++ b/meta/recipes-core/systemd/systemd/0011-systemd-user-avoid-using-system-auth.patch @@ -1,11 +1,15 @@ -Upstream-Status: Inappropriate [oe specific] - -Subject: systemd-user: avoid using system-auth +From 7e202f71785bf5a67c8a4f6b58d3585608fbfdc4 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 20 Feb 2015 05:26:25 +0000 +Subject: [PATCH 11/11] 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. +Upstream-Status: Inappropriate [oe specific] + Signed-off-by: Chen Qi <Qi.Chen@windriver.com> +Signed-off-by: Khem Raj <raj.khem@gmail.com> --- src/login/systemd-user | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) @@ -17,10 +21,11 @@ index 8112d74..99635af 100644 @@ -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 +-- +2.1.4 + diff --git a/meta/recipes-core/systemd/systemd/0012-systemd-tmpfiles.c-Honor-ordering-within-files-as-th.patch b/meta/recipes-core/systemd/systemd/0012-systemd-tmpfiles.c-Honor-ordering-within-files-as-th.patch new file mode 100644 index 0000000000..ccd675798c --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0012-systemd-tmpfiles.c-Honor-ordering-within-files-as-th.patch @@ -0,0 +1,185 @@ +From 2abf886295b979bce6d3f0a240f6f5ecfd70ba37 Mon Sep 17 00:00:00 2001 +From: Randy Witt <randy.e.witt@linux.intel.com> +Date: Wed, 4 Mar 2015 18:32:40 -0800 +Subject: [PATCH] tmpfiles.c: Honor ordering within files as the docs say. + +Previously, globs would always get processed first followed by any other +items in arbitrary order. This is contrary to the documentation which +states "Otherwise, the files/directories are processed in the order they +are listed." + +To fix this, remove the separate "globs" hashmap, and instead use only one +marking each entry as a glob or not. There should be little overhead +from doing this, considering the only time nested processing will occur +is for processing of globs which are not of type "X". + +Signed-off-by: Randy Witt <randy.e.witt@linux.intel.com> +--- + src/tmpfiles/tmpfiles.c | 53 ++++++++++++++++++++++--------------------------- + 1 file changed, 24 insertions(+), 29 deletions(-) + +diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c +index 917bb3c..0b6d226 100644 +--- a/src/tmpfiles/tmpfiles.c ++++ b/src/tmpfiles/tmpfiles.c +@@ -116,6 +116,7 @@ typedef struct Item { + bool force:1; + + bool done:1; ++ bool glob:1; + } Item; + + typedef struct ItemArray { +@@ -137,7 +138,7 @@ static const char conf_file_dirs[] = CONF_DIRS_NULSTR("tmpfiles"); + + #define MAX_DEPTH 256 + +-static Hashmap *items = NULL, *globs = NULL; ++static OrderedHashmap *items = NULL; + static Set *unix_sockets = NULL; + + static bool needs_glob(ItemType t) { +@@ -176,17 +177,17 @@ static bool takes_ownership(ItemType t) { + RECURSIVE_REMOVE_PATH); + } + +-static struct Item* find_glob(Hashmap *h, const char *match) { ++static struct Item* find_glob(OrderedHashmap *h, const char *match) { + ItemArray *j; + Iterator i; + +- HASHMAP_FOREACH(j, h, i) { ++ ORDERED_HASHMAP_FOREACH(j, h, i) { + unsigned n; + + for (n = 0; n < j->count; n++) { + Item *item = j->items + n; + +- if (fnmatch(item->path, match, FNM_PATHNAME|FNM_PERIOD) == 0) ++ if (item->glob && fnmatch(item->path, match, FNM_PATHNAME|FNM_PERIOD) == 0) + return item; + } + } +@@ -391,12 +392,12 @@ static int dir_cleanup( + } + + /* Is there an item configured for this path? */ +- if (hashmap_get(items, sub_path)) { ++ if (ordered_hashmap_get(items, sub_path)) { + log_debug("Ignoring \"%s\": a separate entry exists.", sub_path); + continue; + } + +- if (find_glob(globs, sub_path)) { ++ if (find_glob(items, sub_path)) { + log_debug("Ignoring \"%s\": a separate glob exists.", sub_path); + continue; + } +@@ -1378,7 +1379,7 @@ static int process_item(Item *i) { + PATH_FOREACH_PREFIX(prefix, i->path) { + ItemArray *j; + +- j = hashmap_get(items, prefix); ++ j = ordered_hashmap_get(items, prefix); + if (j) { + int s; + +@@ -1505,7 +1506,6 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { + _cleanup_free_ char *action = NULL, *mode = NULL, *user = NULL, *group = NULL, *age = NULL, *path = NULL; + _cleanup_(item_free_contents) Item i = {}; + ItemArray *existing; +- Hashmap *h; + int r, c = -1, pos; + bool force = false, boot = false; + +@@ -1739,9 +1739,9 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { + i.age_set = true; + } + +- h = needs_glob(i.type) ? globs : items; ++ i.glob = needs_glob(i.type); + +- existing = hashmap_get(h, i.path); ++ existing = ordered_hashmap_get(items, i.path); + if (existing) { + unsigned n; + +@@ -1752,7 +1752,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) { + } + } else { + existing = new0(ItemArray, 1); +- r = hashmap_put(h, i.path, existing); ++ r = ordered_hashmap_put(items, i.path, existing); + if (r < 0) + return log_oom(); + } +@@ -1911,14 +1911,20 @@ static int read_config_file(const char *fn, bool ignore_enoent) { + } + + /* we have to determine age parameter for each entry of type X */ +- HASHMAP_FOREACH(i, globs, iterator) { ++ ORDERED_HASHMAP_FOREACH(i, items, iterator) { + Iterator iter; + Item *j, *candidate_item = NULL; ++ int number = 0; + ++ if (!i->glob) ++ continue; + if (i->type != IGNORE_DIRECTORY_PATH) + continue; + +- HASHMAP_FOREACH(j, items, iter) { ++ ORDERED_HASHMAP_FOREACH(j, items, iter) { ++ number++; ++ if (j == i) ++ continue; + if (j->type != CREATE_DIRECTORY && j->type != TRUNCATE_DIRECTORY && j->type != CREATE_SUBVOLUME) + continue; + +@@ -1964,10 +1970,9 @@ int main(int argc, char *argv[]) { + + mac_selinux_init(NULL); + +- items = hashmap_new(&string_hash_ops); +- globs = hashmap_new(&string_hash_ops); ++ items = ordered_hashmap_new(&string_hash_ops); + +- if (!items || !globs) { ++ if (!items) { + r = log_oom(); + goto finish; + } +@@ -2000,27 +2005,17 @@ int main(int argc, char *argv[]) { + } + } + +- HASHMAP_FOREACH(a, globs, iterator) { +- k = process_item_array(a); +- if (k < 0 && r == 0) +- r = k; +- } +- +- HASHMAP_FOREACH(a, items, iterator) { ++ ORDERED_HASHMAP_FOREACH(a, items, iterator) { + k = process_item_array(a); + if (k < 0 && r == 0) + r = k; + } + + finish: +- while ((a = hashmap_steal_first(items))) +- item_array_free(a); +- +- while ((a = hashmap_steal_first(globs))) ++ while ((a = ordered_hashmap_steal_first(items))) + item_array_free(a); + +- hashmap_free(items); +- hashmap_free(globs); ++ ordered_hashmap_free(items); + + free(arg_include_prefixes); + free(arg_exclude_prefixes); +-- +1.9.3 + diff --git a/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch new file mode 100644 index 0000000000..fe2ba5328d --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0014-Revert-rules-remove-firmware-loading-rules.patch @@ -0,0 +1,28 @@ +From 4f0a722489154da99e7f6b3051afde984eed2f74 Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Thu, 19 Mar 2015 15:01:29 +1100 +Subject: [PATCH] Revert "rules: remove firmware loading rules" + +This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19. +Userspace firmware loading support is needed for Linux < 3.7. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Jonathan Liu <net147@gmail.com> +--- + rules/50-firmware.rules | 3 +++ + 1 file changed, 3 insertions(+) + create mode 100644 rules/50-firmware.rules + +diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules +new file mode 100644 +index 0000000..f0ae684 +--- /dev/null ++++ b/rules/50-firmware.rules +@@ -0,0 +1,3 @@ ++# do not edit this file, it will be overwritten on update ++ ++SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware" +-- +2.3.3 + diff --git a/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch new file mode 100644 index 0000000000..3e3aa278bd --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch @@ -0,0 +1,367 @@ +From 7f074def4e32045353ba4336d703e17b8de7ec4e Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Thu, 19 Mar 2015 15:01:33 +1100 +Subject: [PATCH] Revert "udev: remove userspace firmware loading support" + +This reverts commit be2ea723b1d023b3d385d3b791ee4607cbfb20ca. +Userspace firmware loading support is needed for Linux < 3.7. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Jonathan Liu <net147@gmail.com> +--- + Makefile.am | 12 +++ + README | 9 ++- + TODO | 1 + + configure.ac | 20 +++++ + src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++ + src/udev/udev-builtin.c | 3 + + src/udev/udev.h | 6 ++ + src/udev/udevd.c | 13 ++++ + 8 files changed, 214 insertions(+), 4 deletions(-) + create mode 100644 src/udev/udev-builtin-firmware.c + +diff --git a/Makefile.am b/Makefile.am +index bf04d31..9394700 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -3678,6 +3678,18 @@ libudev_core_la_LIBADD = \ + $(BLKID_LIBS) \ + $(KMOD_LIBS) + ++libudev_core_la_CPPFLAGS = \ ++ $(AM_CPPFLAGS) \ ++ -DFIRMWARE_PATH="$(FIRMWARE_PATH)" ++ ++if ENABLE_FIRMWARE ++libudev_core_la_SOURCES += \ ++ src/udev/udev-builtin-firmware.c ++ ++dist_udevrules_DATA += \ ++ rules/50-firmware.rules ++endif ++ + if HAVE_KMOD + libudev_core_la_SOURCES += \ + src/udev/udev-builtin-kmod.c +diff --git a/README b/README +index c722092..db382d2 100644 +--- a/README ++++ b/README +@@ -36,7 +36,8 @@ LICENSE: + - except src/udev/* which is (currently still) GPLv2, GPLv2+ + + REQUIREMENTS: +- Linux kernel >= 3.7 ++ Linux kernel >= 3.0 ++ Linux kernel >= 3.3 for loop device partition support features with nspawn + Linux kernel >= 3.8 for Smack support + + Kernel Config Options: +@@ -51,14 +52,14 @@ REQUIREMENTS: + CONFIG_PROC_FS + CONFIG_FHANDLE (libudev, mount and bind mount handling) + +- udev will fail to work with the legacy sysfs layout: ++ Udev will fail to work with the legacy layout: + CONFIG_SYSFS_DEPRECATED=n + + Legacy hotplug slows down the system and confuses udev: + CONFIG_UEVENT_HELPER_PATH="" + +- Userspace firmware loading is not supported and should +- be disabled in the kernel: ++ Userspace firmware loading is deprecated, will go away, and ++ sometimes causes problems: + CONFIG_FW_LOADER_USER_HELPER=n + + Some udev rules and virtualization detection relies on it: +diff --git a/TODO b/TODO +index 255a4f2..407bdd0 100644 +--- a/TODO ++++ b/TODO +@@ -727,6 +727,7 @@ Features: + * ExecOnFailure=/usr/bin/foo + + * udev: ++ - remove src/udev/udev-builtin-firmware.c (CONFIG_FW_LOADER_USER_HELPER=n) + - move to LGPL + - kill scsi_id + - add trigger --subsystem-match=usb/usb_device device +diff --git a/configure.ac b/configure.ac +index 97a29d6..13b80ce 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -1245,6 +1245,25 @@ fi + AM_CONDITIONAL(HAVE_MYHOSTNAME, [test "$have_myhostname" = "yes"]) + + # ------------------------------------------------------------------------------ ++AC_ARG_WITH(firmware-path, ++ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], ++ [Firmware search path (default="")]), ++ [], [with_firmware_path=""]) ++OLD_IFS=$IFS ++IFS=: ++for i in $with_firmware_path; do ++ if test "x${FIRMWARE_PATH}" = "x"; then ++ FIRMWARE_PATH="\\\"${i}/\\\"" ++ else ++ FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" ++ fi ++done ++IFS=$OLD_IFS ++AC_SUBST(FIRMWARE_PATH) ++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ]) ++AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"]) ++ ++# ------------------------------------------------------------------------------ + AC_ARG_ENABLE([gudev], + AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]), + [], [enable_gudev=yes]) +@@ -1533,6 +1552,7 @@ AC_MSG_RESULT([ + Build Python: ${PYTHON} + Installation Python: ${PYTHON_BINARY} + sphinx binary: ${SPHINX_BUILD} ++ firmware path: ${FIRMWARE_PATH} + PAM modules dir: ${with_pamlibdir} + PAM configuration dir: ${with_pamconfdir} + D-Bus policy dir: ${with_dbuspolicydir} +diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c +new file mode 100644 +index 0000000..bd8c2fb +--- /dev/null ++++ b/src/udev/udev-builtin-firmware.c +@@ -0,0 +1,154 @@ ++/* ++ * firmware - Kernel firmware loader ++ * ++ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com> ++ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org> ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License as ++ * published by the Free Software Foundation; either version 2 of the ++ * License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, but ++ * WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * General Public License for more details:* ++ */ ++ ++#include <unistd.h> ++#include <stdlib.h> ++#include <string.h> ++#include <stdio.h> ++#include <getopt.h> ++#include <errno.h> ++#include <stdbool.h> ++#include <sys/utsname.h> ++#include <sys/stat.h> ++ ++#include "udev.h" ++ ++static bool set_loading(struct udev *udev, char *loadpath, const char *state) { ++ FILE *ldfile; ++ ++ ldfile = fopen(loadpath, "we"); ++ if (ldfile == NULL) { ++ log_error("error: can not open '%s'", loadpath); ++ return false; ++ }; ++ fprintf(ldfile, "%s\n", state); ++ fclose(ldfile); ++ return true; ++} ++ ++static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) { ++ char *buf; ++ FILE *fsource = NULL, *ftarget = NULL; ++ bool ret = false; ++ ++ buf = malloc(size); ++ if (buf == NULL) { ++ log_error("No memory available to load firmware file"); ++ return false; ++ } ++ ++ log_debug("writing '%s' (%zi) to '%s'", source, size, target); ++ ++ fsource = fopen(source, "re"); ++ if (fsource == NULL) ++ goto exit; ++ ftarget = fopen(target, "we"); ++ if (ftarget == NULL) ++ goto exit; ++ if (fread(buf, size, 1, fsource) != 1) ++ goto exit; ++ if (fwrite(buf, size, 1, ftarget) == 1) ++ ret = true; ++exit: ++ if (ftarget != NULL) ++ fclose(ftarget); ++ if (fsource != NULL) ++ fclose(fsource); ++ free(buf); ++ return ret; ++} ++ ++static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) { ++ struct udev *udev = udev_device_get_udev(dev); ++ static const char *searchpath[] = { FIRMWARE_PATH }; ++ char loadpath[UTIL_PATH_SIZE]; ++ char datapath[UTIL_PATH_SIZE]; ++ char fwpath[UTIL_PATH_SIZE]; ++ const char *firmware; ++ FILE *fwfile = NULL; ++ struct utsname kernel; ++ struct stat statbuf; ++ unsigned int i; ++ int rc = EXIT_SUCCESS; ++ ++ firmware = udev_device_get_property_value(dev, "FIRMWARE"); ++ if (firmware == NULL) { ++ log_error("firmware parameter missing"); ++ rc = EXIT_FAILURE; ++ goto exit; ++ } ++ ++ /* lookup firmware file */ ++ uname(&kernel); ++ for (i = 0; i < ELEMENTSOF(searchpath); i++) { ++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL); ++ fwfile = fopen(fwpath, "re"); ++ if (fwfile != NULL) ++ break; ++ ++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL); ++ fwfile = fopen(fwpath, "re"); ++ if (fwfile != NULL) ++ break; ++ } ++ ++ strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL); ++ ++ if (fwfile == NULL) { ++ log_debug("did not find firmware file '%s'", firmware); ++ rc = EXIT_FAILURE; ++ /* ++ * Do not cancel the request in the initrd, the real root might have ++ * the firmware file and the 'coldplug' run in the real root will find ++ * this pending request and fulfill or cancel it. ++ * */ ++ if (!in_initrd()) ++ set_loading(udev, loadpath, "-1"); ++ goto exit; ++ } ++ ++ if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) { ++ if (!in_initrd()) ++ set_loading(udev, loadpath, "-1"); ++ rc = EXIT_FAILURE; ++ goto exit; ++ } ++ ++ if (!set_loading(udev, loadpath, "1")) ++ goto exit; ++ ++ strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL); ++ if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) { ++ log_error("error sending firmware '%s' to device", firmware); ++ set_loading(udev, loadpath, "-1"); ++ rc = EXIT_FAILURE; ++ goto exit; ++ }; ++ ++ set_loading(udev, loadpath, "0"); ++exit: ++ if (fwfile) ++ fclose(fwfile); ++ return rc; ++} ++ ++const struct udev_builtin udev_builtin_firmware = { ++ .name = "firmware", ++ .cmd = builtin_firmware, ++ .help = "kernel firmware loader", ++ .run_once = true, ++}; +diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c +index 1950ec2..f21c0b6 100644 +--- a/src/udev/udev-builtin.c ++++ b/src/udev/udev-builtin.c +@@ -34,6 +34,9 @@ static const struct udev_builtin *builtins[] = { + [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid, + #endif + [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs, ++#ifdef HAVE_FIRMWARE ++ [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware, ++#endif + [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb, + [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id, + [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard, +diff --git a/src/udev/udev.h b/src/udev/udev.h +index dece6ec..f7ee1e7 100644 +--- a/src/udev/udev.h ++++ b/src/udev/udev.h +@@ -151,6 +151,9 @@ enum udev_builtin_cmd { + UDEV_BUILTIN_BLKID, + #endif + UDEV_BUILTIN_BTRFS, ++#ifdef HAVE_FIRMWARE ++ UDEV_BUILTIN_FIRMWARE, ++#endif + UDEV_BUILTIN_HWDB, + UDEV_BUILTIN_INPUT_ID, + UDEV_BUILTIN_KEYBOARD, +@@ -179,6 +182,9 @@ struct udev_builtin { + extern const struct udev_builtin udev_builtin_blkid; + #endif + extern const struct udev_builtin udev_builtin_btrfs; ++#ifdef HAVE_FIRMWARE ++extern const struct udev_builtin udev_builtin_firmware; ++#endif + extern const struct udev_builtin udev_builtin_hwdb; + extern const struct udev_builtin udev_builtin_input_id; + extern const struct udev_builtin udev_builtin_keyboard; +diff --git a/src/udev/udevd.c b/src/udev/udevd.c +index 99d4c89..71af1e1 100644 +--- a/src/udev/udevd.c ++++ b/src/udev/udevd.c +@@ -99,6 +99,9 @@ struct event { + dev_t devnum; + int ifindex; + bool is_block; ++#ifdef HAVE_FIRMWARE ++ bool nodelay; ++#endif + }; + + static inline struct event *node_to_event(struct udev_list_node *node) { +@@ -472,6 +475,10 @@ static int event_queue_insert(struct udev_device *dev) { + event->devnum = udev_device_get_devnum(dev); + event->is_block = streq("block", udev_device_get_subsystem(dev)); + event->ifindex = udev_device_get_ifindex(dev); ++#ifdef HAVE_FIRMWARE ++ if (streq(udev_device_get_subsystem(dev), "firmware")) ++ event->nodelay = true; ++#endif + + log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev), + udev_device_get_action(dev), udev_device_get_subsystem(dev)); +@@ -548,6 +555,12 @@ static bool is_devpath_busy(struct event *event) { + return true; + } + ++#ifdef HAVE_FIRMWARE ++ /* allow to bypass the dependency tracking */ ++ if (event->nodelay) ++ continue; ++#endif ++ + /* parent device event found */ + if (event->devpath[common] == '/') { + event->delaying_seqnum = loop_event->seqnum; +-- +2.3.3 + diff --git a/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch b/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch deleted file mode 100644 index 2063268246..0000000000 --- a/meta/recipes-core/systemd/systemd/optional_secure_getenv.patch +++ /dev/null @@ -1,19 +0,0 @@ -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 <raj.khem@gmail.com> - -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/systemd-pam-fix-getty-unit.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch deleted file mode 100644 index 9b4c940984..0000000000 --- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch +++ /dev/null @@ -1,35 +0,0 @@ -Prefer getty to agetty in console setup systemd units - -Upstream-Status: Inappropriate [configuration specific] -Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> ---- - 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 deleted file mode 100644 index 8c7aa072da..0000000000 --- a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch +++ /dev/null @@ -1,30 +0,0 @@ -Upstream-Status: Denied [no desire for uclibc support] -Signed-off-by: Khem Raj <raj.khem@gmail.com> - -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/tmpfiles-pam.patch b/meta/recipes-core/systemd/systemd/tmpfiles-pam.patch new file mode 100644 index 0000000000..a40b1b9d3f --- /dev/null +++ b/meta/recipes-core/systemd/systemd/tmpfiles-pam.patch @@ -0,0 +1,30 @@ +Upstream-Status: Submitted +Signed-off-by: Ross Burton <ross.burton@intel.com> + +From 0802aaaa9784813d318d045c79533a044eedf542 Mon Sep 17 00:00:00 2001 +From: Ross Burton <ross.burton@intel.com> +Date: Tue, 3 Mar 2015 11:32:29 +0000 +Subject: [PATCH] tmpfiles.d: only copy /etc/pam.d if PAM is present + +If HAVE_PAM isn't set then don't attempt to copy /etc/pam.d from the factory, as +it doesn't get installed. + +Signed-off-by: Ross Burton <ross.burton@intel.com> +--- + tmpfiles.d/etc.conf.m4 | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/tmpfiles.d/etc.conf.m4 b/tmpfiles.d/etc.conf.m4 +index 9b0e080..ab5cd16 100644 +--- a/tmpfiles.d/etc.conf.m4 ++++ b/tmpfiles.d/etc.conf.m4 +@@ -14,4 +14,6 @@ m4_ifdef(`ENABLE_RESOLVED', + L /etc/resolv.conf - - - - ../run/systemd/resolve/resolv.conf + )m4_dnl + C /etc/nsswitch.conf - - - - ++m4_ifdef(`HAVE_PAM', + C /etc/pam.d - - - - ++)m4_dnl +-- +1.7.10.4 + diff --git a/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch deleted file mode 100644 index 15645dee11..0000000000 --- a/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch +++ /dev/null @@ -1,19 +0,0 @@ -Dont include sys/sysinfo.h on uclibc it conflicts with linux/sysinfo.h - -Signed-off-by: Khem Raj <raj.khem@gmail.com> -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 <errno.h> - #include <stdlib.h> - #include <string.h> -+#ifndef __UCLIBC__ - #include <sys/sysinfo.h> -+#endif - #include <sys/inotify.h> - #include <fcntl.h> - #include <sys/mman.h> diff --git a/meta/recipes-core/systemd/systemd_216.bb b/meta/recipes-core/systemd/systemd_219.bb index 1eb401988e..c196017e1e 100644 --- a/meta/recipes-core/systemd/systemd_216.bb +++ b/meta/recipes-core/systemd/systemd_219.bb @@ -1,6 +1,15 @@ -SUMMARY = "System and service manager for Linux, replacing SysVinit" +SUMMARY = "A System and service manager" HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" +DESCRIPTION = "systemd is a system and service manager for Linux, compatible with \ +SysV and LSB init scripts. systemd provides aggressive parallelization \ +capabilities, uses socket and D-Bus activation for starting services, \ +offers on-demand starting of daemons, keeps track of processes using \ +Linux cgroups, supports snapshotting and restoring of the system \ +state, maintains mount and automount points and implements an \ +elaborate transactional dependency-based service control logic. It can \ +work as a drop-in replacement for sysvinit." + LICENSE = "GPLv2 & LGPLv2.1 & MIT" LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \ @@ -11,33 +20,30 @@ 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 += "${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" SECTION = "base/shell" inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext -SRCREV = "5d0ae62c665262c4c55536457e84e278c252cc0b" - -PV = "216+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://uclibc-sysinfo_h.patch \ - file://uclibc-get-physmem.patch \ - file://0001-add-support-for-executing-scripts-under-etc-rcS.d.patch \ - file://0001-missing.h-add-fake-__NR_memfd_create-for-MIPS.patch \ - file://0001-Make-root-s-home-directory-configurable.patch \ - file://0001-systemd-user-avoid-using-system-auth.patch \ - file://0001-journal-Fix-navigating-backwards-missing-entries.patch \ - file://0001-tmpfiles-make-resolv.conf-entry-conditional-on-resol.patch \ - file://0001-build-sys-do-not-install-tmpfiles-and-sysusers-files.patch \ - file://0001-build-sys-configure-the-list-of-system-users-files-a.patch \ +SRCREV = "85a6fabdd3e43cfab0fc6359e9f2a9e368d4a3ed" + +PV = "219-stable+git${SRCPV}" + +SRC_URI = "git://anongit.freedesktop.org/systemd/systemd-stable;branch=v219-stable;protocol=git \ + file://0002-shared-missing.h-fall-back-to-insecure-getenv.patch \ + file://0003-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ + file://0004-configure-Check-for-additional-features-that-uclibc-.patch \ + file://0005-nspawn-Use-execvpe-only-when-libc-supports-it.patch \ + file://0006-journal-Use-posix-fallocate-only-if-available.patch \ + file://0007-util-Use-mkostemp-only-if-libc-supports-it.patch \ + file://0008-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch \ + file://0009-sysv-generator-add-support-for-executing-scripts-und.patch \ + file://0010-Make-root-s-home-directory-configurable.patch \ + file://0011-systemd-user-avoid-using-system-auth.patch \ + file://0012-systemd-tmpfiles.c-Honor-ordering-within-files-as-th.patch \ + file://0014-Revert-rules-remove-firmware-loading-rules.patch \ + file://0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch \ + file://tmpfiles-pam.patch \ file://touchscreen.rules \ file://00-create-volatile.conf \ file://init \ @@ -47,13 +53,16 @@ SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol= S = "${WORKDIR}/git" SRC_URI_append_libc-uclibc = "\ - file://systemd-pam-fix-getty-unit.patch \ - " + file://0001-units-Prefer-getty-to-agetty-in-console-setup-system.patch \ + " LDFLAGS_append_libc-uclibc = " -lrt" GTKDOC_DOCDIR = "${S}/docs/" -PACKAGECONFIG ??= "xz" +PACKAGECONFIG ??= "xz ldconfig \ + ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ + ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)}" + PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl" # Sign the journal for anti-tampering PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" @@ -69,8 +78,19 @@ PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved" PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd" PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn" PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit" - -CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill" +PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" +PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam" +# Verify keymaps on locale change +PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon" +# Update NAT firewall rules +PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables" +PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,," + +CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill" +CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod" +CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck" +CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon" +CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin" # Helper variables to clarify locations. This mirrors the logic in systemd's # build system. @@ -82,8 +102,6 @@ rootlibexecdir = "${rootprefix}/lib" EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ --with-rootlibdir=${rootlibdir} \ --with-roothomedir=${ROOT_HOME} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ - --disable-manpages \ --disable-coredump \ --disable-introspection \ --disable-kdbus \ @@ -91,7 +109,6 @@ EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ --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 " @@ -126,6 +143,9 @@ do_install() { # 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 -d ${D}${sysconfdir}/udev/rules.d/ + install -d ${D}${sysconfdir}/tmpfiles.d install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ @@ -160,7 +180,9 @@ do_install() { sed -i -e 's/ remote-fs.target$//' ${D}${systemd_unitdir}/system/systemd-journal-flush.service # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it # for existence else it fails - ${@bb.utils.contains('PACKAGECONFIG', 'networkd', '', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${libdir}/tmpfiles.d/systemd.conf', d)} + if [ -s ${D}${libdir}/tmpfiles.d/systemd.conf ]; then + ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${libdir}/tmpfiles.d/systemd.conf', d)} + fi } do_install_ptest () { @@ -248,6 +270,7 @@ FILES_${PN} = " ${base_bindir}/* \ ${sysconfdir}/dbus-1/ \ ${sysconfdir}/machine-id \ ${sysconfdir}/modules-load.d/ \ + ${sysconfdir}/pam.d/ \ ${sysconfdir}/sysctl.d/ \ ${sysconfdir}/systemd/ \ ${sysconfdir}/tmpfiles.d/ \ @@ -275,7 +298,6 @@ FILES_${PN} = " ${base_bindir}/* \ /lib/udev/rules.d/71-seat.rules \ /lib/udev/rules.d/73-seat-late.rules \ /lib/udev/rules.d/99-systemd.rules \ - ${@bb.utils.contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \ " FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" @@ -311,14 +333,7 @@ FILES_udev += "${base_sbindir}/udevd \ ${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 \ + ${rootlibexecdir}/udev/rules.d/*.rules \ ${sysconfdir}/udev \ ${sysconfdir}/init.d/systemd-udevd \ ${systemd_unitdir}/system/*udev* \ |