summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/systemd')
-rw-r--r--meta/recipes-core/systemd/systemd-compat-units.bb56
-rw-r--r--meta/recipes-core/systemd/systemd-compat-units/machineid.service16
-rw-r--r--meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service17
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty.bb49
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service36
-rw-r--r--meta/recipes-core/systemd/systemd-systemctl-native.bb15
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl127
-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
-rw-r--r--meta/recipes-core/systemd/systemd_206.bb327
24 files changed, 1753 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd-compat-units.bb b/meta/recipes-core/systemd/systemd-compat-units.bb
new file mode 100644
index 0000000000..c47c14bf95
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -0,0 +1,56 @@
1DESCRIPTION = "Units to make systemd work better with existing sysvinit scripts"
2
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
5
6PR = "r18"
7
8DEPENDS = "systemd-systemctl-native"
9
10inherit allarch
11
12SRC_URI = "file://*.service"
13
14do_install() {
15 install -d ${D}${systemd_unitdir}/system/basic.target.wants
16 install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
17 install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system
18 ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/
19 ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
20
21 install -m 0644 ${WORKDIR}/machineid.service ${D}${systemd_unitdir}/system
22 ln -sf ../machineid.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
23 ln -sf ../machineid.service ${D}${systemd_unitdir}/system/basic.target.wants/
24}
25
26SYSTEMD_DISABLED_SYSV_SERVICES = " \
27 busybox-udhcpc \
28 dnsmasq \
29 hwclock \
30 networking \
31 syslog.busybox \
32 dbus-1 \
33"
34
35pkg_postinst_${PN} () {
36 cd $D${sysconfdir}/init.d
37
38 echo "Disabling the following sysv scripts: "
39
40 OPTS=""
41
42 if [ -n "$D" ]; then
43 OPTS="--root=$D"
44 fi
45
46 for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
47 if [ \( -e $i -o $i.sh \) -a ! -e $D${sysconfdir}/systemd/system/$i.service ] ; then
48 echo -n "$i: " ; systemctl ${OPTS} mask $i.service
49 fi
50 done ; echo
51}
52
53FILES_${PN} = "${systemd_unitdir}/system ${bindir}"
54RDPEPENDS_${PN} = "systemd"
55
56
diff --git a/meta/recipes-core/systemd/systemd-compat-units/machineid.service b/meta/recipes-core/systemd/systemd-compat-units/machineid.service
new file mode 100644
index 0000000000..f586c6d60f
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-compat-units/machineid.service
@@ -0,0 +1,16 @@
1[Unit]
2Description=Machine ID first boot configure
3DefaultDependencies=no
4ConditionPathExists=|!/etc/machine-id
5After=systemd-remount-fs.service
6Before=sysinit.target
7
8[Service]
9ExecStart=/bin/systemd-machine-id-setup
10RemainAfterExit=No
11Type=oneshot
12StandardOutput=syslog
13
14[Install]
15WantedBy=basic.target
16WantedBy=sysinit.target
diff --git a/meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service b/meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service
new file mode 100644
index 0000000000..4ebc2344cf
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-compat-units/run-postinsts.service
@@ -0,0 +1,17 @@
1[Unit]
2Description=Run pending postinsts
3DefaultDependencies=no
4ConditionPathExists=|/etc/rcS.d/S99run-postinsts
5After=systemd-remount-fs.service systemd-tmpfiles-setup.service tmp.mount
6Before=sysinit.target
7
8[Service]
9ExecStart=/etc/rcS.d/S99run-postinsts
10RemainAfterExit=No
11Type=oneshot
12StandardOutput=syslog
13TimeoutSec=0
14
15[Install]
16WantedBy=basic.target
17WantedBy=sysinit.target
diff --git a/meta/recipes-core/systemd/systemd-serialgetty.bb b/meta/recipes-core/systemd/systemd-serialgetty.bb
new file mode 100644
index 0000000000..37c49b12d7
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,49 @@
1DESCRIPTION = "Systemd serial config"
2LICENSE = "GPLv2+"
3LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
4
5PR = "r3"
6
7SERIAL_CONSOLE ?= "115200 ttyS0"
8
9SRC_URI = "file://serial-getty@.service"
10
11do_install() {
12 if [ ! -z "${SERIAL_CONSOLES}" ] ; then
13 default_baudrate=`echo "${SERIAL_CONSOLES}" | sed 's/\;.*//'`
14 install -d ${D}${systemd_unitdir}/system/
15 install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
16 install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
17 sed -i -e s/\@BAUDRATE\@/$default_baudrate/g ${D}${systemd_unitdir}/system/serial-getty@.service
18
19 tmp="${SERIAL_CONSOLES}"
20 for entry in $tmp ; do
21 baudrate=`echo $entry | sed 's/\;.*//'`
22 ttydev=`echo $entry | sed -e 's/^[0-9]*\;//' -e 's/\;.*//'`
23 if [ "$baudrate" = "$default_baudrate" ] ; then
24 # enable the service
25 ln -sf ${systemd_unitdir}/system/serial-getty@.service \
26 ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@$ttydev.service
27 else
28 # install custom service file for the non-default baudrate
29 install -m 0644 ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
30 sed -i -e s/\@BAUDRATE\@/$baudrate/g ${D}${systemd_unitdir}/system/serial-getty$baudrate@.service
31 # enable the service
32 ln -sf ${systemd_unitdir}/system/serial-getty$baudrate@.service \
33 ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty$baudrate@$ttydev.service
34 fi
35 done
36 fi
37}
38
39RDEPENDS_${PN} = "systemd"
40
41# This is a machine specific file
42FILES_${PN} = "${systemd_unitdir}/system/*.service ${sysconfdir}"
43PACKAGE_ARCH = "${MACHINE_ARCH}"
44
45# As this package is tied to systemd, only build it when we're also building systemd.
46python () {
47 if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
48 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
49}
diff --git a/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
new file mode 100644
index 0000000000..1c14dfea6a
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
@@ -0,0 +1,36 @@
1# This file is part of systemd.
2#
3# systemd is free software; you can redistribute it and/or modify it
4# under the terms of the GNU Lesser General Public License as published by
5# the Free Software Foundation; either version 2.1 of the License, or
6# (at your option) any later version.
7
8[Unit]
9Description=Serial Getty on %I
10Documentation=man:agetty(8) man:systemd-getty-generator(8)
11Documentation=http://0pointer.de/blog/projects/serial-console.html
12BindsTo=dev-%i.device
13After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
14After=rc-local.service
15
16# If additional gettys are spawned during boot then we should make
17# sure that this is synchronized before getty.target, even though
18# getty.target didn't actually pull it in.
19Before=getty.target
20IgnoreOnIsolate=yes
21
22[Service]
23ExecStart=-/sbin/agetty -s %I @BAUDRATE@ vt102
24Type=idle
25Restart=always
26RestartSec=0
27UtmpIdentifier=%I
28TTYPath=/dev/%I
29TTYReset=yes
30TTYVHangup=yes
31KillMode=process
32IgnoreSIGPIPE=no
33
34# Some login implementations ignore SIGTERM, so we send SIGHUP
35# instead, to ensure that login terminates cleanly.
36KillSignal=SIGHUP
diff --git a/meta/recipes-core/systemd/systemd-systemctl-native.bb b/meta/recipes-core/systemd/systemd-systemctl-native.bb
new file mode 100644
index 0000000000..59405842e9
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl-native.bb
@@ -0,0 +1,15 @@
1DESCRIPTION = "Wrapper to enable of systemd services"
2
3LICENSE = "MIT"
4LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
5
6PR = "r6"
7
8inherit native
9
10SRC_URI = "file://systemctl"
11
12do_install() {
13 install -d ${D}${bindir}
14 install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
15}
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000000..f7866565b9
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,127 @@
1#!/bin/sh
2echo "Started $0 $*"
3
4ROOT=
5
6# parse command line params
7action=
8while [ $# != 0 ]; do
9 opt="$1"
10
11 case "$opt" in
12 enable)
13 shift
14
15 action="$opt"
16 services="$1"
17 cmd_args="1"
18 shift
19 ;;
20 disable)
21 shift
22
23 action="$opt"
24 services="$1"
25 cmd_args="1"
26 shift
27 ;;
28 mask)
29 shift
30
31 action="$opt"
32 services="$1"
33 cmd_args="1"
34 shift
35 ;;
36 --root=*)
37 ROOT=${opt##--root=}
38 cmd_args="0"
39 shift
40 ;;
41 *)
42 if [ "$cmd_args" = "1" ]; then
43 services="$services $opt"
44 shift
45 else
46 echo "'$opt' is an unkown option; exiting with error"
47 exit 1
48 fi
49 ;;
50 esac
51done
52
53for service in $services; do
54 if [ "$action" = "mask" ]; then
55 if [ ! -d $ROOT/etc/systemd/system/ ]; then
56 mkdir -p $ROOT/etc/systemd/system/
57 fi
58 cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service"
59 echo "$cmd"
60 $cmd
61 exit 0
62 fi
63
64 echo "Try to find location of $service..."
65 # find service file
66 for p in $ROOT/etc/systemd/system \
67 $ROOT/lib/systemd/system \
68 $ROOT/usr/lib/systemd/system; do
69 if [ -e $p/$service ]; then
70 service_file=$p/$service
71 service_file=${service_file##$ROOT}
72 fi
73 done
74 if [ -z "$service_file" ]; then
75 echo "'$service' couldn't be found; exiting with error"
76 exit 1
77 fi
78 echo "Found $service in $service_file"
79
80 # If any new unit types are added to systemd they should be added
81 # to this regular expression.
82 unit_types_re='\.\(service\|socket\|device\|mount\|automount\|swap\|target\|path\|timer\|snapshot\)$'
83
84 # create the required symbolic links
85 wanted_by=$(sed '/^WantedBy[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
86 | tr ',' '\n' \
87 | grep "$unit_types_re")
88
89 for r in $wanted_by; do
90 echo "WantedBy=$r found in $service"
91 if [ "$action" = "enable" ]; then
92 mkdir -p $ROOT/etc/systemd/system/$r.wants
93 ln -s $service_file $ROOT/etc/systemd/system/$r.wants
94 echo "Enabled $service for $wanted_by."
95 else
96 rm -f $ROOT/etc/systemd/system/$r.wants/$service
97 rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants
98 echo "Disabled $service for $wanted_by."
99 fi
100 done
101
102 # create the required symbolic 'Alias' links
103 alias=$(sed '/^Alias[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
104 | tr ',' '\n' \
105 | grep "$unit_types_re")
106
107 for r in $alias; do
108 if [ "$action" = "enable" ]; then
109 mkdir -p $ROOT/etc/systemd/system
110 ln -s $service_file $ROOT/etc/systemd/system/$r
111 echo "Enabled $service for $alias."
112 else
113 rm -f $ROOT/etc/systemd/system/$r
114 echo "Disabled $service for $alias."
115 fi
116 done
117
118 # call us for the other required scripts
119 also=$(sed '/^Also[[:space:]]*=/s,[^=]*=,,p;d' "$ROOT/$service_file" \
120 | tr ',' '\n')
121 for a in $also; do
122 echo "Also=$a found in $service"
123 if [ "$action" = "enable" ]; then
124 $0 --root=$ROOT enable $a
125 fi
126 done
127done
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) \
diff --git a/meta/recipes-core/systemd/systemd_206.bb b/meta/recipes-core/systemd/systemd_206.bb
new file mode 100644
index 0000000000..a1a8bd7ceb
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_206.bb
@@ -0,0 +1,327 @@
1DESCRIPTION = "Systemd a init replacement"
2HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
3
4LICENSE = "GPLv2 & LGPLv2.1 & MIT"
5LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
6 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \
7 file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed"
8
9PROVIDES = "udev"
10
11PE = "1"
12
13DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux"
14DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
15
16SECTION = "base/shell"
17
18inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest
19
20SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
21 file://0001-use-CAP_MKNOD-ConditionCapability.patch \
22 file://0001-Use-bin-mkdir-instead-of-host-mkdir-path.patch \
23 file://binfmt-install.patch \
24 file://touchscreen.rules \
25 ${UCLIBCPATCHES} \
26 file://00-create-volatile.conf \
27 file://init \
28 file://run-ptest \
29 "
30SRC_URI[md5sum] = "89e36f2d3ba963020b72738549954cbc"
31SRC_URI[sha256sum] = "4c993de071118ea1df7ffc4be26ef0b0d78354ef15b2743a2783d20edfcde9de"
32
33UCLIBCPATCHES = ""
34UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \
35 file://systemd-pam-fix-execvpe.patch \
36 file://systemd-pam-fix-fallocate.patch \
37 file://systemd-pam-fix-getty-unit.patch \
38 file://systemd-pam-fix-mkostemp.patch \
39 file://systemd-pam-fix-msformat.patch \
40 file://optional_secure_getenv.patch \
41 file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \
42 "
43LDFLAGS_libc-uclibc_append = " -lrt"
44
45GTKDOC_DOCDIR = "${S}/docs/"
46
47PACKAGECONFIG ??= "xz tcp-wrappers"
48# Sign the journal for anti-tampering
49PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt"
50# regardless of PACKAGECONFIG, libgcrypt is always required to expand
51# the AM_PATH_LIBGCRYPT autoconf macro
52DEPENDS += "libgcrypt"
53# Compress the journal
54PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz"
55PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers"
56PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup"
57
58CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill"
59
60# Helper variables to clarify locations. This mirrors the logic in systemd's
61# build system.
62rootprefix ?= "${base_prefix}"
63rootlibdir ?= "${base_libdir}"
64rootlibexecdir = "${rootprefix}/lib"
65
66# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
67EXTRA_OECONF = " --with-rootprefix=${rootprefix} \
68 --with-rootlibdir=${rootlibdir} \
69 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
70 --enable-xz \
71 --disable-manpages \
72 --disable-coredump \
73 --disable-introspection \
74 --disable-tcpwrap \
75 --enable-split-usr \
76 --disable-microhttpd \
77 --without-python \
78 --with-sysvrcnd-path=${sysconfdir} \
79 --with-firmware-path=/lib/firmware \
80 ac_cv_path_KILL=${base_bindir}/kill \
81 "
82# uclibc does not have NSS
83EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname "
84
85do_configure_prepend() {
86 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
87 export KMOD="${base_bindir}/kmod"
88 sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service*
89}
90
91do_install() {
92 autotools_do_install
93 install -d ${D}/${base_sbindir}
94 # Provided by a separate recipe
95 rm ${D}${systemd_unitdir}/system/serial-getty* -f
96
97 # Provide support for initramfs
98 ln -s ${rootlibexecdir}/systemd/systemd ${D}/init
99 ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd
100
101 # Create dir for journal
102 install -d ${D}${localstatedir}/log/journal
103
104 # Create machine-id
105 # 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
106 touch ${D}${sysconfdir}/machine-id
107
108 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
109
110 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
111
112 if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then
113 install -d ${D}${sysconfdir}/init.d
114 install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd
115 sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd
116 fi
117}
118
119do_install_ptest () {
120 install -d ${D}${PTEST_PATH}/test
121 install ${S}/test/* ${D}${PTEST_PATH}/test
122 install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/
123 install -d ${D}${PTEST_PATH}/build-aux
124 cp -rf ${B}/rules ${D}${PTEST_PATH}/
125 cp ${B}/Makefile ${D}${PTEST_PATH}/
126 cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/
127 tar -C ${D}${PTEST_PATH}/test -xJf ${S}/test/sys.tar.xz
128 sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl
129}
130
131python populate_packages_prepend (){
132 systemdlibdir = d.getVar("rootlibdir", True)
133 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
134}
135PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
136
137PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install ${PN}-rpm-macros ${PN}-binfmt"
138
139SYSTEMD_PACKAGES = "${PN}-binfmt"
140SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service"
141
142USERADD_PACKAGES = "${PN}"
143GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal"
144
145FILES_${PN}-analyze = "${bindir}/systemd-analyze"
146
147FILES_${PN}-initramfs = "/init"
148RDEPENDS_${PN}-initramfs = "${PN}"
149
150FILES_${PN}-gui = "${bindir}/systemadm"
151
152FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \
153 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
154 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
155
156FILES_${PN}-kernel-install = "${bindir}/kernel-install \
157 ${sysconfdir}/kernel/ \
158 ${exec_prefix}/lib/kernel \
159 "
160FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \
161 "
162
163FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \
164 ${exec_prefix}/lib/binfmt.d \
165 ${rootlibexecdir}/systemd/systemd-binfmt \
166 ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \
167 ${systemd_unitdir}/system/systemd-binfmt.service"
168RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc"
169
170RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
171
172CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
173 ${sysconfdir}/systemd/logind.conf \
174 ${sysconfdir}/systemd/system.conf \
175 ${sysconfdir}/systemd/user.conf"
176
177FILES_${PN} = " ${base_bindir}/* \
178 ${datadir}/bash-completion \
179 ${datadir}/dbus-1/services \
180 ${datadir}/dbus-1/system-services \
181 ${datadir}/polkit-1 \
182 ${datadir}/${BPN} \
183 ${sysconfdir}/bash_completion.d/ \
184 ${sysconfdir}/dbus-1/ \
185 ${sysconfdir}/machine-id \
186 ${sysconfdir}/modules-load.d/ \
187 ${sysconfdir}/sysctl.d/ \
188 ${sysconfdir}/systemd/ \
189 ${sysconfdir}/tmpfiles.d/ \
190 ${sysconfdir}/xdg/ \
191 ${sysconfdir}/init.d/README \
192 ${rootlibexecdir}/systemd/* \
193 ${systemd_unitdir}/* \
194 ${base_libdir}/security/*.so \
195 ${libdir}/libnss_myhostname.so.2 \
196 /cgroup \
197 ${bindir}/systemd* \
198 ${bindir}/localectl \
199 ${bindir}/hostnamectl \
200 ${bindir}/timedatectl \
201 ${bindir}/bootctl \
202 ${bindir}/kernel-install \
203 ${exec_prefix}/lib/tmpfiles.d/*.conf \
204 ${exec_prefix}/lib/systemd \
205 ${exec_prefix}/lib/modules-load.d \
206 ${exec_prefix}/lib/sysctl.d \
207 ${localstatedir} \
208 /lib/udev/rules.d/70-uaccess.rules \
209 /lib/udev/rules.d/71-seat.rules \
210 /lib/udev/rules.d/73-seat-late.rules \
211 /lib/udev/rules.d/99-systemd.rules \
212 "
213
214FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
215FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
216
217RDEPENDS_${PN} += "kmod dbus util-linux-mount"
218
219RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \
220 util-linux-agetty \
221 util-linux-fsck e2fsprogs-e2fsck \
222 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
223"
224
225PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb"
226
227FILES_udev-dbg += "/lib/udev/.debug"
228
229RDEPENDS_udev += "udev-utils"
230RPROVIDES_udev = "hotplug"
231RRECOMMENDS_udev += "udev-hwdb"
232
233RDEPENDS_udev-hwdb += "udev-utils"
234
235FILES_udev += "${base_sbindir}/udevd \
236 ${rootlibexecdir}/systemd/systemd-udevd \
237 ${rootlibexecdir}/udev/accelerometer \
238 ${rootlibexecdir}/udev/ata_id \
239 ${rootlibexecdir}/udev/cdrom_id \
240 ${rootlibexecdir}/udev/collect \
241 ${rootlibexecdir}/udev/findkeyboards \
242 ${rootlibexecdir}/udev/keyboard-force-release.sh \
243 ${rootlibexecdir}/udev/keymap \
244 ${rootlibexecdir}/udev/mtd_probe \
245 ${rootlibexecdir}/udev/scsi_id \
246 ${rootlibexecdir}/udev/v4l_id \
247 ${rootlibexecdir}/udev/keymaps \
248 ${rootlibexecdir}/udev/rules.d/4*.rules \
249 ${rootlibexecdir}/udev/rules.d/5*.rules \
250 ${rootlibexecdir}/udev/rules.d/6*.rules \
251 ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \
252 ${rootlibexecdir}/udev/rules.d/75*.rules \
253 ${rootlibexecdir}/udev/rules.d/78*.rules \
254 ${rootlibexecdir}/udev/rules.d/8*.rules \
255 ${rootlibexecdir}/udev/rules.d/95*.rules \
256 ${sysconfdir}/udev \
257 ${sysconfdir}/init.d/systemd-udevd \
258 ${systemd_unitdir}/system/*udev* \
259 ${systemd_unitdir}/system/*.wants/*udev* \
260 "
261
262FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm"
263
264FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d"
265
266INITSCRIPT_PACKAGES = "udev"
267INITSCRIPT_NAME_udev = "systemd-udevd"
268INITSCRIPT_PARAMS_udev = "start 03 S ."
269
270python __anonymous() {
271 features = d.getVar("DISTRO_FEATURES", True).split()
272 if "sysvinit" not in features:
273 d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1")
274}
275
276# TODO:
277# u-a for runlevel and telinit
278
279ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel"
280
281ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd"
282ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init"
283ALTERNATIVE_PRIORITY[init] ?= "300"
284
285ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl"
286ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt"
287ALTERNATIVE_PRIORITY[halt] ?= "300"
288
289ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl"
290ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot"
291ALTERNATIVE_PRIORITY[reboot] ?= "300"
292
293ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl"
294ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown"
295ALTERNATIVE_PRIORITY[shutdown] ?= "300"
296
297ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl"
298ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff"
299ALTERNATIVE_PRIORITY[poweroff] ?= "300"
300
301ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl"
302ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel"
303ALTERNATIVE_PRIORITY[runlevel] ?= "300"
304
305pkg_postinst_udev-hwdb () {
306 if test -n "$D"; then
307 ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \
308 --root $D
309 else
310 udevadm hwdb --update
311 fi
312}
313
314pkg_prerm_udev-hwdb () {
315 if test -n "$D"; then
316 exit 1
317 fi
318
319 rm -f ${sysconfdir}/udev/hwdb.bin
320}
321
322# As this recipe builds udev, respect the systemd DISTRO_FEATURE so we don't try
323# building udev and systemd in world builds.
324python () {
325 if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d):
326 raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES")
327}