summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd/systemd')
-rw-r--r--meta/recipes-core/systemd/systemd/00-create-volatile.conf7
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Use-bin-mkdir-instead-of-host-mkdir-path.patch31
-rw-r--r--meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch37
-rw-r--r--meta/recipes-core/systemd/systemd/0001-use-CAP_MKNOD-ConditionCapability.patch32
-rw-r--r--meta/recipes-core/systemd/systemd/binfmt-install.patch56
-rw-r--r--meta/recipes-core/systemd/systemd/init104
-rw-r--r--meta/recipes-core/systemd/systemd/optional_secure_getenv.patch19
-rw-r--r--meta/recipes-core/systemd/systemd/run-ptest2
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch29
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch29
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch85
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch35
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch170
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch349
-rw-r--r--meta/recipes-core/systemd/systemd/touchscreen.rules18
-rw-r--r--meta/recipes-core/systemd/systemd/use-rootlibdir.patch107
16 files changed, 1110 insertions, 0 deletions
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 @@
1#This goes hand-in-hand with the base-files of OE-Core. The file must
2# be sorted before 'systemd.conf' becuase this attempts to create a file
3# inside /var/log.
4
5
6d /var/volatile/log - - - -
7d /var/volatile/tmp - - - -
diff --git a/meta/recipes-core/systemd/systemd/0001-Use-bin-mkdir-instead-of-host-mkdir-path.patch b/meta/recipes-core/systemd/systemd/0001-Use-bin-mkdir-instead-of-host-mkdir-path.patch
new file mode 100644
index 0000000000..25988fc5a5
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-Use-bin-mkdir-instead-of-host-mkdir-path.patch
@@ -0,0 +1,31 @@
1From 5599ab4ae3fe74cdd9699f2874badf241f0148fe Mon Sep 17 00:00:00 2001
2From: Jonathan Liu <net147@gmail.com>
3Date: Wed, 28 Aug 2013 19:09:49 -0700
4Subject: [PATCH] Use /bin/mkdir instead of host mkdir path
5
6If the host system has /usr/bin/mkdir, autoconf would set MKDIR_P to
7/usr/bin/mkdir when it should be /bin/mkdir. As a result, the
8kmod-static-nodes service fails to start on the target because
9/usr/bin/mkdir doesn't exist. This has been observed when building
10systemd on Arch Linux host.
11
12Upstream-Status: Inappropriate [embedded specific]
13Signed-off-by: Jonathan Liu <net147@gmail.com>
14---
15 units/kmod-static-nodes.service.in | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/units/kmod-static-nodes.service.in b/units/kmod-static-nodes.service.in
19index d8a8420..1daed5f 100644
20--- a/units/kmod-static-nodes.service.in
21+++ b/units/kmod-static-nodes.service.in
22@@ -14,5 +14,5 @@ ConditionCapability=CAP_MKNOD
23 [Service]
24 Type=oneshot
25 RemainAfterExit=yes
26-ExecStartPre=@MKDIR_P@ /run/tmpfiles.d
27+ExecStartPre=/bin/mkdir -p /run/tmpfiles.d
28 ExecStart=@KMOD@ static-nodes --format=tmpfiles --output=/run/tmpfiles.d/kmod.conf
29--
301.8.3.4
31
diff --git a/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
new file mode 100644
index 0000000000..e204a5063e
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
@@ -0,0 +1,37 @@
1Upstream-Status: Inappropriate [uclibc specific]
2
3From 7be9273548bcb1f57d011fc252965e45dd2a058c Mon Sep 17 00:00:00 2001
4From: Khem Raj <raj.khem@gmail.com>
5Date: Wed, 21 Aug 2013 19:09:27 -0700
6Subject: [PATCH] uClibc doesn't implement pwritev/preadv
7
8Lets stub out the testcase for building.
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12 src/libsystemd-bus/test-bus-memfd.c | 2 ++
13 1 file changed, 2 insertions(+)
14
15diff --git a/src/libsystemd-bus/test-bus-memfd.c b/src/libsystemd-bus/test-bus-memfd.c
16index 05ef555..45e5e44 100644
17--- a/src/libsystemd-bus/test-bus-memfd.c
18+++ b/src/libsystemd-bus/test-bus-memfd.c
19@@ -145,6 +145,7 @@ int main(int argc, char *argv[]) {
20 /* check content */
21 assert_se(memcmp(buf, "ll", 2) == 0);
22
23+#ifndef __UCLIBC__
24 /* writev it out*/
25 iov[0].iov_base = (char *)"ABC";
26 iov[0].iov_len = 3;
27@@ -167,6 +168,7 @@ int main(int argc, char *argv[]) {
28 assert_se(memcmp(bufv[0], "ABC", 3) == 0);
29 assert_se(memcmp(bufv[1], "DEF", 3) == 0);
30 assert_se(memcmp(bufv[2], "GHI", 3) == 0);
31+#endif /* __UCLIBC__ */
32
33 sd_memfd_free(m);
34
35--
361.8.3.4
37
diff --git a/meta/recipes-core/systemd/systemd/0001-use-CAP_MKNOD-ConditionCapability.patch b/meta/recipes-core/systemd/systemd/0001-use-CAP_MKNOD-ConditionCapability.patch
new file mode 100644
index 0000000000..4a35c2301a
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-use-CAP_MKNOD-ConditionCapability.patch
@@ -0,0 +1,32 @@
1Upstream-Status: Submitted
2
3From cfdd1eb76dced87c73bac8ec22d3a10244c9bbf6 Mon Sep 17 00:00:00 2001
4From: Khem Raj <raj.khem@gmail.com>
5Date: Wed, 21 Aug 2013 20:25:19 -0700
6Subject: [PATCH] use CAP_MKNOD ConditionCapability
7
8Fixes errors seen when booting VMs on QEMU like
9
10systemd[1]: kmod-static-nodes.service: main process exited, code=exited, status=203/EXEC
11systemd[1]: Failed to start Create list of required static device nodes for the current kernel.
12systemd[1]: Unit kmod-static-nodes.service entered failed state.
13
14Make sure that mknod capability is available
15
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17---
18 units/kmod-static-nodes.service.in | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21Index: systemd-206/units/kmod-static-nodes.service.in
22===================================================================
23--- systemd-206.orig/units/kmod-static-nodes.service.in 2013-08-21 19:13:02.000000000 -0700
24+++ systemd-206/units/kmod-static-nodes.service.in 2013-08-21 20:39:13.310689871 -0700
25@@ -9,6 +9,7 @@
26 Description=Create list of required static device nodes for the current kernel
27 DefaultDependencies=no
28 Before=sysinit.target systemd-tmpfiles-setup-dev.service
29+ConditionCapability=CAP_MKNOD
30
31 [Service]
32 Type=oneshot
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 @@
1Don't install dependency links at install time for the binfmt services, use
2[Install] blocks so that they get created when the service is enabled like a
3traditional service.
4
5The [Install] blocks were rejected upstream as they don't have a way to "enable"
6it on install without static symlinks which can't be disabled, only masked. We
7however can do that in a postinst.
8
9Upstream-Status: Denied
10Signed-off-by: Ross Burton <ross.burton@intel.com>
11
12diff --git a/Makefile.am b/Makefile.am
13index 7933de6..78acb6f 100644
14--- a/Makefile.am
15+++ b/Makefile.am
16@@ -3133,10 +3133,6 @@ INSTALL_DIRS += \
17 $(prefix)/lib/binfmt.d \
18 $(sysconfdir)/binfmt.d
19
20-SYSINIT_TARGET_WANTS += \
21- systemd-binfmt.service \
22- proc-sys-fs-binfmt_misc.automount
23-
24 endif
25
26 EXTRA_DIST += \
27diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
28index 6be3893..709adef 100644
29--- a/units/proc-sys-fs-binfmt_misc.automount
30+++ b/units/proc-sys-fs-binfmt_misc.automount
31@@ -16,3 +16,6 @@ ConditionPathIsReadWrite=/proc/sys/
32
33 [Automount]
34 Where=/proc/sys/fs/binfmt_misc
35+
36+[Install]
37+WantedBy=sysinit.target
38diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
39index 02dfe77..86d3481 100644
40--- a/units/systemd-binfmt.service.in
41+++ b/units/systemd-binfmt.service.in
42@@ -11,6 +11,7 @@ Documentation=man:systemd-binfmt.service(8) man:binfmt.d(5)
43 Documentation=https://www.kernel.org/doc/Documentation/binfmt_misc.txt
44 DefaultDependencies=no
45 Conflicts=shutdown.target
46+Wants=proc-sys-fs-binfmt_misc.automount
47 After=systemd-readahead-collect.service systemd-readahead-replay.service proc-sys-fs-binfmt_misc.automount
48 Before=sysinit.target shutdown.target
49 ConditionPathIsReadWrite=/proc/sys/
50@@ -24,3 +25,6 @@ ConditionDirectoryNotEmpty=|/run/binfmt.d
51 Type=oneshot
52 RemainAfterExit=yes
53 ExecStart=@rootlibexecdir@/systemd-binfmt
54+
55+[Install]
56+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 @@
1#!/bin/sh
2
3### BEGIN INIT INFO
4# Provides: udev
5# Required-Start: mountvirtfs
6# Required-Stop:
7# Default-Start: S
8# Default-Stop:
9# Short-Description: Start udevd, populate /dev and load drivers.
10### END INIT INFO
11
12. /etc/init.d/functions
13
14export TZ=/etc/localtime
15
16[ -d /sys/class ] || exit 1
17[ -r /proc/mounts ] || exit 1
18[ -x @UDEVD@ ] || exit 1
19[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache
20[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf
21
22readfile () {
23 filename=$1
24 READDATA=""
25 if [ -r $filename ]; then
26 while read line; do
27 READDATA="$READDATA$line"
28 done < $filename
29 fi
30}
31
32case "$1" in
33 start)
34 export ACTION=add
35 # propagate /dev from /sys
36 echo "Starting udev"
37
38 # mount the devtmpfs on /dev, if not already done
39 LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && {
40 mount -n -o mode=0755 -t devtmpfs none "/dev"
41 }
42 [ -e /dev/pts ] || mkdir -m 0755 /dev/pts
43 [ -e /dev/shm ] || mkdir -m 1777 /dev/shm
44 mount -a -t tmpfs 2>/dev/null
45
46 # cache handling
47 if [ "$DEVCACHE" != "" ]; then
48 readfile /proc/version
49 VERSION="$READDATA"
50 readfile /proc/cmdline
51 CMDLINE="$READDATA"
52 readfile /proc/devices
53 DEVICES="$READDATA"
54 readfile /proc/atags
55 ATAGS="$READDATA"
56
57 if [ -e $DEVCACHE ]; then
58 readfile /etc/udev/cache.data
59 if [ "$READDATA" = "$VERSION$CMDLINE$DEVICES$ATAGS" ]; then
60 (cd /; tar xf $DEVCACHE > /dev/null 2>&1)
61 not_first_boot=1
62 [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE"
63 [ -e /dev/shm/udev.cache ] && rm -f /dev/shm/udev.cache
64 else
65 echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
66 fi
67 else
68 echo "$VERSION$CMDLINE$DEVICES$ATAGS" > /dev/shm/udev.cache
69 fi
70 fi
71
72 # make_extra_nodes
73 killproc systemd-udevd > "/dev/null" 2>&1
74
75 # trigger the sorted events
76 echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
77 @UDEVD@ -d
78
79 udevadm control --env=STARTUP=1
80 if [ "$not_first_boot" != "" ];then
81 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
82 (udevadm settle --timeout=3; udevadm control --env=STARTUP=)&
83 else
84 udevadm trigger --action=add
85 udevadm settle
86 fi
87 ;;
88 stop)
89 echo "Stopping udevd"
90 start-stop-daemon --stop --name systemd-udevd --quiet
91 ;;
92 restart)
93 $0 stop
94 sleep 1
95 $0 start
96 ;;
97 status)
98 status systemd-udevd
99 ;;
100 *)
101 echo "Usage: $0 {start|stop|status|restart}"
102 exit 1
103esac
104exit 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 @@
1on uclibc secure_getenv is not available
2therefore default to using getenv instead
3
4Upstream-Status: Denied [no desire for uclibc support]
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: git/src/shared/missing.h
8===================================================================
9--- git.orig/src/shared/missing.h 2012-09-22 18:46:44.141282145 -0700
10+++ git/src/shared/missing.h 2012-09-22 18:48:44.081276570 -0700
11@@ -233,6 +233,8 @@
12 #ifndef HAVE_SECURE_GETENV
13 # ifdef HAVE___SECURE_GETENV
14 # define secure_getenv __secure_getenv
15+# elif defined __UCLIBC__
16+# define secure_getenv getenv
17 # else
18 # error neither secure_getenv nor __secure_getenv are available
19 # 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..0418bc977b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/run-ptest
@@ -0,0 +1,2 @@
1make test/rules-test.sh.log
2make 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..d096983837
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4--- systemd-185.orig/configure.ac 2012-06-04 14:15:16.000000000 -0400
5+++ systemd-pam-185/configure.ac 2012-06-21 22:57:10.000000000 -0400
6@@ -63,6 +63,23 @@
7
8 AC_PATH_PROG([M4], [m4])
9
10+# check for few functions not implemented in uClibc
11+
12+AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
13+
14+# check for %ms format support - assume always no if cross compiling
15+
16+AC_MSG_CHECKING([whether %ms format is supported by *scanf])
17+
18+AC_RUN_IFELSE(
19+ [AC_LANG_PROGRAM([[ include <stdio.h> ]],
20+ [[ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
21+ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
22+ return (rc==3)?0:1;]])],
23+ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
24+ [AC_MSG_RESULT([no])],
25+ [AC_MSG_RESULT([no])])
26+
27 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
28 m4_ifdef([GTK_DOC_CHECK], [
29 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..1d4f2732c4
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: git/src/nspawn/nspawn.c
5===================================================================
6--- git.orig/src/nspawn/nspawn.c 2012-09-22 17:57:05.000000000 -0700
7+++ git/src/nspawn/nspawn.c 2012-09-22 18:01:41.541405768 -0700
8@@ -63,6 +63,8 @@
9 LINK_GUEST
10 } LinkJournal;
11
12+#include "config.h"
13+
14 static char *arg_directory = NULL;
15 static char *arg_user = NULL;
16 static char **arg_controllers = NULL;
17@@ -1373,7 +1375,12 @@
18 a[0] = (char*) "/sbin/init";
19 execve(a[0], a, (char**) envp);
20 } else if (argc > optind)
21+#ifdef HAVE_EXECVPE
22 execvpe(argv[optind], argv + optind, (char**) envp);
23+#else
24+ environ = (char **)envp;
25+ execvp(argv[optind], argv + optind);
26+#endif /* HAVE_EXECVPE */
27 else {
28 chdir(home ? home : "/root");
29 execle("/bin/bash", "-bash", NULL, (char**) envp);
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..7cf9626539
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
@@ -0,0 +1,85 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: git/src/journal/journal-file.c
5===================================================================
6--- git.orig/src/journal/journal-file.c 2012-09-02 09:49:15.126089594 -0700
7+++ git/src/journal/journal-file.c 2012-09-02 09:49:17.118089670 -0700
8@@ -34,6 +34,8 @@
9 #include "compress.h"
10 #include "fsprg.h"
11
12+#include "config.h"
13+
14 #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
15 #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
16
17@@ -262,7 +264,7 @@
18
19 static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) {
20 uint64_t old_size, new_size;
21- int r;
22+ int r = 0;
23
24 assert(f);
25
26@@ -307,10 +309,25 @@
27 /* Note that the glibc fallocate() fallback is very
28 inefficient, hence we try to minimize the allocation area
29 as we can. */
30+#ifdef HAVE_POSIX_ALLOCATE
31 r = posix_fallocate(f->fd, old_size, new_size - old_size);
32 if (r != 0)
33 return -r;
34
35+#else
36+ /* Use good old method to write zeros into the journal file
37+ perhaps very inefficient yet working. */
38+ if(new_size > old_size) {
39+ char *buf = alloca(new_size - old_size);
40+ off_t oldpos = lseek(f->fd, 0, SEEK_CUR);
41+ bzero(buf, new_size - old_size);
42+ lseek(f->fd, old_size, SEEK_SET);
43+ r = write(f->fd, buf, new_size - old_size);
44+ lseek(f->fd, oldpos, SEEK_SET);
45+ }
46+ if (r < 0)
47+ return -errno;
48+#endif /* HAVE_POSIX_FALLOCATE */
49 if (fstat(f->fd, &f->last_stat) < 0)
50 return -errno;
51
52Index: git/src/journal/journald-kmsg.c
53===================================================================
54--- git.orig/src/journal/journald-kmsg.c 2012-09-02 09:49:15.130089595 -0700
55+++ git/src/journal/journald-kmsg.c 2012-09-02 12:26:17.326447895 -0700
56@@ -404,6 +404,7 @@
57
58 int server_open_kernel_seqnum(Server *s) {
59 int fd;
60+ int r = 0;
61 uint64_t *p;
62
63 assert(s);
64@@ -417,8 +418,19 @@
65 log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m");
66 return 0;
67 }
68-
69- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) {
70+#ifdef HAVE_POSIX_ALLOCATE
71+ r = posix_fallocate(fd, 0, sizeof(uint64_t));
72+#else
73+ /* Use good old method to write zeros into the journal file
74+ perhaps very inefficient yet working. */
75+ char *buf = alloca(sizeof(uint64_t));
76+ off_t oldpos = lseek(fd, 0, SEEK_CUR);
77+ bzero(buf, sizeof(uint64_t));
78+ lseek(fd, 0, SEEK_SET);
79+ r = write(fd, buf, sizeof(uint64_t));
80+ lseek(fd, oldpos, SEEK_SET);
81+#endif /* HAVE_POSIX_FALLOCATE */
82+ if (r < 0) {
83 log_error("Failed to allocate sequential number file, ignoring: %m");
84 close_nointr_nofail(fd);
85 return 0;
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch
new file mode 100644
index 0000000000..ceb8483624
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-getty-unit.patch
@@ -0,0 +1,35 @@
1Prefer getty to agetty in console setup systemd units
2
3Upstream-Status: Inappropriate [configuration specific]
4Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
5---
6 units/getty@.service.m4 | 2 +-
7 units/serial-getty@.service.m4 | 2 +-
8 2 files changed, 2 insertions(+), 2 deletions(-)
9
10Index: systemd-206/units/getty@.service.m4
11===================================================================
12--- systemd-206.orig/units/getty@.service.m4 2013-07-21 15:43:28.000000000 -0700
13+++ systemd-206/units/getty@.service.m4 2013-08-21 08:45:48.569886828 -0700
14@@ -27,7 +27,7 @@
15
16 [Service]
17 # the VT is cleared by TTYVTDisallocate
18-ExecStart=-/sbin/agetty --noclear %I
19+ExecStart=-/sbin/getty -L %I
20 Type=idle
21 Restart=always
22 RestartSec=0
23Index: systemd-206/units/serial-getty@.service.m4
24===================================================================
25--- systemd-206.orig/units/serial-getty@.service.m4 2013-07-21 15:43:28.000000000 -0700
26+++ systemd-206/units/serial-getty@.service.m4 2013-08-21 08:48:52.337890275 -0700
27@@ -22,7 +22,7 @@
28 IgnoreOnIsolate=yes
29
30 [Service]
31-ExecStart=-/sbin/agetty --keep-baud %I 115200,38400,9600
32+ExecStart=-/sbin/getty -L %I 115200
33 Type=idle
34 Restart=always
35 RestartSec=0
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
new file mode 100644
index 0000000000..99ea5736bc
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
@@ -0,0 +1,170 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-206/src/journal/journal-send.c
5===================================================================
6--- systemd-206.orig/src/journal/journal-send.c 2013-07-21 15:43:28.000000000 -0700
7+++ systemd-206/src/journal/journal-send.c 2013-08-21 08:50:50.825892498 -0700
8@@ -46,6 +46,8 @@
9 memcpy(*_f + 10, _func, _fl); \
10 } while(false)
11
12+#include "config.h"
13+
14 /* We open a single fd, and we'll share it with the current process,
15 * all its threads, and all its subprocesses. This means we need to
16 * initialize it atomically, and need to operate on it atomically
17@@ -311,8 +313,13 @@
18 /* Message doesn't fit... Let's dump the data in a temporary
19 * file and just pass a file descriptor of it to the other
20 * side */
21-
22+#ifdef HAVE_MKOSTEMP
23 buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR);
24+#else
25+ buffer_fd = mkstemp(path);
26+ if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC);
27+#endif /* HAVE_MKOSTEMP */
28+
29 if (buffer_fd < 0)
30 return -errno;
31
32Index: systemd-206/src/core/manager.c
33===================================================================
34--- systemd-206.orig/src/core/manager.c 2013-07-21 15:43:28.000000000 -0700
35+++ systemd-206/src/core/manager.c 2013-08-21 08:51:35.209893331 -0700
36@@ -71,6 +71,7 @@
37 #include "audit-fd.h"
38 #include "efivars.h"
39 #include "env-util.h"
40+#include "config.h"
41
42 /* As soon as 5s passed since a unit was added to our GC queue, make sure to run a gc sweep */
43 #define GC_QUEUE_USEC_MAX (10*USEC_PER_SEC)
44@@ -2058,7 +2059,12 @@
45 return -ENOMEM;
46
47 RUN_WITH_UMASK(0077) {
48+#ifdef HAVE_MKOSTEMP
49 fd = mkostemp(path, O_RDWR|O_CLOEXEC);
50+#else
51+ fd = mkstemp(path);
52+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
53+#endif /* HAVE_MKOSTEMP */
54 }
55
56 if (fd < 0) {
57Index: systemd-206/src/shared/util.c
58===================================================================
59--- systemd-206.orig/src/shared/util.c 2013-07-21 15:43:28.000000000 -0700
60+++ systemd-206/src/shared/util.c 2013-08-21 08:50:50.829892498 -0700
61@@ -74,6 +74,8 @@
62 #include "env-util.h"
63 #include "fileio.h"
64
65+#include "config.h"
66+
67 int saved_argc = 0;
68 char **saved_argv = NULL;
69
70@@ -3980,7 +3982,12 @@
71 t[k] = '.';
72 stpcpy(stpcpy(t+k+1, fn), "XXXXXX");
73
74+#ifdef HAVE_MKOSTEMP
75 fd = mkostemp(t, O_WRONLY|O_CLOEXEC);
76+#else
77+ fd = mkstemp(t);
78+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
79+#endif /* HAVE_MKOSTEMP */
80 if (fd < 0) {
81 free(t);
82 return -errno;
83Index: systemd-206/src/shared/ask-password-api.c
84===================================================================
85--- systemd-206.orig/src/shared/ask-password-api.c 2013-07-21 15:43:28.000000000 -0700
86+++ systemd-206/src/shared/ask-password-api.c 2013-08-21 08:50:50.829892498 -0700
87@@ -37,6 +37,8 @@
88
89 #include "ask-password-api.h"
90
91+#include "config.h"
92+
93 static void backspace_chars(int ttyfd, size_t p) {
94
95 if (ttyfd < 0)
96@@ -325,7 +327,12 @@
97 mkdir_p_label("/run/systemd/ask-password", 0755);
98
99 RUN_WITH_UMASK(0022) {
100+#ifdef HAVE_MKOSTEMP
101 fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY);
102+#else
103+ fd = mkstemp(temp);
104+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
105+#endif /* HAVE_MKOSTEMP */
106 }
107
108 if (fd < 0) {
109Index: systemd-206/src/journal/journalctl.c
110===================================================================
111--- systemd-206.orig/src/journal/journalctl.c 2013-07-21 15:43:28.000000000 -0700
112+++ systemd-206/src/journal/journalctl.c 2013-08-21 08:50:50.833892498 -0700
113@@ -1005,7 +1005,13 @@
114 n /= arg_interval;
115
116 close_nointr_nofail(fd);
117+#ifdef HAVE_MKOSTEMP
118 fd = mkostemp(k, O_WRONLY|O_CLOEXEC|O_NOCTTY);
119+#else
120+ fd = mkstemp(k);
121+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
122+#endif /* HAVE_MKOSTEMP */
123+
124 if (fd < 0) {
125 log_error("Failed to open %s: %m", k);
126 r = -errno;
127Index: systemd-206/src/journal/journal-verify.c
128===================================================================
129--- systemd-206.orig/src/journal/journal-verify.c 2013-07-21 15:43:28.000000000 -0700
130+++ systemd-206/src/journal/journal-verify.c 2013-08-21 08:50:50.833892498 -0700
131@@ -811,8 +811,12 @@
132 #endif
133 } else if (f->seal)
134 return -ENOKEY;
135-
136+#ifdef HAVE_MKOSTEMP
137 data_fd = mkostemp(data_path, O_CLOEXEC);
138+#else
139+ data_fd = mkstemp(data_path);
140+ if (data_fd >= 0) fcntl(data_fd, F_SETFD, FD_CLOEXEC);
141+#endif /* HAVE_MKOSTEMP */
142 if (data_fd < 0) {
143 log_error("Failed to create data file: %m");
144 r = -errno;
145@@ -820,7 +824,12 @@
146 }
147 unlink(data_path);
148
149+#ifdef HAVE_MKOSTEMP
150 entry_fd = mkostemp(entry_path, O_CLOEXEC);
151+#else
152+ entry_fd = mkstemp(entry_path);
153+ if (entry_fd >= 0) fcntl(entry_fd, F_SETFD, FD_CLOEXEC);
154+#endif /* HAVE_MKOSTEMP */
155 if (entry_fd < 0) {
156 log_error("Failed to create entry file: %m");
157 r = -errno;
158@@ -828,7 +837,12 @@
159 }
160 unlink(entry_path);
161
162+#ifdef HAVE_MKOSTEMP
163 entry_array_fd = mkostemp(entry_array_path, O_CLOEXEC);
164+#else
165+ entry_array_fd = mkstemp(entry_array_path);
166+ if (entry_array_fd >= 0) fcntl(entry_array_fd, F_SETFD, FD_CLOEXEC);
167+#endif /* HAVE_MKOSTEMP */
168 if (entry_array_fd < 0) {
169 log_error("Failed to create entry array file: %m");
170 r = -errno;
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
new file mode 100644
index 0000000000..77bb305874
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
@@ -0,0 +1,349 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-204/src/fsck/fsck.c
5===================================================================
6--- systemd-204.orig/src/fsck/fsck.c 2013-04-02 05:48:49.000000000 -0700
7+++ systemd-204/src/fsck/fsck.c 2013-05-23 11:26:51.776345015 -0700
8@@ -37,6 +37,8 @@
9 #include "virt.h"
10 #include "fileio.h"
11
12+#include "config.h"
13+
14 static bool arg_skip = false;
15 static bool arg_force = false;
16 static bool arg_show_progress = false;
17@@ -198,9 +200,16 @@
18 char *device;
19 double p;
20 usec_t t;
21-
22+#ifdef HAVE_MSFORMAT
23 if (fscanf(f, "%i %lu %lu %ms", &pass, &cur, &max, &device) != 4)
24- break;
25+#else
26+ device = malloc(257);
27+ if (fscanf(f, "%i %lu %lu %256s", &pass, &cur, &max, device) != 4) {
28+ free(device);
29+ }
30+
31+#endif /* HAVE_MSFORMAT */
32+ break;
33
34 /* Only show one progress counter at max */
35 if (!locked) {
36Index: systemd-204/src/core/swap.c
37===================================================================
38--- systemd-204.orig/src/core/swap.c 2013-05-06 12:06:04.000000000 -0700
39+++ systemd-204/src/core/swap.c 2013-05-23 11:26:51.780345015 -0700
40@@ -41,6 +41,8 @@
41 #include "path-util.h"
42 #include "virt.h"
43
44+#include "config.h"
45+
46 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
47 [SWAP_DEAD] = UNIT_INACTIVE,
48 [SWAP_ACTIVATING] = UNIT_ACTIVATING,
49@@ -1055,6 +1057,7 @@
50 char *dev = NULL, *d;
51 int prio = 0, k;
52
53+#ifdef HAVE_MSFORMAT
54 k = fscanf(m->proc_swaps,
55 "%ms " /* device/file */
56 "%*s " /* type of swap */
57@@ -1062,6 +1065,16 @@
58 "%*s " /* used */
59 "%i\n", /* priority */
60 &dev, &prio);
61+#else
62+ dev = malloc(257);
63+ k = fscanf(m->proc_swaps,
64+ "%256s "/* device/file */
65+ "%*s " /* type of swap */
66+ "%*s " /* swap size */
67+ "%*s " /* used */
68+ "%i\n", /* priority */
69+ dev, &prio);
70+#endif /* HAVE_MSFORMAT */
71 if (k != 2) {
72 if (k == EOF)
73 break;
74Index: systemd-204/src/core/mount-setup.c
75===================================================================
76--- systemd-204.orig/src/core/mount-setup.c 2013-04-24 06:34:38.000000000 -0700
77+++ systemd-204/src/core/mount-setup.c 2013-05-23 11:26:51.780345015 -0700
78@@ -28,6 +28,7 @@
79 #include <assert.h>
80 #include <unistd.h>
81 #include <ftw.h>
82+#include <linux/fs.h>
83
84 #include "mount-setup.h"
85 #include "dev-setup.h"
86@@ -43,6 +44,8 @@
87 #include "virt.h"
88 #include "efivars.h"
89
90+#include "config.h"
91+
92 #ifndef TTY_GID
93 #define TTY_GID 5
94 #endif
95@@ -233,9 +236,12 @@
96 for (;;) {
97 char *controller;
98 int enabled = 0;
99-
100+#ifdef HAVE_MSFORMAT
101 if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) {
102-
103+#else
104+ controller = malloc(257);
105+ if (fscanf(f, "%256s %*i %*i %i", controller, &enabled) != 2) {
106+#endif /* HAVE_MSFORMAT */
107 if (feof(f))
108 break;
109
110Index: systemd-204/src/core/mount.c
111===================================================================
112--- systemd-204.orig/src/core/mount.c 2013-05-06 12:06:04.000000000 -0700
113+++ systemd-204/src/core/mount.c 2013-05-23 11:26:51.780345015 -0700
114@@ -43,6 +43,8 @@
115 #include "exit-status.h"
116 #include "def.h"
117
118+#include "config.h"
119+
120 static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
121 [MOUNT_DEAD] = UNIT_INACTIVE,
122 [MOUNT_MOUNTING] = UNIT_ACTIVATING,
123@@ -1626,7 +1628,7 @@
124 int k;
125
126 device = path = options = options2 = fstype = d = p = o = NULL;
127-
128+#ifdef HAVE_MSFORMAT
129 if ((k = fscanf(m->proc_self_mountinfo,
130 "%*s " /* (1) mount id */
131 "%*s " /* (2) parent id */
132@@ -1645,7 +1647,31 @@
133 &fstype,
134 &device,
135 &options2)) != 5) {
136-
137+#else
138+ path = malloc(257);
139+ options = malloc(257);
140+ fstype = malloc(257);
141+ device = malloc(257);
142+ options2 = malloc(257);
143+ if ((k = fscanf(m->proc_self_mountinfo,
144+ "%*s " /* (1) mount id */
145+ "%*s " /* (2) parent id */
146+ "%*s " /* (3) major:minor */
147+ "%*s " /* (4) root */
148+ "%256s " /* (5) mount point */
149+ "%256s" /* (6) mount options */
150+ "%*[^-]" /* (7) optional fields */
151+ "- " /* (8) separator */
152+ "%256s " /* (9) file system type */
153+ "%256s" /* (10) mount source */
154+ "%256s" /* (11) mount options 2 */
155+ "%*[^\n]", /* some rubbish at the end */
156+ path,
157+ options,
158+ fstype,
159+ device,
160+ options2)) != 5) {
161+#endif /* HAVE_MSFORMAT */
162 if (k == EOF)
163 break;
164
165Index: systemd-204/src/core/umount.c
166===================================================================
167--- systemd-204.orig/src/core/umount.c 2013-04-18 08:14:11.000000000 -0700
168+++ systemd-204/src/core/umount.c 2013-05-23 11:26:51.780345015 -0700
169@@ -36,6 +36,8 @@
170 #include "util.h"
171 #include "virt.h"
172
173+#include "config.h"
174+
175 typedef struct MountPoint {
176 char *path;
177 dev_t devnum;
178@@ -75,7 +77,7 @@
179 MountPoint *m;
180
181 path = p = NULL;
182-
183+#ifdef HAVE_MSFORMAT
184 if ((k = fscanf(proc_self_mountinfo,
185 "%*s " /* (1) mount id */
186 "%*s " /* (2) parent id */
187@@ -90,6 +92,23 @@
188 "%*s" /* (11) mount options 2 */
189 "%*[^\n]", /* some rubbish at the end */
190 &path)) != 1) {
191+#else
192+ path = malloc(257);
193+ if ((k = fscanf(proc_self_mountinfo,
194+ "%*s " /* (1) mount id */
195+ "%*s " /* (2) parent id */
196+ "%*s " /* (3) major:minor */
197+ "%*s " /* (4) root */
198+ "%256s " /* (5) mount point */
199+ "%*s" /* (6) mount options */
200+ "%*[^-]" /* (7) optional fields */
201+ "- " /* (8) separator */
202+ "%*s " /* (9) file system type */
203+ "%*s" /* (10) mount source */
204+ "%*s" /* (11) mount options 2 */
205+ "%*[^\n]", /* some rubbish at the end */
206+ path)) != 1) {
207+#endif /* HAVE_MSFORMAT */
208 if (k == EOF)
209 break;
210
211@@ -151,7 +170,7 @@
212 MountPoint *swap;
213 char *dev = NULL, *d;
214 int k;
215-
216+#ifdef HAVE_MSFORMAT
217 if ((k = fscanf(proc_swaps,
218 "%ms " /* device/file */
219 "%*s " /* type of swap */
220@@ -159,7 +178,16 @@
221 "%*s " /* used */
222 "%*s\n", /* priority */
223 &dev)) != 1) {
224-
225+#else
226+ dev = malloc(257);
227+ if ((k = fscanf(proc_swaps,
228+ "%256s " /* device/file */
229+ "%*s " /* type of swap */
230+ "%*s " /* swap size */
231+ "%*s " /* used */
232+ "%*s\n", /* priority */
233+ dev)) != 1) {
234+#endif /* HAVE_MSFORMAT */
235 if (k == EOF)
236 break;
237
238Index: systemd-204/src/shared/socket-util.c
239===================================================================
240--- systemd-204.orig/src/shared/socket-util.c 2013-04-18 08:14:11.000000000 -0700
241+++ systemd-204/src/shared/socket-util.c 2013-05-23 11:30:53.528348084 -0700
242@@ -40,6 +40,8 @@
243 #include "missing.h"
244 #include "fileio.h"
245
246+#include "config.h"
247+
248 int socket_address_parse(SocketAddress *a, const char *s) {
249 int r;
250 char *e, *n;
251@@ -203,8 +205,16 @@
252 a->type = SOCK_RAW;
253
254 errno = 0;
255+#ifdef HAVE_MSFORMAT
256 if (sscanf(s, "%ms %u", &sfamily, &group) < 1)
257- return errno > 0 ? -errno : -EINVAL;
258+ return errno ? -errno : -EINVAL;
259+#else
260+ sfamily = malloc(257);
261+ if (sscanf(s, "%256s %u", sfamily, &group) < 1) {
262+ free(sfamily);
263+ return errno ? -errno : -EINVAL;
264+ }
265+#endif /* HAVE_MSFORMAT */
266
267 family = netlink_family_from_string(sfamily);
268 if (family < 0)
269Index: systemd-204/src/tmpfiles/tmpfiles.c
270===================================================================
271--- systemd-204.orig/src/tmpfiles/tmpfiles.c 2013-04-24 06:34:38.000000000 -0700
272+++ systemd-204/src/tmpfiles/tmpfiles.c 2013-05-23 11:26:51.784345016 -0700
273@@ -52,6 +52,8 @@
274 #include "conf-files.h"
275 #include "capability.h"
276
277+#include "config.h"
278+
279 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
280 * them in the file system. This is intended to be used to create
281 * properly owned directories beneath /tmp, /var/tmp, /run, which are
282@@ -1029,6 +1031,7 @@
283 if (!i)
284 return log_oom();
285
286+#ifdef HAVE_MSFORMAT
287 r = sscanf(buffer,
288 "%c %ms %ms %ms %ms %ms %n",
289 &type,
290@@ -1038,6 +1041,29 @@
291 &group,
292 &age,
293 &n);
294+#else
295+ i->path = malloc(257);
296+ mode = malloc(257);
297+ user = malloc(257);
298+ group = malloc(257);
299+ age = malloc(257);
300+ r = sscanf(buffer,
301+ "%c "
302+ "%256s "
303+ "%256s "
304+ "%256s "
305+ "%256s "
306+ "%256s "
307+ "%n",
308+ &type,
309+ i->path,
310+ mode,
311+ user,
312+ group,
313+ age,
314+ &n);
315+#endif /* HAVE_MSFORMAT */
316+
317 if (r < 2) {
318 log_error("[%s:%u] Syntax error.", fname, line);
319 return -EIO;
320Index: systemd-204/src/cryptsetup/cryptsetup-generator.c
321===================================================================
322--- systemd-204.orig/src/cryptsetup/cryptsetup-generator.c 2013-05-06 12:06:04.000000000 -0700
323+++ systemd-204/src/cryptsetup/cryptsetup-generator.c 2013-05-23 11:26:51.784345016 -0700
324@@ -31,6 +31,8 @@
325 #include "strv.h"
326 #include "fileio.h"
327
328+#include "config.h"
329+
330 static const char *arg_dest = "/tmp";
331 static bool arg_enabled = true;
332 static bool arg_read_crypttab = true;
333@@ -398,7 +400,16 @@
334 if (*l == '#' || *l == 0)
335 continue;
336
337+#ifdef HAVE_MSFORMAT
338 k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options);
339+#else
340+ name = malloc(257);
341+ device = malloc(257);
342+ password = malloc(257);
343+ options = malloc(257);
344+ k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options);
345+#endif /* HAVE_MSFORMAT */
346+
347 if (k < 2 || k > 4) {
348 log_error("Failed to parse /etc/crypttab:%u, ignoring.", n);
349 r = EXIT_FAILURE;
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 @@
1# There are a number of modifiers that are allowed to be used in some
2# of the different fields. They provide the following subsitutions:
3#
4# %n the "kernel number" of the device.
5# For example, 'sda3' has a "kernel number" of '3'
6# %e the smallest number for that name which does not matches an existing node
7# %k the kernel name for the device
8# %M the kernel major number for the device
9# %m the kernel minor number for the device
10# %b the bus id for the device
11# %c the string returned by the PROGRAM
12# %s{filename} the content of a sysfs attribute
13# %% the '%' char itself
14#
15
16# Create a symlink to any touchscreen input device
17SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
18SUBSYSTEM=="input", KERNEL=="event[0-9]*", ATTRS{modalias}=="ads7846", SYMLINK+="input/touchscreen0"
diff --git a/meta/recipes-core/systemd/systemd/use-rootlibdir.patch b/meta/recipes-core/systemd/systemd/use-rootlibdir.patch
new file mode 100644
index 0000000000..4c471b673b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/use-rootlibdir.patch
@@ -0,0 +1,107 @@
1Upstream-Status: Undecided
2
3This patch removes some of hardcoded references to /lib
4and /usr/lib since on some architectures it should be
5/lib64 and /usr/lib64 atleast in OE
6
7I am not sure about the intention of hardcoded values
8thats why status is undecided
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11
12Index: git/Makefile.am
13===================================================================
14--- git.orig/Makefile.am 2012-09-22 11:07:58.811981199 -0700
15+++ git/Makefile.am 2012-09-22 11:09:11.267983956 -0700
16@@ -64,25 +64,25 @@
17
18 # Our own, non-special dirs
19 pkgsysconfdir=$(sysconfdir)/systemd
20-userunitdir=$(prefix)/lib/systemd/user
21-userpresetdir=$(prefix)/lib/systemd/user-preset
22-tmpfilesdir=$(prefix)/lib/tmpfiles.d
23-sysctldir=$(prefix)/lib/sysctl.d
24-usergeneratordir=$(prefix)/lib/systemd/user-generators
25+userunitdir=$(prefix)/$(rootlibdir)/systemd/user
26+userpresetdir=$(prefix)/$(rootlibdir)/systemd/user-preset
27+tmpfilesdir=$(prefix)/$(rootlibdir)/tmpfiles.d
28+sysctldir=$(prefix)/$(rootlibdir)/sysctl.d
29+usergeneratordir=$(prefix)/$(rootlibdir)/systemd/user-generators
30 pkgincludedir=$(includedir)/systemd
31 systemgeneratordir=$(rootlibexecdir)/system-generators
32 systemshutdowndir=$(rootlibexecdir)/system-shutdown
33 systemsleepdir=$(rootlibexecdir)/system-sleep
34-systemunitdir=$(rootprefix)/lib/systemd/system
35-systempresetdir=$(rootprefix)/lib/systemd/system-preset
36-udevlibexecdir=$(rootprefix)/lib/udev
37+systemunitdir=$(rootprefix)/$(rootlibdir)/systemd/system
38+systempresetdir=$(rootprefix)/$(rootlibdir)/systemd/system-preset
39+udevlibexecdir=$(rootprefix)/$(rootlibdir)/udev
40 udevhomedir = $(udevlibexecdir)
41 udevrulesdir = $(udevlibexecdir)/rules.d
42
43 # And these are the special ones for /
44 rootprefix=@rootprefix@
45 rootbindir=$(rootprefix)/bin
46-rootlibexecdir=$(rootprefix)/lib/systemd
47+rootlibexecdir=$(rootprefix)/$(rootlibdir)/systemd
48
49 CLEANFILES = $(BUILT_SOURCES)
50 EXTRA_DIST =
51@@ -132,7 +132,7 @@
52 -DSYSTEMD_STDIO_BRIDGE_BINARY_PATH=\"$(bindir)/systemd-stdio-bridge\" \
53 -DROOTPREFIX=\"$(rootprefix)\" \
54 -DRUNTIME_DIR=\"/run\" \
55- -DRANDOM_SEED=\"$(localstatedir)/lib/random-seed\" \
56+ -DRANDOM_SEED=\"$(localstatedir)/$(rootlibdir)/random-seed\" \
57 -DSYSTEMD_CRYPTSETUP_PATH=\"$(rootlibexecdir)/systemd-cryptsetup\" \
58 -DSYSTEM_GENERATOR_PATH=\"$(systemgeneratordir)\" \
59 -DUSER_GENERATOR_PATH=\"$(usergeneratordir)\" \
60@@ -2692,7 +2692,7 @@
61
62 binfmt-install-data-hook:
63 $(MKDIR_P) -m 0755 \
64- $(DESTDIR)$(prefix)/lib/binfmt.d \
65+ $(DESTDIR)$(prefix)/$(rootlibdir)/binfmt.d \
66 $(DESTDIR)$(sysconfdir)/binfmt.d \
67 $(DESTDIR)$(systemunitdir)/sysinit.target.wants
68 ( cd $(DESTDIR)$(systemunitdir)/sysinit.target.wants && \
69@@ -3107,7 +3107,7 @@
70
71 timedated-install-data-hook:
72 $(MKDIR_P) -m 0755 \
73- $(DESTDIR)$(prefix)/lib/systemd/ntp-units.d \
74+ $(DESTDIR)$(prefix)/$(rootlibdir)/systemd/ntp-units.d \
75 $(DESTDIR)$(sysconfdir)/systemd/ntp-units.d
76 ( cd $(DESTDIR)$(systemunitdir) && \
77 rm -f dbus-org.freedesktop.timedate1.service && \
78@@ -3337,7 +3337,7 @@
79 logind-install-data-hook:
80 $(MKDIR_P) -m 0755 \
81 $(DESTDIR)$(systemunitdir)/multi-user.target.wants \
82- $(DESTDIR)$(localstatedir)/lib/systemd
83+ $(DESTDIR)$(localstatedir)/$(rootlibdir)/systemd
84 ( cd $(DESTDIR)$(systemunitdir) && \
85 rm -f dbus-org.freedesktop.login1.service && \
86 $(LN_S) systemd-logind.service dbus-org.freedesktop.login1.service)
87@@ -3494,7 +3494,7 @@
88 -e 's,@PACKAGE_VERSION\@,$(PACKAGE_VERSION),g' \
89 -e 's,@PACKAGE_NAME\@,$(PACKAGE_NAME),g' \
90 -e 's,@PACKAGE_URL\@,$(PACKAGE_URL),g' \
91- -e 's,@RANDOM_SEED\@,$(localstatedir)/lib/random-seed,g' \
92+ -e 's,@RANDOM_SEED\@,$(localstatedir)/$(rootlibdir)/random-seed,g' \
93 -e 's,@prefix\@,$(prefix),g' \
94 -e 's,@exec_prefix\@,$(exec_prefix),g' \
95 -e 's,@libdir\@,$(libdir),g' \
96@@ -3619,9 +3619,9 @@
97 $(MKDIR_P) -m 0755 \
98 $(DESTDIR)$(tmpfilesdir) \
99 $(DESTDIR)$(sysconfdir)/tmpfiles.d \
100- $(DESTDIR)$(prefix)/lib/modules-load.d \
101+ $(DESTDIR)$(prefix)/$(rootlibdir)/modules-load.d \
102 $(DESTDIR)$(sysconfdir)/modules-load.d \
103- $(DESTDIR)$(prefix)/lib/sysctl.d \
104+ $(DESTDIR)$(prefix)/$(rootlibdir)/sysctl.d \
105 $(DESTDIR)$(sysconfdir)/sysctl.d \
106 $(DESTDIR)$(systemshutdowndir) \
107 $(DESTDIR)$(systemsleepdir) \