summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRadu Moisan <radu.moisan@intel.com>2013-01-19 22:47:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-20 12:58:55 +0000
commitb8744d5376a9df4ec30120fdc8f39579d34d0545 (patch)
tree9503d5816da66544969292ddb5ff999e50c1b9a8 /meta
parentb18886d9b7c913cd463a98d0ef1b3a8a240f5791 (diff)
downloadpoky-b8744d5376a9df4ec30120fdc8f39579d34d0545.tar.gz
systemd: add systemd recipes
Add systemd recipes and associated support recipes. Mostly based on meta-oe/meta-systemd, so almost all credit should go to: Andreas Müller <schnitzeltony@googlemail.com> Denis 'GNUtoo' Carikli <GNUtoo@no-log.org> Holger Hans Peter Freyther <holger@moiji-mobile.com> Khem Raj <raj.khem@gmail.com> Koen Kooi <koen@dominion.thruhere.net> Martin Jansa <Martin.Jansa@gmail.com> (From OE-Core rev: 6a8a48b4d0d0b9b8d8af46cae11245bcb870bbc3) Signed-off-by: Radu Moisan <radu.moisan@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/systemd/systemd-compat-units.bb58
-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.bb45
-rw-r--r--meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service32
-rw-r--r--meta/recipes-core/systemd/systemd-systemctl-native.bb15
-rwxr-xr-xmeta/recipes-core/systemd/systemd-systemctl/systemctl126
-rw-r--r--meta/recipes-core/systemd/systemd/00-create-volatile.conf10
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch103
-rw-r--r--meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch91
-rw-r--r--meta/recipes-core/systemd/systemd/modprobe.rules17
-rw-r--r--meta/recipes-core/systemd/systemd/optional_secure_getenv.patch19
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch26
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch26
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch82
-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.patch166
-rw-r--r--meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch335
-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/var-run.conf4
-rw-r--r--meta/recipes-core/systemd/systemd_196.bb249
22 files changed, 1597 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..a7bfee3c4b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-compat-units.bb
@@ -0,0 +1,58 @@
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
8inherit allarch
9
10SRC_URI = "file://*.service"
11
12do_install() {
13 install -d ${D}${systemd_unitdir}/system/basic.target.wants
14 install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
15 install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system
16 ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/
17 ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
18
19 install -m 0644 ${WORKDIR}/machineid.service ${D}${systemd_unitdir}/system
20 ln -sf ../machineid.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
21 ln -sf ../machineid.service ${D}${systemd_unitdir}/system/basic.target.wants/
22
23 # hack to make old style sysvinit postinsts succeed
24 install -d ${D}${bindir}
25 echo "echo 1" > ${D}${bindir}/runlevel
26 chmod 0755 ${D}${bindir}/runlevel
27}
28
29SYSTEMD_DISABLED_SYSV_SERVICES = " \
30 busybox-udhcpc \
31 dnsmasq \
32 hwclock \
33 networking \
34 syslog.busybox \
35"
36
37pkg_postinst_${PN} () {
38 cd $D${sysconfdir}/init.d
39
40 echo "Disabling the following sysv scripts: "
41
42 OPTS=""
43
44 if [ -n "$D" ]; then
45 OPTS="--root=$D"
46 fi
47
48 for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
49 if [ \( -e $i -o $i.sh \) -a ! -e $D${sysconfdir}/systemd/system/$i.service ] ; then
50 echo -n "$i: " ; systemctl ${OPTS} mask $i.service
51 fi
52 done ; echo
53}
54
55FILES_${PN} = "${systemd_unitdir}/system ${bindir}"
56RDPEPENDS_${PN} = "systemd"
57
58
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..cab8f76ab8
--- /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=remount-rootfs.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..da6fe76a38
--- /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/S98run-postinsts
5After=remount-rootfs.service tmp.mount
6Before=sysinit.target
7
8[Service]
9ExecStart=/etc/rcS.d/S98run-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..7e7368b875
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty.bb
@@ -0,0 +1,45 @@
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
11def get_serial_console_value(d, index):
12 c = d.getVar('SERIAL_CONSOLE', True)
13
14 if len(c):
15 return c.split()[index]
16
17 return ""
18
19def get_baudrate(d):
20 return get_serial_console_value(d, 0)
21
22def get_console(d):
23 return get_serial_console_value(d, 1)
24
25do_install() {
26 if [ ! ${@get_baudrate(d)} = "" ]; then
27 sed -i -e s/\@BAUDRATE\@/${@get_baudrate(d)}/g ${WORKDIR}/serial-getty@.service
28 install -d ${D}${systemd_unitdir}/system/
29 install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
30 install ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
31
32 # enable the service
33 ln -sf ${systemd_unitdir}/system/serial-getty@.service \
34 ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@${@get_console(d)}.service
35 fi
36}
37
38PACKAGES = "${PN} ${PN}-dbg ${PN}-dev ${PN}-doc"
39
40RRECOMMENDS_${PN} = ""
41RDEPENDS_${PN} = "systemd"
42
43# This is a machine specific file
44FILES_${PN} = "${systemd_unitdir}/system/serial-getty@.service ${sysconfdir}"
45PACKAGE_ARCH = "${MACHINE_ARCH}"
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..8eeaab697c
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-serialgetty/serial-getty@.service
@@ -0,0 +1,32 @@
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 General Public License as published by
5# the Free Software Foundation; either version 2 of the License, or
6# (at your option) any later version.
7
8[Unit]
9Description=Serial Getty on %I
10BindTo=dev-%i.device
11After=dev-%i.device systemd-user-sessions.service
12
13# If additional gettys are spawned during boot then we should make
14# sure that this is synchronized before getty.target, even though
15# getty.target didn't actually pull it in.
16Before=getty.target
17
18[Service]
19Environment=TERM=vt100
20ExecStart=-/sbin/agetty -s %I @BAUDRATE@
21Restart=always
22RestartSec=0
23UtmpIdentifier=%I
24TTYPath=/dev/%I
25TTYReset=yes
26TTYVHangup=yes
27KillMode=process
28IgnoreSIGPIPE=no
29
30# Some login implementations ignore SIGTERM, so we send SIGHUP
31# instead, to ensure that login terminates cleanly.
32KillSignal=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..d71c7eda8b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,126 @@
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 # create the required symbolic links
81 wanted_by=$(grep WantedBy $ROOT/$service_file \
82 | sed 's,WantedBy=,,g' \
83 | tr ',' '\n' \
84 | grep '\(\.target$\)\|\(\.service$\)')
85
86 for r in $wanted_by; do
87 echo "WantedBy=$r found in $service"
88 if [ "$action" = "enable" ]; then
89 mkdir -p $ROOT/etc/systemd/system/$r.wants
90 ln -s $service_file $ROOT/etc/systemd/system/$r.wants
91 echo "Enabled $service for $wanted_by."
92 else
93 rm -f $ROOT/etc/systemd/system/$r.wants/$service
94 rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants
95 echo "Disabled $service for $wanted_by."
96 fi
97 done
98
99 # create the required symbolic 'Alias' links
100 alias=$(grep Alias $ROOT/$service_file \
101 | sed 's,Alias=,,g' \
102 | tr ',' '\n' \
103 | grep '\.service$')
104
105 for r in $alias; do
106 if [ "$action" = "enable" ]; then
107 mkdir -p $ROOT/etc/systemd/system
108 ln -s $service_file $ROOT/etc/systemd/system/$r
109 echo "Enabled $service for $alias."
110 else
111 rm -f $ROOT/etc/systemd/system/$r
112 echo "Disabled $service for $alias."
113 fi
114 done
115
116 # call us for the other required scripts
117 also=$(grep Also $ROOT/$service_file \
118 | sed 's,Also=,,g' \
119 | tr ',' '\n')
120 for a in $also; do
121 echo "Also=$a found in $service"
122 if [ "$action" = "enable" ]; then
123 $0 --root=$ROOT enable $a
124 fi
125 done
126done
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..d160a9b2ab
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/00-create-volatile.conf
@@ -0,0 +1,10 @@
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/cache - - - -
7d /var/volatile/log - - - -
8d /var/volatile/lock - - - -
9d /var/volatile/run - - - -
10d /var/volatile/tmp - - - -
diff --git a/meta/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch b/meta/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch
new file mode 100644
index 0000000000..7de2705ace
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch
@@ -0,0 +1,103 @@
1From 2003e63f48cee2f497de7b90b66284f98c1c9919 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Mon, 10 Dec 2012 12:24:32 +0100
4Subject: [PATCH 1/2] Revert "systemd-analyze: use argparse instead of getopt"
5
6This reverts commit 0c0271841ab45595f71528c50bcf1904d4b841d5.
7
8Argparse is broken in current OE python
9---
10 src/analyze/systemd-analyze | 60 ++++++++++++++++++++++++++++---------------
11 1 files changed, 39 insertions(+), 21 deletions(-)
12
13diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze
14index 88699d6..87a83dd 100755
15--- a/src/analyze/systemd-analyze
16+++ b/src/analyze/systemd-analyze
17@@ -1,7 +1,6 @@
18 #!/usr/bin/python
19
20-import sys, os
21-import argparse
22+import getopt, sys, os
23 from gi.repository import Gio
24 try:
25 import cairo
26@@ -76,6 +75,20 @@ def draw_text(context, x, y, text, size = 12, r = 0, g = 0, b = 0, vcenter = 0.5
27
28 context.restore()
29
30+def usage():
31+ sys.stdout.write("""systemd-analyze [--user] time
32+systemd-analyze [--user] blame
33+systemd-analyze [--user] plot
34+
35+Process systemd profiling information
36+
37+ -h --help Show this help
38+""")
39+
40+def help():
41+ usage()
42+ sys.exit()
43+
44 def time():
45
46 initrd_time, start_time, finish_time = acquire_start_time()
47@@ -266,29 +279,34 @@ def plot():
48
49 surface.finish()
50
51-parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
52- description='Process systemd profiling information',
53- epilog='''\
54-time - print time spent in the kernel before reaching userspace
55-blame - print list of running units ordered by time to init
56-plot - output SVG graphic showing service initialization
57-''')
58-
59-parser.add_argument('action', choices=('time', 'blame', 'plot'),
60- default='time', nargs='?',
61- help='action to perform (default: time)')
62-parser.add_argument('--user', action='store_true',
63- help='use the session bus')
64+def unknown_verb():
65+ sys.stderr.write("Unknown verb '%s'.\n" % args[0])
66+ usage()
67+ sys.exit(1)
68
69-args = parser.parse_args()
70+bus = Gio.BusType.SYSTEM
71
72-if args.user:
73- bus = Gio.BusType.SESSION
74-else:
75- bus = Gio.BusType.SYSTEM
76+try:
77+ opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help", "user"])
78+except getopt.GetoptError as err:
79+ sys.stdout.write(str(err) + "\n")
80+ usage()
81+ sys.exit(2)
82+for o, a in opts:
83+ if o in ("-h", "--help"):
84+ help()
85+ elif o == '--user':
86+ bus = Gio.BusType.SESSION
87+ else:
88+ assert False, "unhandled option"
89
90 verb = {'time' : time,
91 'blame': blame,
92 'plot' : plot,
93+ 'help' : help,
94 }
95-verb.get(args.action)()
96+
97+if len(args) == 0:
98+ time()
99+else:
100+ verb.get(args[0], unknown_verb)()
101--
1021.7.7.6
103
diff --git a/meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch b/meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch
new file mode 100644
index 0000000000..e5e8d7df0d
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch
@@ -0,0 +1,91 @@
1From 8079db861b8ffdce69fa10a9ab9ef4740045187f Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Mon, 10 Dec 2012 12:25:00 +0100
4Subject: [PATCH 2/2] Revert "analyze: use GDBus instead of dbus-python"
5
6This reverts commit 4940c64240541e91411620b7dc0963e012aa6b91.
7
8Python-gobject is too old in current OE
9---
10 src/analyze/systemd-analyze | 31 ++++++++++++++-----------------
11 1 files changed, 14 insertions(+), 17 deletions(-)
12
13diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze
14index 87a83dd..636fd74 100755
15--- a/src/analyze/systemd-analyze
16+++ b/src/analyze/systemd-analyze
17@@ -1,15 +1,14 @@
18 #!/usr/bin/python
19
20-import getopt, sys, os
21-from gi.repository import Gio
22+import getopt, dbus, sys, os
23 try:
24 import cairo
25 except ImportError:
26 cairo = None
27
28 def acquire_time_data():
29- manager = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE,
30- None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.systemd1.Manager', None)
31+
32+ manager = dbus.Interface(bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1'), 'org.freedesktop.systemd1.Manager')
33 units = manager.ListUnits()
34
35 l = []
36@@ -18,25 +17,23 @@ def acquire_time_data():
37 if i[5] != "":
38 continue
39
40- properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE,
41- None, 'org.freedesktop.systemd1', i[6], 'org.freedesktop.DBus.Properties', None)
42+ properties = dbus.Interface(bus.get_object('org.freedesktop.systemd1', i[6]), 'org.freedesktop.DBus.Properties')
43
44- ixt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveExitTimestampMonotonic')
45- aet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveEnterTimestampMonotonic')
46- axt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveExitTimestampMonotonic')
47- iet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveEnterTimestampMonotonic')
48+ ixt = int(properties.Get('org.freedesktop.systemd1.Unit', 'InactiveExitTimestampMonotonic'))
49+ aet = int(properties.Get('org.freedesktop.systemd1.Unit', 'ActiveEnterTimestampMonotonic'))
50+ axt = int(properties.Get('org.freedesktop.systemd1.Unit', 'ActiveExitTimestampMonotonic'))
51+ iet = int(properties.Get('org.freedesktop.systemd1.Unit', 'InactiveEnterTimestampMonotonic'))
52
53 l.append((str(i[0]), ixt, aet, axt, iet))
54
55 return l
56
57 def acquire_start_time():
58- properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE,
59- None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.DBus.Properties', None)
60+ properties = dbus.Interface(bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1'), 'org.freedesktop.DBus.Properties')
61
62- initrd_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'InitRDTimestampMonotonic')
63- userspace_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'UserspaceTimestampMonotonic')
64- finish_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic')
65+ initrd_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'InitRDTimestampMonotonic'))
66+ userspace_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'UserspaceTimestampMonotonic'))
67+ finish_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic'))
68
69 if finish_time == 0:
70 sys.stderr.write("Bootup is not yet finished. Please try again later.\n")
71@@ -284,7 +281,7 @@ def unknown_verb():
72 usage()
73 sys.exit(1)
74
75-bus = Gio.BusType.SYSTEM
76+bus = dbus.SystemBus()
77
78 try:
79 opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help", "user"])
80@@ -296,7 +293,7 @@ for o, a in opts:
81 if o in ("-h", "--help"):
82 help()
83 elif o == '--user':
84- bus = Gio.BusType.SESSION
85+ bus = dbus.SessionBus()
86 else:
87 assert False, "unhandled option"
88
89--
901.7.7.6
91
diff --git a/meta/recipes-core/systemd/systemd/modprobe.rules b/meta/recipes-core/systemd/systemd/modprobe.rules
new file mode 100644
index 0000000000..d4a096b82b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/modprobe.rules
@@ -0,0 +1,17 @@
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# Try and modprobe for drivers for new hardware
17ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
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..35f1467c54
--- /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
4Singed-off-by: Khem Raj <raj.khem@gmail.com>
5
6Upstream-Status: Pending
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/systemd-pam-configure-check-uclibc.patch b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
new file mode 100644
index 0000000000..1bfc3bdb18
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-configure-check-uclibc.patch
@@ -0,0 +1,26 @@
1--- systemd-185.orig/configure.ac 2012-06-04 14:15:16.000000000 -0400
2+++ systemd-pam-185/configure.ac 2012-06-21 22:57:10.000000000 -0400
3@@ -63,6 +63,23 @@
4
5 AC_PATH_PROG([M4], [m4])
6
7+# check for few functions not implemented in uClibc
8+
9+AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
10+
11+# check for %ms format support - assume always no if cross compiling
12+
13+AC_MSG_CHECKING([whether %ms format is supported by *scanf])
14+
15+AC_RUN_IFELSE(
16+ [AC_LANG_PROGRAM([[ include <stdio.h> ]],
17+ [[ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
18+ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
19+ return (rc==3)?0:1;]])],
20+ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
21+ [AC_MSG_RESULT([no])],
22+ [AC_MSG_RESULT([no])])
23+
24 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
25 m4_ifdef([GTK_DOC_CHECK], [
26 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..449c27f88c
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-execvpe.patch
@@ -0,0 +1,26 @@
1Index: git/src/nspawn/nspawn.c
2===================================================================
3--- git.orig/src/nspawn/nspawn.c 2012-09-22 17:57:05.000000000 -0700
4+++ git/src/nspawn/nspawn.c 2012-09-22 18:01:41.541405768 -0700
5@@ -63,6 +63,8 @@
6 LINK_GUEST
7 } LinkJournal;
8
9+#include "config.h"
10+
11 static char *arg_directory = NULL;
12 static char *arg_user = NULL;
13 static char **arg_controllers = NULL;
14@@ -1373,7 +1375,12 @@
15 a[0] = (char*) "/sbin/init";
16 execve(a[0], a, (char**) envp);
17 } else if (argc > optind)
18+#ifdef HAVE_EXECVPE
19 execvpe(argv[optind], argv + optind, (char**) envp);
20+#else
21+ environ = (char **)envp;
22+ execvp(argv[optind], argv + optind);
23+#endif /* HAVE_EXECVPE */
24 else {
25 chdir(home ? home : "/root");
26 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..089ba64690
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-fallocate.patch
@@ -0,0 +1,82 @@
1Index: git/src/journal/journal-file.c
2===================================================================
3--- git.orig/src/journal/journal-file.c 2012-09-02 09:49:15.126089594 -0700
4+++ git/src/journal/journal-file.c 2012-09-02 09:49:17.118089670 -0700
5@@ -34,6 +34,8 @@
6 #include "compress.h"
7 #include "fsprg.h"
8
9+#include "config.h"
10+
11 #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
12 #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
13
14@@ -262,7 +264,7 @@
15
16 static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) {
17 uint64_t old_size, new_size;
18- int r;
19+ int r = 0;
20
21 assert(f);
22
23@@ -307,10 +309,25 @@
24 /* Note that the glibc fallocate() fallback is very
25 inefficient, hence we try to minimize the allocation area
26 as we can. */
27+#ifdef HAVE_POSIX_ALLOCATE
28 r = posix_fallocate(f->fd, old_size, new_size - old_size);
29 if (r != 0)
30 return -r;
31
32+#else
33+ /* Use good old method to write zeros into the journal file
34+ perhaps very inefficient yet working. */
35+ if(new_size > old_size) {
36+ char *buf = alloca(new_size - old_size);
37+ off_t oldpos = lseek(f->fd, 0, SEEK_CUR);
38+ bzero(buf, new_size - old_size);
39+ lseek(f->fd, old_size, SEEK_SET);
40+ r = write(f->fd, buf, new_size - old_size);
41+ lseek(f->fd, oldpos, SEEK_SET);
42+ }
43+ if (r < 0)
44+ return -errno;
45+#endif /* HAVE_POSIX_FALLOCATE */
46 if (fstat(f->fd, &f->last_stat) < 0)
47 return -errno;
48
49Index: git/src/journal/journald-kmsg.c
50===================================================================
51--- git.orig/src/journal/journald-kmsg.c 2012-09-02 09:49:15.130089595 -0700
52+++ git/src/journal/journald-kmsg.c 2012-09-02 12:26:17.326447895 -0700
53@@ -404,6 +404,7 @@
54
55 int server_open_kernel_seqnum(Server *s) {
56 int fd;
57+ int r = 0;
58 uint64_t *p;
59
60 assert(s);
61@@ -417,8 +418,19 @@
62 log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m");
63 return 0;
64 }
65-
66- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) {
67+#ifdef HAVE_POSIX_ALLOCATE
68+ r = posix_fallocate(fd, 0, sizeof(uint64_t));
69+#else
70+ /* Use good old method to write zeros into the journal file
71+ perhaps very inefficient yet working. */
72+ char *buf = alloca(sizeof(uint64_t));
73+ off_t oldpos = lseek(fd, 0, SEEK_CUR);
74+ bzero(buf, sizeof(uint64_t));
75+ lseek(fd, 0, SEEK_SET);
76+ r = write(fd, buf, sizeof(uint64_t));
77+ lseek(fd, oldpos, SEEK_SET);
78+#endif /* HAVE_POSIX_FALLOCATE */
79+ if (r < 0) {
80 log_error("Failed to allocate sequential number file, ignoring: %m");
81 close_nointr_nofail(fd);
82 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..3e5ea71e04
--- /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
3Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
4---
5 units/getty@.service.m4 | 2 +-
6 units/serial-getty@.service.m4 | 2 +-
7 2 files changed, 2 insertions(+), 2 deletions(-)
8
9Index: systemd-37/units/getty@.service.m4
10===================================================================
11--- systemd-37.orig/units/getty@.service.m4
12+++ systemd-37/units/getty@.service.m4
13@@ -41,7 +41,7 @@
14
15 [Service]
16 Environment=TERM=linux
17 # the VT is cleared by TTYVTDisallocate
18-ExecStart=-/sbin/agetty --noclear %I 38400
19+ExecStart=-/sbin/getty -L %I 115200 linux
20 Type=idle
21 Restart=always
22 RestartSec=0
23Index: systemd-37/units/serial-getty@.service.m4
24===================================================================
25--- systemd-37.orig/units/serial-getty@.service.m4
26+++ systemd-37/units/serial-getty@.service.m4
27@@ -37,7 +37,7 @@
28
29 [Service]
30 Environment=TERM=vt102
31-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
32+ExecStart=-/sbin/getty -L %I 115200 vt100
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..8de9a3a326
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
@@ -0,0 +1,166 @@
1Index: git/src/journal/journal-send.c
2===================================================================
3--- git.orig/src/journal/journal-send.c 2012-09-02 00:10:08.748768268 -0700
4+++ git/src/journal/journal-send.c 2012-09-02 00:10:10.508768335 -0700
5@@ -34,6 +34,8 @@
6
7 #define SNDBUF_SIZE (8*1024*1024)
8
9+#include "config.h"
10+
11 /* We open a single fd, and we'll share it with the current process,
12 * all its threads, and all its subprocesses. This means we need to
13 * initialize it atomically, and need to operate on it atomically
14@@ -293,7 +295,12 @@
15 * file and just pass a file descriptor of it to the other
16 * side */
17
18+#ifdef HAVE_MKOSTEMP
19 buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR);
20+#else
21+ buffer_fd = mkstemp(path);
22+ if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC);
23+#endif /* HAVE_MKOSTEMP */
24 if (buffer_fd < 0) {
25 r = -errno;
26 goto finish;
27Index: git/src/core/manager.c
28===================================================================
29--- git.orig/src/core/manager.c 2012-09-02 00:10:08.732768266 -0700
30+++ git/src/core/manager.c 2012-09-02 00:10:10.512768334 -0700
31@@ -67,6 +67,8 @@
32 #include "cgroup-util.h"
33 #include "path-util.h"
34
35+#include "config.h"
36+
37 /* As soon as 16 units are in our GC queue, make sure to run a gc sweep */
38 #define GC_QUEUE_ENTRIES_MAX 16
39
40@@ -1701,7 +1703,12 @@
41 return -ENOMEM;
42
43 saved_umask = umask(0077);
44+#ifdef HAVE_MKOSTEMP
45 fd = mkostemp(path, O_RDWR|O_CLOEXEC);
46+#else
47+ fd = mkstemp(path);
48+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
49+#endif /* HAVE_MKOSTEMP */
50 umask(saved_umask);
51
52 if (fd < 0) {
53Index: git/src/shared/util.c
54===================================================================
55--- git.orig/src/shared/util.c 2012-09-02 00:10:08.784768269 -0700
56+++ git/src/shared/util.c 2012-09-02 00:10:10.512768334 -0700
57@@ -68,6 +68,8 @@
58 #include "exit-status.h"
59 #include "hashmap.h"
60
61+#include "config.h"
62+
63 int saved_argc = 0;
64 char **saved_argv = NULL;
65
66@@ -4519,7 +4521,12 @@
67 t[k] = '.';
68 stpcpy(stpcpy(t+k+1, fn), "XXXXXX");
69
70+#ifdef HAVE_MKOSTEMP
71 fd = mkostemp(t, O_WRONLY|O_CLOEXEC);
72+#else
73+ fd = mkstemp(t);
74+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
75+#endif /* HAVE_MKOSTEMP */
76 if (fd < 0) {
77 free(t);
78 return -errno;
79Index: git/src/shared/ask-password-api.c
80===================================================================
81--- git.orig/src/shared/ask-password-api.c 2012-09-02 00:10:08.772768268 -0700
82+++ git/src/shared/ask-password-api.c 2012-09-02 00:10:10.512768334 -0700
83@@ -37,6 +37,8 @@
84
85 #include "ask-password-api.h"
86
87+#include "config.h"
88+
89 static void backspace_chars(int ttyfd, size_t p) {
90
91 if (ttyfd < 0)
92@@ -326,7 +328,12 @@
93 mkdir_p_label("/run/systemd/ask-password", 0755);
94
95 u = umask(0022);
96+#ifdef HAVE_MKOSTEMP
97 fd = mkostemp(temp, O_CLOEXEC|O_CREAT|O_WRONLY);
98+#else
99+ fd = mkstemp(temp);
100+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
101+#endif /* HAVE_MKOSTEMP */
102 umask(u);
103
104 if (fd < 0) {
105Index: git/src/journal/journalctl.c
106===================================================================
107--- git.orig/src/journal/journalctl.c 2012-09-02 00:10:08.752768267 -0700
108+++ git/src/journal/journalctl.c 2012-09-02 00:18:41.928787779 -0700
109@@ -540,7 +540,13 @@
110 n /= arg_interval;
111
112 close_nointr_nofail(fd);
113+#ifdef HAVE_MKOSTEMP
114 fd = mkostemp(k, O_WRONLY|O_CLOEXEC|O_NOCTTY);
115+#else
116+ fd = mkstemp(k);
117+ if (fd >= 0) fcntl(fd, F_SETFD, FD_CLOEXEC);
118+#endif /* HAVE_MKOSTEMP */
119+
120 if (fd < 0) {
121 log_error("Failed to open %s: %m", k);
122 r = -errno;
123Index: git/src/journal/journal-verify.c
124===================================================================
125--- git.orig/src/journal/journal-verify.c 2012-09-02 00:10:08.752768267 -0700
126+++ git/src/journal/journal-verify.c 2012-09-02 00:24:10.268800268 -0700
127@@ -693,8 +693,12 @@
128 #endif
129 } else if (f->seal)
130 return -ENOKEY;
131-
132+#ifdef HAVE_MKOSTEMP
133 data_fd = mkostemp(data_path, O_CLOEXEC);
134+#else
135+ data_fd = mkstemp(data_path);
136+ if (data_fd >= 0) fcntl(data_fd, F_SETFD, FD_CLOEXEC);
137+#endif /* HAVE_MKOSTEMP */
138 if (data_fd < 0) {
139 log_error("Failed to create data file: %m");
140 r = -errno;
141@@ -702,7 +706,12 @@
142 }
143 unlink(data_path);
144
145+#ifdef HAVE_MKOSTEMP
146 entry_fd = mkostemp(entry_path, O_CLOEXEC);
147+#else
148+ entry_fd = mkstemp(entry_path);
149+ if (entry_fd >= 0) fcntl(entry_fd, F_SETFD, FD_CLOEXEC);
150+#endif /* HAVE_MKOSTEMP */
151 if (entry_fd < 0) {
152 log_error("Failed to create entry file: %m");
153 r = -errno;
154@@ -710,7 +719,12 @@
155 }
156 unlink(entry_path);
157
158+#ifdef HAVE_MKOSTEMP
159 entry_array_fd = mkostemp(entry_array_path, O_CLOEXEC);
160+#else
161+ entry_array_fd = mkstemp(entry_array_path);
162+ if (entry_array_fd >= 0) fcntl(entry_array_fd, F_SETFD, FD_CLOEXEC);
163+#endif /* HAVE_MKOSTEMP */
164 if (entry_array_fd < 0) {
165 log_error("Failed to create entry array file: %m");
166 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..ee63329830
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-msformat.patch
@@ -0,0 +1,335 @@
1--- systemd-pam-185/src/fsck/fsck.c.orig 2012-06-22 23:22:22.000000000 -0400
2+++ systemd-pam-185/src/fsck/fsck.c 2012-06-22 21:15:56.000000000 -0400
3@@ -36,6 +36,8 @@
4 #include "bus-errors.h"
5 #include "virt.h"
6
7+#include "config.h"
8+
9 static bool arg_skip = false;
10 static bool arg_force = false;
11 static bool arg_show_progress = false;
12@@ -193,9 +195,16 @@
13 char *device;
14 double p;
15 usec_t t;
16-
17+#ifdef HAVE_MSFORMAT
18 if (fscanf(f, "%i %lu %lu %ms", &pass, &cur, &max, &device) != 4)
19- break;
20+#else
21+ device = malloc(257);
22+ if (fscanf(f, "%i %lu %lu %256s", &pass, &cur, &max, device) != 4) {
23+ free(device);
24+ }
25+
26+#endif /* HAVE_MSFORMAT */
27+ break;
28
29 /* Only show one progress counter at max */
30 if (!locked) {
31--- systemd-pam-185/src/core/swap.c.orig 2012-06-22 23:22:55.000000000 -0400
32+++ systemd-pam-185/src/core/swap.c 2012-06-22 21:17:10.000000000 -0400
33@@ -40,6 +40,8 @@
34 #include "def.h"
35 #include "path-util.h"
36
37+#include "config.h"
38+
39 static const UnitActiveState state_translation_table[_SWAP_STATE_MAX] = {
40 [SWAP_DEAD] = UNIT_INACTIVE,
41 [SWAP_ACTIVATING] = UNIT_ACTIVATING,
42@@ -1038,7 +1040,7 @@
43 for (i = 1;; i++) {
44 char *dev = NULL, *d;
45 int prio = 0, k;
46-
47+#ifdef HAVE_MSFORMAT
48 if ((k = fscanf(m->proc_swaps,
49 "%ms " /* device/file */
50 "%*s " /* type of swap */
51@@ -1046,10 +1048,18 @@
52 "%*s " /* used */
53 "%i\n", /* priority */
54 &dev, &prio)) != 2) {
55-
56+#else
57+ dev = malloc(257);
58+ if ((k = fscanf(m->proc_swaps,
59+ "%256s " /* device/file */
60+ "%*s " /* type of swap */
61+ "%*s " /* swap size */
62+ "%*s " /* used */
63+ "%i\n", /* priority */
64+ dev, &prio)) != 2) {
65+#endif /* HAVE_MSFORMAT */
66 if (k == EOF)
67 break;
68-
69 log_warning("Failed to parse /proc/swaps:%u.", i);
70 free(dev);
71 continue;
72--- systemd-pam-185/src/core/mount-setup.c.orig 2012-06-22 23:23:41.000000000 -0400
73+++ systemd-pam-185/src/core/mount-setup.c 2012-06-22 21:19:44.000000000 -0400
74@@ -28,6 +28,7 @@
75 #include <assert.h>
76 #include <unistd.h>
77 #include <ftw.h>
78+#include <linux/fs.h>
79
80 #include "mount-setup.h"
81 #include "dev-setup.h"
82@@ -41,6 +41,8 @@
83 #include "path-util.h"
84 #include "missing.h"
85
86+#include "config.h"
87+
88 #ifndef TTY_GID
89 #define TTY_GID 5
90 #endif
91@@ -200,9 +202,12 @@
92 for (;;) {
93 char *controller;
94 int enabled = 0;
95-
96+#ifdef HAVE_MSFORMAT
97 if (fscanf(f, "%ms %*i %*i %i", &controller, &enabled) != 2) {
98-
99+#else
100+ controller = malloc(257);
101+ if (fscanf(f, "%256s %*i %*i %i", controller, &enabled) != 2) {
102+#endif /* HAVE_MSFORMAT */
103 if (feof(f))
104 break;
105
106--- systemd-pam-185/src/core/mount.c.orig 2012-06-22 23:24:17.000000000 -0400
107+++ systemd-pam-185/src/core/mount.c 2012-06-22 22:51:21.000000000 -0400
108@@ -41,6 +41,8 @@
109 #include "exit-status.h"
110 #include "def.h"
111
112+#include "config.h"
113+
114 static const UnitActiveState state_translation_table[_MOUNT_STATE_MAX] = {
115 [MOUNT_DEAD] = UNIT_INACTIVE,
116 [MOUNT_MOUNTING] = UNIT_ACTIVATING,
117@@ -1514,7 +1516,7 @@
118 int k;
119
120 device = path = options = options2 = fstype = d = p = o = NULL;
121-
122+#ifdef HAVE_MSFORMAT
123 if ((k = fscanf(m->proc_self_mountinfo,
124 "%*s " /* (1) mount id */
125 "%*s " /* (2) parent id */
126@@ -1533,7 +1535,31 @@
127 &fstype,
128 &device,
129 &options2)) != 5) {
130-
131+#else
132+ path = malloc(257);
133+ options = malloc(257);
134+ fstype = malloc(257);
135+ device = malloc(257);
136+ options2 = malloc(257);
137+ if ((k = fscanf(m->proc_self_mountinfo,
138+ "%*s " /* (1) mount id */
139+ "%*s " /* (2) parent id */
140+ "%*s " /* (3) major:minor */
141+ "%*s " /* (4) root */
142+ "%256s " /* (5) mount point */
143+ "%256s" /* (6) mount options */
144+ "%*[^-]" /* (7) optional fields */
145+ "- " /* (8) separator */
146+ "%256s " /* (9) file system type */
147+ "%256s" /* (10) mount source */
148+ "%256s" /* (11) mount options 2 */
149+ "%*[^\n]", /* some rubbish at the end */
150+ path,
151+ options,
152+ fstype,
153+ device,
154+ options2)) != 5) {
155+#endif /* HAVE_MSFORMAT */
156 if (k == EOF)
157 break;
158
159--- systemd-pam-185/src/core/umount.c.orig 2012-06-22 23:24:37.000000000 -0400
160+++ systemd-pam-185/src/core/umount.c 2012-06-22 22:56:15.000000000 -0400
161@@ -35,6 +35,8 @@
162 #include "path-util.h"
163 #include "util.h"
164
165+#include "config.h"
166+
167 typedef struct MountPoint {
168 char *path;
169 dev_t devnum;
170@@ -74,7 +76,7 @@
171 MountPoint *m;
172
173 path = p = NULL;
174-
175+#ifdef HAVE_MSFORMAT
176 if ((k = fscanf(proc_self_mountinfo,
177 "%*s " /* (1) mount id */
178 "%*s " /* (2) parent id */
179@@ -89,6 +91,23 @@
180 "%*s" /* (11) mount options 2 */
181 "%*[^\n]", /* some rubbish at the end */
182 &path)) != 1) {
183+#else
184+ path = malloc(257);
185+ if ((k = fscanf(proc_self_mountinfo,
186+ "%*s " /* (1) mount id */
187+ "%*s " /* (2) parent id */
188+ "%*s " /* (3) major:minor */
189+ "%*s " /* (4) root */
190+ "%256s " /* (5) mount point */
191+ "%*s" /* (6) mount options */
192+ "%*[^-]" /* (7) optional fields */
193+ "- " /* (8) separator */
194+ "%*s " /* (9) file system type */
195+ "%*s" /* (10) mount source */
196+ "%*s" /* (11) mount options 2 */
197+ "%*[^\n]", /* some rubbish at the end */
198+ path)) != 1) {
199+#endif /* HAVE_MSFORMAT */
200 if (k == EOF)
201 break;
202
203@@ -150,7 +169,7 @@
204 MountPoint *swap;
205 char *dev = NULL, *d;
206 int k;
207-
208+#ifdef HAVE_MSFORMAT
209 if ((k = fscanf(proc_swaps,
210 "%ms " /* device/file */
211 "%*s " /* type of swap */
212@@ -158,7 +177,16 @@
213 "%*s " /* used */
214 "%*s\n", /* priority */
215 &dev)) != 1) {
216-
217+#else
218+ dev = malloc(257);
219+ if ((k = fscanf(proc_swaps,
220+ "%256s " /* device/file */
221+ "%*s " /* type of swap */
222+ "%*s " /* swap size */
223+ "%*s " /* used */
224+ "%*s\n", /* priority */
225+ dev)) != 1) {
226+#endif /* HAVE_MSFORMAT */
227 if (k == EOF)
228 break;
229
230--- systemd-pam-185/src/shared/socket-util.c.orig 2012-06-22 23:25:00.000000000 -0400
231+++ systemd-pam-185/src/shared/socket-util.c 2012-06-22 22:59:27.000000000 -0400
232@@ -39,6 +39,8 @@
233 #include "socket-util.h"
234 #include "missing.h"
235
236+#include "config.h"
237+
238 int socket_address_parse(SocketAddress *a, const char *s) {
239 int r;
240 char *e, *n;
241@@ -201,8 +203,16 @@
242 a->type = SOCK_RAW;
243
244 errno = 0;
245- if (sscanf(s, "%ms %u", &sfamily, &group) < 1)
246+#ifdef HAVE_MSFORMAT
247+ if (sscanf(s, "%ms %u", &sfamily, &group) < 1)
248+ return errno ? -errno : -EINVAL;
249+#else
250+ sfamily = malloc(257);
251+ if (sscanf(s, "%256s %u", sfamily, &group) < 1) {
252+ free(sfamily);
253 return errno ? -errno : -EINVAL;
254+ }
255+#endif /* HAVE_MSFORMAT */
256
257 if ((family = netlink_family_from_string(sfamily)) < 0)
258 if (safe_atoi(sfamily, &family) < 0) {
259--- systemd-pam-185/src/tmpfiles/tmpfiles.c.orig 2012-06-22 23:25:21.000000000 -0400
260+++ systemd-pam-185/src/tmpfiles/tmpfiles.c 2012-06-22 23:13:49.000000000 -0400
261@@ -48,6 +48,8 @@
262 #include "set.h"
263 #include "conf-files.h"
264
265+#include "config.h"
266+
267 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
268 * them in the file system. This is intended to be used to create
269 * properly owned directories beneath /tmp, /var/tmp, /run, which are
270@@ -970,7 +972,7 @@
271 i = new0(Item, 1);
272 if (!i)
273 return log_oom();
274-
275+#ifdef HAVE_MSFORMAT
276 if (sscanf(buffer,
277 "%c "
278 "%ms "
279@@ -986,6 +988,28 @@
280 &group,
281 &age,
282 &n) < 2) {
283+#else
284+ i->path = malloc(257);
285+ mode = malloc(257);
286+ user = malloc(257);
287+ group = malloc(257);
288+ age = malloc(257);
289+ if (sscanf(buffer,
290+ "%c "
291+ "%256s "
292+ "%256s "
293+ "%256s "
294+ "%256s "
295+ "%256s "
296+ "%n",
297+ &type,
298+ i->path,
299+ mode,
300+ user,
301+ group,
302+ age,
303+ &n) < 2) {
304+#endif /* HAVE_MSFORMAT */
305 log_error("[%s:%u] Syntax error.", fname, line);
306 r = -EIO;
307 goto finish;
308--- systemd-pam-185/src/cryptsetup/cryptsetup-generator.c.orig 2012-06-22 23:25:47.000000000 -0400
309+++ systemd-pam-185/src/cryptsetup/cryptsetup-generator.c 2012-06-22 23:16:35.000000000 -0400
310@@ -30,6 +30,8 @@
311 #include "virt.h"
312 #include "strv.h"
313
314+#include "config.h"
315+
316 static const char *arg_dest = "/tmp";
317 static bool arg_enabled = true;
318 static bool arg_read_crypttab = true;
319@@ -421,8 +423,15 @@
320 l = strstrip(line);
321 if (*l == '#' || *l == 0)
322 continue;
323-
324+#ifdef HAVE_MSFORMAT
325 k = sscanf(l, "%ms %ms %ms %ms", &name, &device, &password, &options);
326+#else
327+ name = malloc(257);
328+ device = malloc(257);
329+ password = malloc(257);
330+ options = malloc(257);
331+ k = sscanf(l, "%256s %256s %256s %256s", name, device, password, options);
332+#endif /* HAVE_MSFORMAT */
333 if (k < 2 || k > 4) {
334 log_error("Failed to parse /etc/crypttab:%u, ignoring.", n);
335 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/var-run.conf b/meta/recipes-core/systemd/systemd/var-run.conf
new file mode 100644
index 0000000000..c2c18e2b99
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/var-run.conf
@@ -0,0 +1,4 @@
1# empty /var/run
2R /var/run/* - - - - -
3# systemd-update-utmp-runlevel.service fails to start without this
4f /var/run/utmp 0644 root root - -
diff --git a/meta/recipes-core/systemd/systemd_196.bb b/meta/recipes-core/systemd/systemd_196.bb
new file mode 100644
index 0000000000..1861437236
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd_196.bb
@@ -0,0 +1,249 @@
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=fb919cc88dbe06ec0b0bd50e001ccf1f \
7 file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed"
8
9PROVIDES = "udev"
10
11DEPENDS = "xz kmod gtk-doc-stub-native docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup tcp-wrappers usbutils glib-2.0 libgcrypt"
12DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
13
14SERIAL_CONSOLE ?= "115200 /dev/ttyS0"
15
16SECTION = "base/shell"
17
18inherit useradd pkgconfig autotools perlnative
19
20SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \
21 file://0001-Revert-systemd-analyze-use-argparse-instead-of-getop.patch \
22 file://0002-Revert-analyze-use-GDBus-instead-of-dbus-python.patch \
23 file://touchscreen.rules \
24 file://modprobe.rules \
25 file://var-run.conf \
26 ${UCLIBCPATCHES} \
27 file://00-create-volatile.conf \
28 "
29SRC_URI[md5sum] = "05ebd7f108e420e2b4e4810ea4b3c810"
30SRC_URI[sha256sum] = "6bd4a658a5dd8198235b17ad1b1f0cc56d9e6f00d646ddcffdfc6f058b55e4bf"
31
32UCLIBCPATCHES = ""
33UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \
34 file://systemd-pam-fix-execvpe.patch \
35 file://systemd-pam-fix-fallocate.patch \
36 file://systemd-pam-fix-getty-unit.patch \
37 file://systemd-pam-fix-mkostemp.patch \
38 file://systemd-pam-fix-msformat.patch \
39 file://optional_secure_getenv.patch \
40 "
41LDFLAGS_libc-uclibc_append = " -lrt"
42
43# This will disappear with systemd 197
44SYSTEMDDISTRO ?= "debian"
45
46CACHED_CONFIGUREVARS = "ac_cv_file__usr_share_pci_ids=no \
47 ac_cv_file__usr_share_hwdata_pci_ids=no \
48 ac_cv_file__usr_share_misc_pci_ids=yes"
49
50# The gtk+ tools should get built as a separate recipe e.g. systemd-tools
51EXTRA_OECONF = " --with-distro=${SYSTEMDDISTRO} \
52 --with-rootprefix=${base_prefix} \
53 --with-rootlibdir=${base_libdir} \
54 --sbindir=${base_sbindir} \
55 --libexecdir=${base_libdir} \
56 ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \
57 --enable-xz \
58 --disable-manpages \
59 --disable-coredump \
60 --disable-introspection \
61 --with-pci-ids-path=/usr/share/misc \
62 --disable-gtk-doc-html \
63 --disable-tcpwrap \
64 --enable-split-usr \
65 --disable-microhttpd \
66 --without-python \
67 "
68
69# There's no docbook-xsl-native, so for the xsltproc check to false
70do_configure_prepend() {
71 export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}"
72 sed -i /xsltproc/d configure.ac
73
74 # we only have /home/root, not /root
75 sed -i -e 's:=/root:=/home/root:g' units/*.service*
76
77 gtkdocize --docdir ${S}/docs/
78}
79
80do_install() {
81 autotools_do_install
82 install -d ${D}/${base_sbindir}
83 # provided by a seperate recipe
84 rm ${D}${systemd_unitdir}/system/serial-getty* -f
85
86 # provide support for initramfs
87 ln -s ${systemd_unitdir}/systemd ${D}/init
88 ln -s ${systemd_unitdir}/systemd-udevd ${D}/${base_sbindir}/udevd
89
90 # create dir for journal
91 install -d ${D}${localstatedir}/log/journal
92
93 # create machine-id
94 # 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
95 touch ${D}${sysconfdir}/machine-id
96
97 install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/
98
99 install -m 0644 ${WORKDIR}/var-run.conf ${D}${sysconfdir}/tmpfiles.d/
100
101 install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
102}
103
104python populate_packages_prepend (){
105 systemdlibdir = d.getVar("base_libdir", True)
106 do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True)
107}
108PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*"
109
110PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze"
111
112USERADD_PACKAGES = "${PN}"
113GROUPADD_PARAM_${PN} = "-r lock"
114
115FILES_${PN}-analyze = "${bindir}/systemd-analyze"
116RDEPENDS_${PN}-analyze = "python-dbus python-argparse python-textutils"
117RRECOMMENDS_${PN}-analyze = "python-pycairo"
118
119FILES_${PN}-initramfs = "/init"
120RDEPENDS_${PN}-initramfs = "${PN}"
121
122FILES_${PN}-gui = "${bindir}/systemadm"
123
124FILES_${PN}-vconsole-setup = "${systemd_unitdir}/systemd-vconsole-setup \
125 ${systemd_unitdir}/system/systemd-vconsole-setup.service \
126 ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service"
127
128RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts"
129
130CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \
131 ${sysconfdir}/systemd/logind.conf \
132 ${sysconfdir}/systemd/system.conf \
133 ${sysconfdir}/systemd/user.conf"
134
135FILES_${PN} = " ${base_bindir}/* \
136 ${datadir}/dbus-1/services \
137 ${datadir}/dbus-1/system-services \
138 ${datadir}/polkit-1 \
139 ${datadir}/${PN} \
140 ${sysconfdir}/bash_completion.d/ \
141 ${sysconfdir}/binfmt.d/ \
142 ${sysconfdir}/dbus-1/ \
143 ${sysconfdir}/machine-id \
144 ${sysconfdir}/modules-load.d/ \
145 ${sysconfdir}/sysctl.d/ \
146 ${sysconfdir}/systemd/ \
147 ${sysconfdir}/tmpfiles.d/ \
148 ${sysconfdir}/xdg/ \
149 ${sysconfdir}/init.d/README \
150 ${systemd_unitdir}/* \
151 ${systemd_unitdir}/system/* \
152 /lib/udev/rules.d/99-systemd.rules \
153 ${base_libdir}/security/*.so \
154 /cgroup \
155 ${bindir}/systemd* \
156 ${bindir}/localectl \
157 ${bindir}/hostnamectl \
158 ${bindir}/timedatectl \
159 ${exec_prefix}/lib/tmpfiles.d/*.conf \
160 ${exec_prefix}/lib/systemd \
161 ${exec_prefix}/lib/binfmt.d \
162 ${exec_prefix}/lib/modules-load.d \
163 ${exec_prefix}/lib/sysctl.d \
164 ${localstatedir} \
165 ${libexecdir} \
166 /lib/udev/rules.d/70-uaccess.rules \
167 /lib/udev/rules.d/71-seat.rules \
168 /lib/udev/rules.d/73-seat-late.rules \
169 /lib/udev/rules.d/99-systemd.rules \
170 "
171
172FILES_${PN}-dbg += "${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/"
173FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd"
174
175RDEPENDS_${PN} += "dbus udev-systemd"
176
177# kbd -> loadkeys,setfont
178# systemd calls 'modprobe -sab --', which busybox doesn't support due to lack
179# of blacklist support, so use proper modprobe from module-init-tools
180# And pull in the kernel modules mentioned in INSTALL
181# swapon -p is also not supported by busybox
182# busybox mount is broken
183RRECOMMENDS_${PN} += "systemd-serialgetty \
184 util-linux-agetty \
185 util-linux-swaponoff \
186 util-linux-fsck e2fsprogs-e2fsck \
187 module-init-tools \
188 util-linux-mount util-linux-umount \
189 kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \
190"
191
192PACKAGES =+ "udev-dbg udev udev-consolekit udev-utils udev-systemd"
193
194FILES_udev-dbg += "/lib/udev/.debug"
195
196RDEPENDS_udev += "udev-utils"
197RPROVIDES_udev = "hotplug"
198
199FILES_udev += "${base_sbindir}/udevd \
200 /libstemd-udevd \
201 /lib/udev/accelerometer \
202 /lib/udev/ata_id \
203 /lib/udev/cdrom_id \
204 /lib/udev/collect \
205 /lib/udev/findkeyboards \
206 /lib/udev/keyboard-force-release.sh \
207 /lib/udev/keymap \
208 /lib/udev/mtd_probe \
209 /lib/udev/scsi_id \
210 /lib/udev/v4l_id \
211 /lib/udev/keymaps \
212 /lib/udev/rules.d/4*.rules \
213 /lib/udev/rules.d/5*.rules \
214 /lib/udev/rules.d/6*.rules \
215 /lib/udev/rules.d/70-power-switch.rules \
216 /lib/udev/rules.d/75*.rules \
217 /lib/udev/rules.d/78*.rules \
218 /lib/udev/rules.d/8*.rules \
219 /lib/udev/rules.d/95*.rules \
220 ${base_libdir}/udev/hwdb.d \
221 ${sysconfdir}/udev \
222 "
223
224FILES_udev-consolekit += "/lib/ConsoleKit"
225RDEPENDS_udev-consolekit += "${@base_contains('DISTRO_FEATURES', 'x11', 'consolekit', '', d)}"
226
227FILES_udev-utils = "${bindir}/udevadm"
228
229FILES_udev-systemd = "${systemd_unitdir}/system/*udev* ${systemd_unitdir}/system/*.wants/*udev*"
230RDEPENDS_udev-systemd = "udev"
231
232# TODO:
233# u-a for runlevel and telinit
234
235pkg_postinst_systemd () {
236update-alternatives --install ${base_sbindir}/init init ${systemd_unitdir}/systemd 300
237update-alternatives --install ${base_sbindir}/halt halt ${base_bindir}/systemctl 300
238update-alternatives --install ${base_sbindir}/reboot reboot ${base_bindir}/systemctl 300
239update-alternatives --install ${base_sbindir}/shutdown shutdown ${base_bindir}/systemctl 300
240update-alternatives --install ${base_sbindir}/poweroff poweroff ${base_bindir}/systemctl 300
241}
242
243pkg_prerm_systemd () {
244update-alternatives --remove init ${systemd_unitdir}/systemd
245update-alternatives --remove halt ${base_bindir}/systemctl
246update-alternatives --remove reboot ${base_bindir}/systemctl
247update-alternatives --remove shutdown ${base_bindir}/systemctl
248update-alternatives --remove poweroff ${base_bindir}/systemctl
249}