summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 @@
+DESCRIPTION = "Units to make systemd work better with existing sysvinit scripts"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+
+PR = "r18"
+
+inherit allarch
+
+SRC_URI = "file://*.service"
+
+do_install() {
+ install -d ${D}${systemd_unitdir}/system/basic.target.wants
+ install -d ${D}${systemd_unitdir}/system/sysinit.target.wants/
+ install -m 0644 ${WORKDIR}/run-postinsts.service ${D}${systemd_unitdir}/system
+ ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/basic.target.wants/
+ ln -sf ../run-postinsts.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
+
+ install -m 0644 ${WORKDIR}/machineid.service ${D}${systemd_unitdir}/system
+ ln -sf ../machineid.service ${D}${systemd_unitdir}/system/sysinit.target.wants/
+ ln -sf ../machineid.service ${D}${systemd_unitdir}/system/basic.target.wants/
+
+ # hack to make old style sysvinit postinsts succeed
+ install -d ${D}${bindir}
+ echo "echo 1" > ${D}${bindir}/runlevel
+ chmod 0755 ${D}${bindir}/runlevel
+}
+
+SYSTEMD_DISABLED_SYSV_SERVICES = " \
+ busybox-udhcpc \
+ dnsmasq \
+ hwclock \
+ networking \
+ syslog.busybox \
+"
+
+pkg_postinst_${PN} () {
+ cd $D${sysconfdir}/init.d
+
+ echo "Disabling the following sysv scripts: "
+
+ OPTS=""
+
+ if [ -n "$D" ]; then
+ OPTS="--root=$D"
+ fi
+
+ for i in ${SYSTEMD_DISABLED_SYSV_SERVICES} ; do
+ if [ \( -e $i -o $i.sh \) -a ! -e $D${sysconfdir}/systemd/system/$i.service ] ; then
+ echo -n "$i: " ; systemctl ${OPTS} mask $i.service
+ fi
+ done ; echo
+}
+
+FILES_${PN} = "${systemd_unitdir}/system ${bindir}"
+RDPEPENDS_${PN} = "systemd"
+
+
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 @@
+[Unit]
+Description=Machine ID first boot configure
+DefaultDependencies=no
+ConditionPathExists=|!/etc/machine-id
+After=remount-rootfs.service
+Before=sysinit.target
+
+[Service]
+ExecStart=/bin/systemd-machine-id-setup
+RemainAfterExit=No
+Type=oneshot
+StandardOutput=syslog
+
+[Install]
+WantedBy=basic.target
+WantedBy=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 @@
+[Unit]
+Description=Run pending postinsts
+DefaultDependencies=no
+ConditionPathExists=|/etc/rcS.d/S98run-postinsts
+After=remount-rootfs.service tmp.mount
+Before=sysinit.target
+
+[Service]
+ExecStart=/etc/rcS.d/S98run-postinsts
+RemainAfterExit=No
+Type=oneshot
+StandardOutput=syslog
+TimeoutSec=0
+
+[Install]
+WantedBy=basic.target
+WantedBy=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 @@
+DESCRIPTION = "Systemd serial config"
+LICENSE = "GPLv2+"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6"
+
+PR = "r3"
+
+SERIAL_CONSOLE ?= "115200 ttyS0"
+
+SRC_URI = "file://serial-getty@.service"
+
+def get_serial_console_value(d, index):
+ c = d.getVar('SERIAL_CONSOLE', True)
+
+ if len(c):
+ return c.split()[index]
+
+ return ""
+
+def get_baudrate(d):
+ return get_serial_console_value(d, 0)
+
+def get_console(d):
+ return get_serial_console_value(d, 1)
+
+do_install() {
+ if [ ! ${@get_baudrate(d)} = "" ]; then
+ sed -i -e s/\@BAUDRATE\@/${@get_baudrate(d)}/g ${WORKDIR}/serial-getty@.service
+ install -d ${D}${systemd_unitdir}/system/
+ install -d ${D}${sysconfdir}/systemd/system/getty.target.wants/
+ install ${WORKDIR}/serial-getty@.service ${D}${systemd_unitdir}/system/
+
+ # enable the service
+ ln -sf ${systemd_unitdir}/system/serial-getty@.service \
+ ${D}${sysconfdir}/systemd/system/getty.target.wants/serial-getty@${@get_console(d)}.service
+ fi
+}
+
+PACKAGES = "${PN} ${PN}-dbg ${PN}-dev ${PN}-doc"
+
+RRECOMMENDS_${PN} = ""
+RDEPENDS_${PN} = "systemd"
+
+# This is a machine specific file
+FILES_${PN} = "${systemd_unitdir}/system/serial-getty@.service ${sysconfdir}"
+PACKAGE_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 @@
+# This file is part of systemd.
+#
+# systemd is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+
+[Unit]
+Description=Serial Getty on %I
+BindTo=dev-%i.device
+After=dev-%i.device systemd-user-sessions.service
+
+# If additional gettys are spawned during boot then we should make
+# sure that this is synchronized before getty.target, even though
+# getty.target didn't actually pull it in.
+Before=getty.target
+
+[Service]
+Environment=TERM=vt100
+ExecStart=-/sbin/agetty -s %I @BAUDRATE@
+Restart=always
+RestartSec=0
+UtmpIdentifier=%I
+TTYPath=/dev/%I
+TTYReset=yes
+TTYVHangup=yes
+KillMode=process
+IgnoreSIGPIPE=no
+
+# Some login implementations ignore SIGTERM, so we send SIGHUP
+# instead, to ensure that login terminates cleanly.
+KillSignal=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 @@
+DESCRIPTION = "Wrapper to enable of systemd services"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58"
+
+PR = "r6"
+
+inherit native
+
+SRC_URI = "file://systemctl"
+
+do_install() {
+ install -d ${D}${bindir}
+ install -m 0755 ${WORKDIR}/systemctl ${D}${bindir}
+}
diff --git a/meta/recipes-core/systemd/systemd-systemctl/systemctl b/meta/recipes-core/systemd/systemd-systemctl/systemctl
new file mode 100755
index 0000000000..d71c7eda8b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd-systemctl/systemctl
@@ -0,0 +1,126 @@
+#!/bin/sh
+echo "Started $0 $*"
+
+ROOT=
+
+# parse command line params
+action=
+while [ $# != 0 ]; do
+ opt="$1"
+
+ case "$opt" in
+ enable)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ disable)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ mask)
+ shift
+
+ action="$opt"
+ services="$1"
+ cmd_args="1"
+ shift
+ ;;
+ --root=*)
+ ROOT=${opt##--root=}
+ cmd_args="0"
+ shift
+ ;;
+ *)
+ if [ "$cmd_args" = "1" ]; then
+ services="$services $opt"
+ shift
+ else
+ echo "'$opt' is an unkown option; exiting with error"
+ exit 1
+ fi
+ ;;
+ esac
+done
+
+for service in $services; do
+ if [ "$action" = "mask" ]; then
+ if [ ! -d $ROOT/etc/systemd/system/ ]; then
+ mkdir -p $ROOT/etc/systemd/system/
+ fi
+ cmd="ln -s /dev/null $ROOT/etc/systemd/system/$service"
+ echo "$cmd"
+ $cmd
+ exit 0
+ fi
+
+ echo "Try to find location of $service..."
+ # find service file
+ for p in $ROOT/etc/systemd/system \
+ $ROOT/lib/systemd/system \
+ $ROOT/usr/lib/systemd/system; do
+ if [ -e $p/$service ]; then
+ service_file=$p/$service
+ service_file=${service_file##$ROOT}
+ fi
+ done
+ if [ -z "$service_file" ]; then
+ echo "'$service' couldn't be found; exiting with error"
+ exit 1
+ fi
+ echo "Found $service in $service_file"
+
+ # create the required symbolic links
+ wanted_by=$(grep WantedBy $ROOT/$service_file \
+ | sed 's,WantedBy=,,g' \
+ | tr ',' '\n' \
+ | grep '\(\.target$\)\|\(\.service$\)')
+
+ for r in $wanted_by; do
+ echo "WantedBy=$r found in $service"
+ if [ "$action" = "enable" ]; then
+ mkdir -p $ROOT/etc/systemd/system/$r.wants
+ ln -s $service_file $ROOT/etc/systemd/system/$r.wants
+ echo "Enabled $service for $wanted_by."
+ else
+ rm -f $ROOT/etc/systemd/system/$r.wants/$service
+ rmdir --ignore-fail-on-non-empty -p $ROOT/etc/systemd/system/$r.wants
+ echo "Disabled $service for $wanted_by."
+ fi
+ done
+
+ # create the required symbolic 'Alias' links
+ alias=$(grep Alias $ROOT/$service_file \
+ | sed 's,Alias=,,g' \
+ | tr ',' '\n' \
+ | grep '\.service$')
+
+ for r in $alias; do
+ if [ "$action" = "enable" ]; then
+ mkdir -p $ROOT/etc/systemd/system
+ ln -s $service_file $ROOT/etc/systemd/system/$r
+ echo "Enabled $service for $alias."
+ else
+ rm -f $ROOT/etc/systemd/system/$r
+ echo "Disabled $service for $alias."
+ fi
+ done
+
+ # call us for the other required scripts
+ also=$(grep Also $ROOT/$service_file \
+ | sed 's,Also=,,g' \
+ | tr ',' '\n')
+ for a in $also; do
+ echo "Also=$a found in $service"
+ if [ "$action" = "enable" ]; then
+ $0 --root=$ROOT enable $a
+ fi
+ done
+done
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 @@
+#This goes hand-in-hand with the base-files of OE-Core. The file must
+# be sorted before 'systemd.conf' becuase this attempts to create a file
+# inside /var/log.
+
+
+d /var/volatile/cache - - - -
+d /var/volatile/log - - - -
+d /var/volatile/lock - - - -
+d /var/volatile/run - - - -
+d /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 @@
+From 2003e63f48cee2f497de7b90b66284f98c1c9919 Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Mon, 10 Dec 2012 12:24:32 +0100
+Subject: [PATCH 1/2] Revert "systemd-analyze: use argparse instead of getopt"
+
+This reverts commit 0c0271841ab45595f71528c50bcf1904d4b841d5.
+
+Argparse is broken in current OE python
+---
+ src/analyze/systemd-analyze | 60 ++++++++++++++++++++++++++++---------------
+ 1 files changed, 39 insertions(+), 21 deletions(-)
+
+diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze
+index 88699d6..87a83dd 100755
+--- a/src/analyze/systemd-analyze
++++ b/src/analyze/systemd-analyze
+@@ -1,7 +1,6 @@
+ #!/usr/bin/python
+
+-import sys, os
+-import argparse
++import getopt, sys, os
+ from gi.repository import Gio
+ try:
+ import cairo
+@@ -76,6 +75,20 @@ def draw_text(context, x, y, text, size = 12, r = 0, g = 0, b = 0, vcenter = 0.5
+
+ context.restore()
+
++def usage():
++ sys.stdout.write("""systemd-analyze [--user] time
++systemd-analyze [--user] blame
++systemd-analyze [--user] plot
++
++Process systemd profiling information
++
++ -h --help Show this help
++""")
++
++def help():
++ usage()
++ sys.exit()
++
+ def time():
+
+ initrd_time, start_time, finish_time = acquire_start_time()
+@@ -266,29 +279,34 @@ def plot():
+
+ surface.finish()
+
+-parser = argparse.ArgumentParser(formatter_class=argparse.RawDescriptionHelpFormatter,
+- description='Process systemd profiling information',
+- epilog='''\
+-time - print time spent in the kernel before reaching userspace
+-blame - print list of running units ordered by time to init
+-plot - output SVG graphic showing service initialization
+-''')
+-
+-parser.add_argument('action', choices=('time', 'blame', 'plot'),
+- default='time', nargs='?',
+- help='action to perform (default: time)')
+-parser.add_argument('--user', action='store_true',
+- help='use the session bus')
++def unknown_verb():
++ sys.stderr.write("Unknown verb '%s'.\n" % args[0])
++ usage()
++ sys.exit(1)
+
+-args = parser.parse_args()
++bus = Gio.BusType.SYSTEM
+
+-if args.user:
+- bus = Gio.BusType.SESSION
+-else:
+- bus = Gio.BusType.SYSTEM
++try:
++ opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help", "user"])
++except getopt.GetoptError as err:
++ sys.stdout.write(str(err) + "\n")
++ usage()
++ sys.exit(2)
++for o, a in opts:
++ if o in ("-h", "--help"):
++ help()
++ elif o == '--user':
++ bus = Gio.BusType.SESSION
++ else:
++ assert False, "unhandled option"
+
+ verb = {'time' : time,
+ 'blame': blame,
+ 'plot' : plot,
++ 'help' : help,
+ }
+-verb.get(args.action)()
++
++if len(args) == 0:
++ time()
++else:
++ verb.get(args[0], unknown_verb)()
+--
+1.7.7.6
+
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 @@
+From 8079db861b8ffdce69fa10a9ab9ef4740045187f Mon Sep 17 00:00:00 2001
+From: Koen Kooi <koen@dominion.thruhere.net>
+Date: Mon, 10 Dec 2012 12:25:00 +0100
+Subject: [PATCH 2/2] Revert "analyze: use GDBus instead of dbus-python"
+
+This reverts commit 4940c64240541e91411620b7dc0963e012aa6b91.
+
+Python-gobject is too old in current OE
+---
+ src/analyze/systemd-analyze | 31 ++++++++++++++-----------------
+ 1 files changed, 14 insertions(+), 17 deletions(-)
+
+diff --git a/src/analyze/systemd-analyze b/src/analyze/systemd-analyze
+index 87a83dd..636fd74 100755
+--- a/src/analyze/systemd-analyze
++++ b/src/analyze/systemd-analyze
+@@ -1,15 +1,14 @@
+ #!/usr/bin/python
+
+-import getopt, sys, os
+-from gi.repository import Gio
++import getopt, dbus, sys, os
+ try:
+ import cairo
+ except ImportError:
+ cairo = None
+
+ def acquire_time_data():
+- manager = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE,
+- None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.systemd1.Manager', None)
++
++ manager = dbus.Interface(bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1'), 'org.freedesktop.systemd1.Manager')
+ units = manager.ListUnits()
+
+ l = []
+@@ -18,25 +17,23 @@ def acquire_time_data():
+ if i[5] != "":
+ continue
+
+- properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE,
+- None, 'org.freedesktop.systemd1', i[6], 'org.freedesktop.DBus.Properties', None)
++ properties = dbus.Interface(bus.get_object('org.freedesktop.systemd1', i[6]), 'org.freedesktop.DBus.Properties')
+
+- ixt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveExitTimestampMonotonic')
+- aet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveEnterTimestampMonotonic')
+- axt = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'ActiveExitTimestampMonotonic')
+- iet = properties.Get('(ss)', 'org.freedesktop.systemd1.Unit', 'InactiveEnterTimestampMonotonic')
++ ixt = int(properties.Get('org.freedesktop.systemd1.Unit', 'InactiveExitTimestampMonotonic'))
++ aet = int(properties.Get('org.freedesktop.systemd1.Unit', 'ActiveEnterTimestampMonotonic'))
++ axt = int(properties.Get('org.freedesktop.systemd1.Unit', 'ActiveExitTimestampMonotonic'))
++ iet = int(properties.Get('org.freedesktop.systemd1.Unit', 'InactiveEnterTimestampMonotonic'))
+
+ l.append((str(i[0]), ixt, aet, axt, iet))
+
+ return l
+
+ def acquire_start_time():
+- properties = Gio.DBusProxy.new_for_bus_sync(bus, Gio.DBusProxyFlags.NONE,
+- None, 'org.freedesktop.systemd1', '/org/freedesktop/systemd1', 'org.freedesktop.DBus.Properties', None)
++ properties = dbus.Interface(bus.get_object('org.freedesktop.systemd1', '/org/freedesktop/systemd1'), 'org.freedesktop.DBus.Properties')
+
+- initrd_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'InitRDTimestampMonotonic')
+- userspace_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'UserspaceTimestampMonotonic')
+- finish_time = properties.Get('(ss)', 'org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic')
++ initrd_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'InitRDTimestampMonotonic'))
++ userspace_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'UserspaceTimestampMonotonic'))
++ finish_time = int(properties.Get('org.freedesktop.systemd1.Manager', 'FinishTimestampMonotonic'))
+
+ if finish_time == 0:
+ sys.stderr.write("Bootup is not yet finished. Please try again later.\n")
+@@ -284,7 +281,7 @@ def unknown_verb():
+ usage()
+ sys.exit(1)
+
+-bus = Gio.BusType.SYSTEM
++bus = dbus.SystemBus()
+
+ try:
+ opts, args = getopt.gnu_getopt(sys.argv[1:], "h", ["help", "user"])
+@@ -296,7 +293,7 @@ for o, a in opts:
+ if o in ("-h", "--help"):
+ help()
+ elif o == '--user':
+- bus = Gio.BusType.SESSION
++ bus = dbus.SessionBus()
+ else:
+ assert False, "unhandled option"
+
+--
+1.7.7.6
+
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 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+# For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Try and modprobe for drivers for new hardware
+ACTION=="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 @@
+on uclibc secure_getenv is not available
+therefore default to using getenv instead
+
+Singed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+Index: git/src/shared/missing.h
+===================================================================
+--- git.orig/src/shared/missing.h 2012-09-22 18:46:44.141282145 -0700
++++ git/src/shared/missing.h 2012-09-22 18:48:44.081276570 -0700
+@@ -233,6 +233,8 @@
+ #ifndef HAVE_SECURE_GETENV
+ # ifdef HAVE___SECURE_GETENV
+ # define secure_getenv __secure_getenv
++# elif defined __UCLIBC__
++# define secure_getenv getenv
+ # else
+ # error neither secure_getenv nor __secure_getenv are available
+ # endif
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-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 @@
+--- systemd-185.orig/configure.ac 2012-06-04 14:15:16.000000000 -0400
++++ systemd-pam-185/configure.ac 2012-06-21 22:57:10.000000000 -0400
+@@ -63,6 +63,23 @@
+
+ AC_PATH_PROG([M4], [m4])
+
++# check for few functions not implemented in uClibc
++
++AC_CHECK_FUNCS_ONCE(mkostemp execvpe posix_fallocate)
++
++# check for %ms format support - assume always no if cross compiling
++
++AC_MSG_CHECKING([whether %ms format is supported by *scanf])
++
++AC_RUN_IFELSE(
++ [AC_LANG_PROGRAM([[ include <stdio.h> ]],
++ [[ char *buf1, *buf2, *buf3, str="1 2.3 abcde" ;
++ int rc = sscanf(str, "%ms %ms %ms", &buf1, &buf2, &buf3) ;
++ return (rc==3)?0:1;]])],
++ [AC_DEFINE([HAVE_MSFORMAT], [1], [Define if %ms format is supported by *scanf.])],
++ [AC_MSG_RESULT([no])],
++ [AC_MSG_RESULT([no])])
++
+ # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
+ m4_ifdef([GTK_DOC_CHECK], [
+ GTK_DOC_CHECK([1.18],[--flavour no-tmpl])
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 @@
+Index: git/src/nspawn/nspawn.c
+===================================================================
+--- git.orig/src/nspawn/nspawn.c 2012-09-22 17:57:05.000000000 -0700
++++ git/src/nspawn/nspawn.c 2012-09-22 18:01:41.541405768 -0700
+@@ -63,6 +63,8 @@
+ LINK_GUEST
+ } LinkJournal;
+
++#include "config.h"
++
+ static char *arg_directory = NULL;
+ static char *arg_user = NULL;
+ static char **arg_controllers = NULL;
+@@ -1373,7 +1375,12 @@
+ a[0] = (char*) "/sbin/init";
+ execve(a[0], a, (char**) envp);
+ } else if (argc > optind)
++#ifdef HAVE_EXECVPE
+ execvpe(argv[optind], argv + optind, (char**) envp);
++#else
++ environ = (char **)envp;
++ execvp(argv[optind], argv + optind);
++#endif /* HAVE_EXECVPE */
+ else {
+ chdir(home ? home : "/root");
+ 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 @@
+Index: git/src/journal/journal-file.c
+===================================================================
+--- git.orig/src/journal/journal-file.c 2012-09-02 09:49:15.126089594 -0700
++++ git/src/journal/journal-file.c 2012-09-02 09:49:17.118089670 -0700
+@@ -34,6 +34,8 @@
+ #include "compress.h"
+ #include "fsprg.h"
+
++#include "config.h"
++
+ #define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
+ #define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
+
+@@ -262,7 +264,7 @@
+
+ static int journal_file_allocate(JournalFile *f, uint64_t offset, uint64_t size) {
+ uint64_t old_size, new_size;
+- int r;
++ int r = 0;
+
+ assert(f);
+
+@@ -307,10 +309,25 @@
+ /* Note that the glibc fallocate() fallback is very
+ inefficient, hence we try to minimize the allocation area
+ as we can. */
++#ifdef HAVE_POSIX_ALLOCATE
+ r = posix_fallocate(f->fd, old_size, new_size - old_size);
+ if (r != 0)
+ return -r;
+
++#else
++ /* Use good old method to write zeros into the journal file
++ perhaps very inefficient yet working. */
++ if(new_size > old_size) {
++ char *buf = alloca(new_size - old_size);
++ off_t oldpos = lseek(f->fd, 0, SEEK_CUR);
++ bzero(buf, new_size - old_size);
++ lseek(f->fd, old_size, SEEK_SET);
++ r = write(f->fd, buf, new_size - old_size);
++ lseek(f->fd, oldpos, SEEK_SET);
++ }
++ if (r < 0)
++ return -errno;
++#endif /* HAVE_POSIX_FALLOCATE */
+ if (fstat(f->fd, &f->last_stat) < 0)
+ return -errno;
+
+Index: git/src/journal/journald-kmsg.c
+===================================================================
+--- git.orig/src/journal/journald-kmsg.c 2012-09-02 09:49:15.130089595 -0700
++++ git/src/journal/journald-kmsg.c 2012-09-02 12:26:17.326447895 -0700
+@@ -404,6 +404,7 @@
+
+ int server_open_kernel_seqnum(Server *s) {
+ int fd;
++ int r = 0;
+ uint64_t *p;
+
+ assert(s);
+@@ -417,8 +418,19 @@
+ log_error("Failed to open /run/systemd/journal/kernel-seqnum, ignoring: %m");
+ return 0;
+ }
+-
+- if (posix_fallocate(fd, 0, sizeof(uint64_t)) < 0) {
++#ifdef HAVE_POSIX_ALLOCATE
++ r = posix_fallocate(fd, 0, sizeof(uint64_t));
++#else
++ /* Use good old method to write zeros into the journal file
++ perhaps very inefficient yet working. */
++ char *buf = alloca(sizeof(uint64_t));
++ off_t oldpos = lseek(fd, 0, SEEK_CUR);
++ bzero(buf, sizeof(uint64_t));
++ lseek(fd, 0, SEEK_SET);
++ r = write(fd, buf, sizeof(uint64_t));
++ lseek(fd, oldpos, SEEK_SET);
++#endif /* HAVE_POSIX_FALLOCATE */
++ if (r < 0) {
+ log_error("Failed to allocate sequential number file, ignoring: %m");
+ close_nointr_nofail(fd);
+ 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 @@
+Prefer getty to agetty in console setup systemd units
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+---
+ units/getty@.service.m4 | 2 +-
+ units/serial-getty@.service.m4 | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+Index: systemd-37/units/getty@.service.m4
+===================================================================
+--- systemd-37.orig/units/getty@.service.m4
++++ systemd-37/units/getty@.service.m4
+@@ -41,7 +41,7 @@
+
+ [Service]
+ Environment=TERM=linux
+ # the VT is cleared by TTYVTDisallocate
+-ExecStart=-/sbin/agetty --noclear %I 38400
++ExecStart=-/sbin/getty -L %I 115200 linux
+ Type=idle
+ Restart=always
+ RestartSec=0
+Index: systemd-37/units/serial-getty@.service.m4
+===================================================================
+--- systemd-37.orig/units/serial-getty@.service.m4
++++ systemd-37/units/serial-getty@.service.m4
+@@ -37,7 +37,7 @@
+
+ [Service]
+ Environment=TERM=vt102
+-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Type=idle
+ Restart=always
+ RestartSec=0
diff --git a/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
new file mode 100644
index 0000000000..8de9a3a326
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/systemd-pam-fix-mkostemp.patch
@@ -0,0 +1,166 @@
+Index: git/src/journal/journal-send.c
+===================================================================
+--- git.orig/src/journal/journal-send.c 2012-09-02 00:10:08.748768268 -0700
++++ git/src/journal/journal-send.c 2012-09-02 00:10:10.508768335 -0700
+@@ -34,6 +34,8 @@
+
+ #define SNDBUF_SIZE (8*1024*1024)
+
++#include "config.h"
++
+ /* We open a single fd, and we'll share it with the current process,
+ * all its threads, and all its subprocesses. This means we need to
+ * initialize it atomically, and need to operate on it atomically
+@@ -293,7 +295,12 @@
+ * file and just pass a file descriptor of it to the other
+ * side */
+
++#ifdef HAVE_MKOSTEMP
+ buffer_fd = mkostemp(path, O_CLOEXEC|O_RDWR);
++#else
++ buffer_fd = mkstemp(path);
++ if (buffer_fd >= 0) fcntl(buffer_fd, F_SETFD, FD_CLOEXEC);
++#endif /* HAVE_MKOSTEMP */
+ if (buffer_fd < 0) {
+ r = -errno;
+ goto finish;
+Index: git/src/core/manager.c
+===================================================================
+--- git.orig/src/core/manager.c 2012-09-02 00:10:08.732768266 -0700
++++ git/src/core/manager.c 2012-09-02 00:10:10.512768334 -0700
+@@ -67,6 +67,8 @@
+ #include "cgroup-util.h"
+ #include "path-util.h"
+
++#include "config.h"
+