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-uClibc-doesn-t-implement-pwritev-preadv.patch34
-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-ptest3
-rw-r--r--meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch513
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch32
-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.patch84
-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.patch30
-rw-r--r--meta/recipes-core/systemd/systemd/touchscreen.rules18
-rw-r--r--meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch37
-rw-r--r--meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch19
15 files changed, 1020 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-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..9fdb3c9ab3
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-uClibc-doesn-t-implement-pwritev-preadv.patch
@@ -0,0 +1,34 @@
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
15Index: systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c
16===================================================================
17--- systemd-209.orig/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 15:03:09.983254602 -0800
18+++ systemd-209/src/libsystemd/sd-bus/test-bus-memfd.c 2014-02-19 23:42:10.636652864 -0800
19@@ -151,6 +151,7 @@
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@@ -173,6 +174,7 @@
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
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..2f6bd93a5b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/run-ptest
@@ -0,0 +1,3 @@
1tar -C test -xJf test/sys.tar.xz
2make test/rules-test.sh.log
3make test/udev-test.pl.log
diff --git a/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch b/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch
new file mode 100644
index 0000000000..c5bee97238
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/sd-bus-don-t-use-assert_return-to-check-for-disconne.patch
@@ -0,0 +1,513 @@
1From a3d59cd1b0a2738d06893948492113f2c35be0af Mon Sep 17 00:00:00 2001
2From: Lennart Poettering <lennart@poettering.net>
3Date: Wed, 19 Mar 2014 21:41:21 +0100
4Subject: [PATCH] sd-bus: don't use assert_return() to check for disconnected
5 bus connections
6
7A terminated connection is a runtime error and not a developer mistake,
8hence don't use assert_return() to check for it.
9
10Upstream-Status: Backport
11
12Signed-off-by: Jonathan Liu <net147@gmail.com>
13---
14 src/libsystemd/sd-bus/bus-control.c | 20 +++++++++---
15 src/libsystemd/sd-bus/bus-convenience.c | 58 +++++++++++++++++++++++++--------
16 src/libsystemd/sd-bus/bus-objects.c | 23 +++++++++----
17 src/libsystemd/sd-bus/sd-bus.c | 49 ++++++++++++++++++++--------
18 4 files changed, 113 insertions(+), 37 deletions(-)
19
20diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
21index bb6683e..bd392a2 100644
22--- a/src/libsystemd/sd-bus/bus-control.c
23+++ b/src/libsystemd/sd-bus/bus-control.c
24@@ -128,12 +128,14 @@ _public_ int sd_bus_request_name(sd_bus *bus, const char *name, uint64_t flags)
25 assert_return(bus, -EINVAL);
26 assert_return(name, -EINVAL);
27 assert_return(bus->bus_client, -EINVAL);
28- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
29 assert_return(!bus_pid_changed(bus), -ECHILD);
30 assert_return(!(flags & ~(SD_BUS_NAME_ALLOW_REPLACEMENT|SD_BUS_NAME_REPLACE_EXISTING|SD_BUS_NAME_QUEUE)), -EINVAL);
31 assert_return(service_name_is_valid(name), -EINVAL);
32 assert_return(name[0] != ':', -EINVAL);
33
34+ if (!BUS_IS_OPEN(bus->state))
35+ return -ENOTCONN;
36+
37 if (bus->is_kernel)
38 return bus_request_name_kernel(bus, name, flags);
39 else
40@@ -201,11 +203,13 @@ _public_ int sd_bus_release_name(sd_bus *bus, const char *name) {
41 assert_return(bus, -EINVAL);
42 assert_return(name, -EINVAL);
43 assert_return(bus->bus_client, -EINVAL);
44- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
45 assert_return(!bus_pid_changed(bus), -ECHILD);
46 assert_return(service_name_is_valid(name), -EINVAL);
47 assert_return(name[0] != ':', -EINVAL);
48
49+ if (!BUS_IS_OPEN(bus->state))
50+ return -ENOTCONN;
51+
52 if (bus->is_kernel)
53 return bus_release_name_kernel(bus, name);
54 else
55@@ -342,9 +346,11 @@ static int bus_list_names_dbus1(sd_bus *bus, char ***acquired, char ***activatab
56 _public_ int sd_bus_list_names(sd_bus *bus, char ***acquired, char ***activatable) {
57 assert_return(bus, -EINVAL);
58 assert_return(acquired || activatable, -EINVAL);
59- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
60 assert_return(!bus_pid_changed(bus), -ECHILD);
61
62+ if (!BUS_IS_OPEN(bus->state))
63+ return -ENOTCONN;
64+
65 if (bus->is_kernel)
66 return bus_list_names_kernel(bus, acquired, activatable);
67 else
68@@ -735,11 +741,13 @@ _public_ int sd_bus_get_owner(
69 assert_return(name, -EINVAL);
70 assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP);
71 assert_return(mask == 0 || creds, -EINVAL);
72- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
73 assert_return(!bus_pid_changed(bus), -ECHILD);
74 assert_return(service_name_is_valid(name), -EINVAL);
75 assert_return(bus->bus_client, -ENODATA);
76
77+ if (!BUS_IS_OPEN(bus->state))
78+ return -ENOTCONN;
79+
80 if (bus->is_kernel)
81 return bus_get_owner_kdbus(bus, name, mask, creds);
82 else
83@@ -1196,10 +1204,12 @@ _public_ int sd_bus_get_owner_machine_id(sd_bus *bus, const char *name, sd_id128
84 assert_return(bus, -EINVAL);
85 assert_return(name, -EINVAL);
86 assert_return(machine, -EINVAL);
87- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
88 assert_return(!bus_pid_changed(bus), -ECHILD);
89 assert_return(service_name_is_valid(name), -EINVAL);
90
91+ if (!BUS_IS_OPEN(bus->state))
92+ return -ENOTCONN;
93+
94 if (streq_ptr(name, bus->unique_name))
95 return sd_id128_get_machine(machine);
96
97diff --git a/src/libsystemd/sd-bus/bus-convenience.c b/src/libsystemd/sd-bus/bus-convenience.c
98index 6e02ad3..c5b9cd4 100644
99--- a/src/libsystemd/sd-bus/bus-convenience.c
100+++ b/src/libsystemd/sd-bus/bus-convenience.c
101@@ -36,9 +36,11 @@ _public_ int sd_bus_emit_signal(
102 int r;
103
104 assert_return(bus, -EINVAL);
105- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
106 assert_return(!bus_pid_changed(bus), -ECHILD);
107
108+ if (!BUS_IS_OPEN(bus->state))
109+ return -ENOTCONN;
110+
111 r = sd_bus_message_new_signal(bus, &m, path, interface, member);
112 if (r < 0)
113 return r;
114@@ -70,9 +72,11 @@ _public_ int sd_bus_call_method(
115 int r;
116
117 assert_return(bus, -EINVAL);
118- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
119 assert_return(!bus_pid_changed(bus), -ECHILD);
120
121+ if (!BUS_IS_OPEN(bus->state))
122+ return -ENOTCONN;
123+
124 r = sd_bus_message_new_method_call(bus, &m, destination, path, interface, member);
125 if (r < 0)
126 return r;
127@@ -100,9 +104,12 @@ _public_ int sd_bus_reply_method_return(
128 assert_return(call, -EINVAL);
129 assert_return(call->sealed, -EPERM);
130 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
131- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
132+ assert_return(call->bus, -EINVAL);
133 assert_return(!bus_pid_changed(call->bus), -ECHILD);
134
135+ if (!BUS_IS_OPEN(call->bus->state))
136+ return -ENOTCONN;
137+
138 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
139 return 0;
140
141@@ -134,9 +141,12 @@ _public_ int sd_bus_reply_method_error(
142 assert_return(call->sealed, -EPERM);
143 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
144 assert_return(sd_bus_error_is_set(e), -EINVAL);
145- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
146+ assert_return(call->bus, -EINVAL);
147 assert_return(!bus_pid_changed(call->bus), -ECHILD);
148
149+ if (!BUS_IS_OPEN(call->bus->state))
150+ return -ENOTCONN;
151+
152 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
153 return 0;
154
155@@ -159,9 +169,12 @@ _public_ int sd_bus_reply_method_errorf(
156 assert_return(call, -EINVAL);
157 assert_return(call->sealed, -EPERM);
158 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
159- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
160+ assert_return(call->bus, -EINVAL);
161 assert_return(!bus_pid_changed(call->bus), -ECHILD);
162
163+ if (!BUS_IS_OPEN(call->bus->state))
164+ return -ENOTCONN;
165+
166 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
167 return 0;
168
169@@ -182,9 +195,12 @@ _public_ int sd_bus_reply_method_errno(
170 assert_return(call, -EINVAL);
171 assert_return(call->sealed, -EPERM);
172 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
173- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
174+ assert_return(call->bus, -EINVAL);
175 assert_return(!bus_pid_changed(call->bus), -ECHILD);
176
177+ if (!BUS_IS_OPEN(call->bus->state))
178+ return -ENOTCONN;
179+
180 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
181 return 0;
182
183@@ -208,9 +224,12 @@ _public_ int sd_bus_reply_method_errnof(
184 assert_return(call, -EINVAL);
185 assert_return(call->sealed, -EPERM);
186 assert_return(call->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
187- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
188+ assert_return(call->bus, -EINVAL);
189 assert_return(!bus_pid_changed(call->bus), -ECHILD);
190
191+ if (!BUS_IS_OPEN(call->bus->state))
192+ return -ENOTCONN;
193+
194 if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)
195 return 0;
196
197@@ -239,9 +258,11 @@ _public_ int sd_bus_get_property(
198 assert_return(member_name_is_valid(member), -EINVAL);
199 assert_return(reply, -EINVAL);
200 assert_return(signature_is_single(type, false), -EINVAL);
201- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
202 assert_return(!bus_pid_changed(bus), -ECHILD);
203
204+ if (!BUS_IS_OPEN(bus->state))
205+ return -ENOTCONN;
206+
207 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &rep, "ss", strempty(interface), member);
208 if (r < 0)
209 return r;
210@@ -273,9 +294,11 @@ _public_ int sd_bus_get_property_trivial(
211 assert_return(member_name_is_valid(member), -EINVAL);
212 assert_return(bus_type_is_trivial(type), -EINVAL);
213 assert_return(ptr, -EINVAL);
214- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
215 assert_return(!bus_pid_changed(bus), -ECHILD);
216
217+ if (!BUS_IS_OPEN(bus->state))
218+ return -ENOTCONN;
219+
220 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member);
221 if (r < 0)
222 return r;
223@@ -309,9 +332,11 @@ _public_ int sd_bus_get_property_string(
224 assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL);
225 assert_return(member_name_is_valid(member), -EINVAL);
226 assert_return(ret, -EINVAL);
227- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
228 assert_return(!bus_pid_changed(bus), -ECHILD);
229
230+ if (!BUS_IS_OPEN(bus->state))
231+ return -ENOTCONN;
232+
233 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member);
234 if (r < 0)
235 return r;
236@@ -348,9 +373,11 @@ _public_ int sd_bus_get_property_strv(
237 assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL);
238 assert_return(member_name_is_valid(member), -EINVAL);
239 assert_return(ret, -EINVAL);
240- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
241 assert_return(!bus_pid_changed(bus), -ECHILD);
242
243+ if (!BUS_IS_OPEN(bus->state))
244+ return -ENOTCONN;
245+
246 r = sd_bus_call_method(bus, destination, path, "org.freedesktop.DBus.Properties", "Get", error, &reply, "ss", strempty(interface), member);
247 if (r < 0)
248 return r;
249@@ -383,9 +410,11 @@ _public_ int sd_bus_set_property(
250 assert_return(isempty(interface) || interface_name_is_valid(interface), -EINVAL);
251 assert_return(member_name_is_valid(member), -EINVAL);
252 assert_return(signature_is_single(type, false), -EINVAL);
253- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
254 assert_return(!bus_pid_changed(bus), -ECHILD);
255
256+ if (!BUS_IS_OPEN(bus->state))
257+ return -ENOTCONN;
258+
259 r = sd_bus_message_new_method_call(bus, &m, destination, path, "org.freedesktop.DBus.Properties", "Set");
260 if (r < 0)
261 return r;
262@@ -416,9 +445,12 @@ _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_b
263
264 assert_return(call, -EINVAL);
265 assert_return(call->sealed, -EPERM);
266- assert_return(call->bus && BUS_IS_OPEN(call->bus->state), -ENOTCONN);
267+ assert_return(call->bus, -EINVAL);
268 assert_return(!bus_pid_changed(call->bus), -ECHILD);
269
270+ if (!BUS_IS_OPEN(call->bus->state))
271+ return -ENOTCONN;
272+
273 c = sd_bus_message_get_creds(call);
274
275 /* All data we need? */
276diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
277index 08792fe..539cf2a 100644
278--- a/src/libsystemd/sd-bus/bus-objects.c
279+++ b/src/libsystemd/sd-bus/bus-objects.c
280@@ -2196,9 +2196,10 @@ _public_ int sd_bus_emit_properties_changed_strv(
281 assert_return(bus, -EINVAL);
282 assert_return(object_path_is_valid(path), -EINVAL);
283 assert_return(interface_name_is_valid(interface), -EINVAL);
284- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
285 assert_return(!bus_pid_changed(bus), -ECHILD);
286
287+ if (!BUS_IS_OPEN(bus->state))
288+ return -ENOTCONN;
289
290 /* A non-NULL but empty names list means nothing needs to be
291 generated. A NULL list OTOH indicates that all properties
292@@ -2241,9 +2242,11 @@ _public_ int sd_bus_emit_properties_changed(
293 assert_return(bus, -EINVAL);
294 assert_return(object_path_is_valid(path), -EINVAL);
295 assert_return(interface_name_is_valid(interface), -EINVAL);
296- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
297 assert_return(!bus_pid_changed(bus), -ECHILD);
298
299+ if (!BUS_IS_OPEN(bus->state))
300+ return -ENOTCONN;
301+
302 if (!name)
303 return 0;
304
305@@ -2361,9 +2364,11 @@ _public_ int sd_bus_emit_interfaces_added_strv(sd_bus *bus, const char *path, ch
306
307 assert_return(bus, -EINVAL);
308 assert_return(object_path_is_valid(path), -EINVAL);
309- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
310 assert_return(!bus_pid_changed(bus), -ECHILD);
311
312+ if (!BUS_IS_OPEN(bus->state))
313+ return -ENOTCONN;
314+
315 if (strv_isempty(interfaces))
316 return 0;
317
318@@ -2421,9 +2426,11 @@ _public_ int sd_bus_emit_interfaces_added(sd_bus *bus, const char *path, const c
319
320 assert_return(bus, -EINVAL);
321 assert_return(object_path_is_valid(path), -EINVAL);
322- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
323 assert_return(!bus_pid_changed(bus), -ECHILD);
324
325+ if (!BUS_IS_OPEN(bus->state))
326+ return -ENOTCONN;
327+
328 interfaces = strv_from_stdarg_alloca(interface);
329
330 return sd_bus_emit_interfaces_added_strv(bus, path, interfaces);
331@@ -2435,9 +2442,11 @@ _public_ int sd_bus_emit_interfaces_removed_strv(sd_bus *bus, const char *path,
332
333 assert_return(bus, -EINVAL);
334 assert_return(object_path_is_valid(path), -EINVAL);
335- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
336 assert_return(!bus_pid_changed(bus), -ECHILD);
337
338+ if (!BUS_IS_OPEN(bus->state))
339+ return -ENOTCONN;
340+
341 if (strv_isempty(interfaces))
342 return 0;
343
344@@ -2461,9 +2470,11 @@ _public_ int sd_bus_emit_interfaces_removed(sd_bus *bus, const char *path, const
345
346 assert_return(bus, -EINVAL);
347 assert_return(object_path_is_valid(path), -EINVAL);
348- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
349 assert_return(!bus_pid_changed(bus), -ECHILD);
350
351+ if (!BUS_IS_OPEN(bus->state))
352+ return -ENOTCONN;
353+
354 interfaces = strv_from_stdarg_alloca(interface);
355
356 return sd_bus_emit_interfaces_removed_strv(bus, path, interfaces);
357diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
358index fa6d43a..15c7677 100644
359--- a/src/libsystemd/sd-bus/sd-bus.c
360+++ b/src/libsystemd/sd-bus/sd-bus.c
361@@ -1594,10 +1594,12 @@ static int bus_send_internal(sd_bus *bus, sd_bus_message *_m, uint64_t *cookie,
362 int r;
363
364 assert_return(bus, -EINVAL);
365- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
366 assert_return(m, -EINVAL);
367 assert_return(!bus_pid_changed(bus), -ECHILD);
368
369+ if (!BUS_IS_OPEN(bus->state))
370+ return -ENOTCONN;
371+
372 if (m->n_fds > 0) {
373 r = sd_bus_can_send(bus, SD_BUS_TYPE_UNIX_FD);
374 if (r < 0)
375@@ -1673,10 +1675,12 @@ _public_ int sd_bus_send_to(sd_bus *bus, sd_bus_message *m, const char *destinat
376 int r;
377
378 assert_return(bus, -EINVAL);
379- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
380 assert_return(m, -EINVAL);
381 assert_return(!bus_pid_changed(bus), -ECHILD);
382
383+ if (!BUS_IS_OPEN(bus->state))
384+ return -ENOTCONN;
385+
386 if (!streq_ptr(m->destination, destination)) {
387
388 if (!destination)
389@@ -1728,13 +1732,15 @@ _public_ int sd_bus_call_async(
390 int r;
391
392 assert_return(bus, -EINVAL);
393- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
394 assert_return(m, -EINVAL);
395 assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
396 assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL);
397 assert_return(callback, -EINVAL);
398 assert_return(!bus_pid_changed(bus), -ECHILD);
399
400+ if (!BUS_IS_OPEN(bus->state))
401+ return -ENOTCONN;
402+
403 r = hashmap_ensure_allocated(&bus->reply_callbacks, uint64_hash_func, uint64_compare_func);
404 if (r < 0)
405 return r;
406@@ -1841,13 +1847,15 @@ _public_ int sd_bus_call(
407 int r;
408
409 assert_return(bus, -EINVAL);
410- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
411 assert_return(m, -EINVAL);
412 assert_return(m->header->type == SD_BUS_MESSAGE_METHOD_CALL, -EINVAL);
413 assert_return(!(m->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED), -EINVAL);
414 assert_return(!bus_error_is_dirty(error), -EINVAL);
415 assert_return(!bus_pid_changed(bus), -ECHILD);
416
417+ if (!BUS_IS_OPEN(bus->state))
418+ return -ENOTCONN;
419+
420 r = bus_ensure_running(bus);
421 if (r < 0)
422 return r;
423@@ -1973,9 +1981,11 @@ _public_ int sd_bus_get_events(sd_bus *bus) {
424 int flags = 0;
425
426 assert_return(bus, -EINVAL);
427- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN);
428 assert_return(!bus_pid_changed(bus), -ECHILD);
429
430+ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING)
431+ return -ENOTCONN;
432+
433 if (bus->state == BUS_OPENING)
434 flags |= POLLOUT;
435 else if (bus->state == BUS_AUTHENTICATING) {
436@@ -2000,9 +2010,11 @@ _public_ int sd_bus_get_timeout(sd_bus *bus, uint64_t *timeout_usec) {
437
438 assert_return(bus, -EINVAL);
439 assert_return(timeout_usec, -EINVAL);
440- assert_return(BUS_IS_OPEN(bus->state) || bus->state == BUS_CLOSING, -ENOTCONN);
441 assert_return(!bus_pid_changed(bus), -ECHILD);
442
443+ if (!BUS_IS_OPEN(bus->state) && bus->state != BUS_CLOSING)
444+ return -ENOTCONN;
445+
446 if (bus->track_queue) {
447 *timeout_usec = 0;
448 return 1;
449@@ -2531,7 +2543,8 @@ static int bus_poll(sd_bus *bus, bool need_more, uint64_t timeout_usec) {
450 if (bus->state == BUS_CLOSING)
451 return 1;
452
453- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
454+ if (!BUS_IS_OPEN(bus->state))
455+ return -ENOTCONN;
456
457 e = sd_bus_get_events(bus);
458 if (e < 0)
459@@ -2586,7 +2599,8 @@ _public_ int sd_bus_wait(sd_bus *bus, uint64_t timeout_usec) {
460 if (bus->state == BUS_CLOSING)
461 return 0;
462
463- assert_return(BUS_IS_OPEN(bus->state) , -ENOTCONN);
464+ if (!BUS_IS_OPEN(bus->state))
465+ return -ENOTCONN;
466
467 if (bus->rqueue_size > 0)
468 return 0;
469@@ -2603,7 +2617,8 @@ _public_ int sd_bus_flush(sd_bus *bus) {
470 if (bus->state == BUS_CLOSING)
471 return 0;
472
473- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
474+ if (!BUS_IS_OPEN(bus->state))
475+ return -ENOTCONN;
476
477 r = bus_ensure_running(bus);
478 if (r < 0)
479@@ -3113,9 +3128,13 @@ _public_ int sd_bus_get_peer_creds(sd_bus *bus, uint64_t mask, sd_bus_creds **re
480 assert_return(bus, -EINVAL);
481 assert_return(mask <= _SD_BUS_CREDS_ALL, -ENOTSUP);
482 assert_return(ret, -EINVAL);
483- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
484 assert_return(!bus_pid_changed(bus), -ECHILD);
485- assert_return(!bus->is_kernel, -ENOTSUP);
486+
487+ if (!bus->is_kernel)
488+ return -ENOTSUP;
489+
490+ if (!BUS_IS_OPEN(bus->state))
491+ return -ENOTCONN;
492
493 if (!bus->ucred_valid && !isempty(bus->label))
494 return -ENODATA;
495@@ -3154,9 +3173,13 @@ _public_ int sd_bus_try_close(sd_bus *bus) {
496 int r;
497
498 assert_return(bus, -EINVAL);
499- assert_return(BUS_IS_OPEN(bus->state), -ENOTCONN);
500 assert_return(!bus_pid_changed(bus), -ECHILD);
501- assert_return(bus->is_kernel, -ENOTSUP);
502+
503+ if (!bus->is_kernel)
504+ return -ENOTSUP;
505+
506+ if (!BUS_IS_OPEN(bus->state))
507+ return -ENOTCONN;
508
509 if (bus->rqueue_size > 0)
510 return -EBUSY;
511--
5121.9.1
513
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
new file mode 100644
index 0000000000..4639532236
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
@@ -0,0 +1,32 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: git/configure.ac
5===================================================================
6--- git.orig/configure.ac 2014-03-15 17:53:51.756340454 -0700
7+++ git/configure.ac 2014-03-15 18:07:34.888355897 -0700
8@@ -78,6 +78,24 @@
9
10 M4_DEFINES=
11
12+# check for few functions not implemented in uClibc
13+
14+AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
15+
16+# check for %ms format support - assume always no if cross compiling
17+
18+AC_MSG_CHECKING([whether %ms format is supported by *scanf])
19+
20+AC_LINK_IFELSE(
21+ [AC_LANG_PROGRAM([
22+ #include <stdio.h>
23+ ],[
24+ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
25+ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
26+ return (rc==3)?0:1;])],
27+ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
28+ [AC_MSG_RESULT([no])])
29+
30 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
31 m4_ifdef([GTK_DOC_CHECK], [
32 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
new file mode 100644
index 0000000000..7170a38af3
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
@@ -0,0 +1,29 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-209/src/nspawn/nspawn.c
5===================================================================
6--- systemd-209.orig/src/nspawn/nspawn.c 2014-02-19 15:03:09.000000000 -0800
7+++ systemd-209/src/nspawn/nspawn.c 2014-02-19 23:20:38.720628627 -0800
8@@ -91,6 +91,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 sd_id128_t arg_uuid = {};
17@@ -2045,7 +2047,12 @@
18 a[0] = (char*) "/sbin/init";
19 execve(a[0], a, env_use);
20 } else if (argc > optind)
21+#ifdef HAVE_EXECVPE
22 execvpe(argv[optind], argv + optind, env_use);
23+#else
24+ environ = env_use;
25+ execvp(argv[optind], argv + optind);
26+#endif /* HAVE_EXECVPE */
27 else {
28 chdir(home ? home : "/root");
29 execle("/bin/bash", "-bash", NULL, env_use);
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
new file mode 100644
index 0000000000..de73be96a7
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
@@ -0,0 +1,84 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: systemd-209/src/journal/journal-file.c
5===================================================================
6--- systemd-209.orig/src/journal/journal-file.c 2014-02-12 18:42:33.000000000 -0800
7+++ systemd-209/src/journal/journal-file.c 2014-02-19 23:23:19.464631643 -0800
8@@ -38,6 +38,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@@ -316,7 +318,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@@ -364,9 +366,24 @@
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+#else
35+ /* Use good old method to write zeros into the journal file
36+ perhaps very inefficient yet working. */
37+ if(new_size > old_size) {
38+ char *buf = alloca(new_size - old_size);
39+ off_t oldpos = lseek(f->fd, 0, SEEK_CUR);
40+ bzero(buf, new_size - old_size);
41+ lseek(f->fd, old_size, SEEK_SET);
42+ r = write(f->fd, buf, new_size - old_size);
43+ lseek(f->fd, oldpos, SEEK_SET);
44+ }
45+ if (r < 0)
46+ return -errno;
47+#endif /* HAVE_POSIX_FALLOCATE */
48
49 if (fstat(f->fd, &f->last_stat) < 0)
50 return -errno;
51Index: systemd-209/src/journal/journald-kmsg.c
52===================================================================
53--- systemd-209.orig/src/journal/journald-kmsg.c 2014-02-19 15:03:09.000000000 -0800
54+++ systemd-209/src/journal/journald-kmsg.c 2014-02-19 23:22:14.396630422 -0800
55@@ -441,6 +441,7 @@
56
57 int server_open_kernel_seqnum(Server *s) {
58 int fd;
59+ int r = 0;
60 uint64_t *p;
61
62 assert(s);
63@@ -454,8 +455,19 @@
64 log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m");
65 return 0;
66 }
67-
68- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) {
69+#ifdef HAVE_POSIX_ALLOCATE
70+ r = posix_fallocate(fd, 0, sizeof(uint64_t));
71+#else
72+ /* Use good old method to write zeros into the journal file
73+ perhaps very inefficient yet working. */
74+ char *buf = alloca(sizeof(uint64_t));
75+ off_t oldpos = lseek(fd, 0, SEEK_CUR);
76+ bzero(buf, sizeof(uint64_t));
77+ lseek(fd, 0, SEEK_SET);
78+ r = write(fd, buf, sizeof(uint64_t));
79+ lseek(fd, oldpos, SEEK_SET);
80+#endif /* HAVE_POSIX_FALLOCATE */
81+ if (r < 0) {
82 log_error("Failed to allocate sequential number file, ignoring: %m");
83 close_nointr_nofail(fd);
84 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..9b4c940984
--- /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: git/units/getty@.service.m4
11===================================================================
12--- git.orig/units/getty@.service.m4 2014-03-15 08:16:17.000000000 -0700
13+++ git/units/getty@.service.m4 2014-03-15 08:21:11.007695825 -0700
14@@ -27,7 +27,7 @@
15
16 [Service]
17 # the VT is cleared by TTYVTDisallocate
18-ExecStart=-/sbin/agetty --noclear %I $TERM
19+ExecStart=-/sbin/getty -L %I $TERM
20 Type=idle
21 Restart=always
22 RestartSec=0
23Index: git/units/serial-getty@.service.m4
24===================================================================
25--- git.orig/units/serial-getty@.service.m4 2014-03-15 08:16:17.000000000 -0700
26+++ git/units/serial-getty@.service.m4 2014-03-15 08:22:31.291697331 -0700
27@@ -22,7 +22,7 @@
28 IgnoreOnIsolate=yes
29
30 [Service]
31-ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
32+ExecStart=-/sbin/getty -L 115200 %I $TERM
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..8c7aa072da
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
@@ -0,0 +1,30 @@
1Upstream-Status: Denied [no desire for uclibc support]
2Signed-off-by: Khem Raj <raj.khem@gmail.com>
3
4Index: git/src/shared/util.c
5===================================================================
6--- git.orig/src/shared/util.c 2014-03-15 15:14:21.368160908 -0700
7+++ git/src/shared/util.c 2014-03-15 15:44:21.988194688 -0700
8@@ -85,6 +85,8 @@
9 #include "def.h"
10 #include "missing.h"
11
12+#include "config.h"
13+
14 int saved_argc = 0;
15 char **saved_argv = NULL;
16
17@@ -6222,7 +6224,13 @@
18
19 u = umask(077);
20
21+#ifdef HAVE_MKOSTEMP
22 fd = mkostemp(pattern, flags);
23+#else
24+ fd = mkstemp(pattern);
25+ if (fd >= 0) fcntl(fd, F_SETFD, flags);
26+#endif /* HAVE_MKOSTEMP */
27+
28 if (fd < 0)
29 return -errno;
30
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/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
new file mode 100644
index 0000000000..39dfc9e2ea
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
@@ -0,0 +1,37 @@
1bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc
2
3Upstream-Status: Inappropriate [uclibc-specific]
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: git/src/shared/util.c
8===================================================================
9--- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700
10+++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700
11@@ -6332,11 +6332,24 @@
12
13 /* We return this as uint64_t in case we are running as 32bit
14 * process on a 64bit kernel with huge amounts of memory */
15-
16+#ifdef __UCLIBC__
17+ char line[128];
18+ FILE *f = fopen("/proc/meminfo", "r");
19+ if (f == NULL)
20+ return 0;
21+ while (!feof(f) && fgets(line, sizeof(line)-1, f)) {
22+ if (sscanf(line, "MemTotal: %l kB", &mem) == 1) {
23+ mem *= 1024;
24+ break;
25+ }
26+ }
27+ fclose(f);
28+ return (uint64_t) mem;
29+#else
30 mem = sysconf(_SC_PHYS_PAGES);
31 assert(mem > 0);
32-
33 return (uint64_t) mem * (uint64_t) page_size();
34+#endif
35 }
36
37 char* mount_test_option(const char *haystack, const char *needle) {
diff --git a/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch
new file mode 100644
index 0000000000..15645dee11
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/uclibc-sysinfo_h.patch
@@ -0,0 +1,19 @@
1Dont include sys/sysinfo.h on uclibc it conflicts with linux/sysinfo.h
2
3Signed-off-by: Khem Raj <raj.khem@gmail.com>
4Upstream-Status: Inappropriate [uclibc specific]
5
6Index: systemd-209/src/readahead/readahead-common.c
7===================================================================
8--- systemd-209.orig/src/readahead/readahead-common.c 2014-02-12 18:42:33.810685053 -0800
9+++ systemd-209/src/readahead/readahead-common.c 2014-02-19 23:49:31.856661142 -0800
10@@ -22,7 +22,9 @@
11 #include <errno.h>
12 #include <stdlib.h>
13 #include <string.h>
14+#ifndef __UCLIBC__
15 #include <sys/sysinfo.h>
16+#endif
17 #include <sys/inotify.h>
18 #include <fcntl.h>
19 #include <sys/mman.h>