[oe-commits] Henning Heinold : systemd: add systemd to openembedded

git version control git at git.openembedded.org
Thu Jun 17 23:19:31 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 119349c48a0709faec1c06086029aadbdc86f3e5
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=119349c48a0709faec1c06086029aadbdc86f3e5

Author: Henning Heinold <heinold at inf.fu-berlin.de>
Date:   Wed Jun 16 23:03:24 2010 +0200

systemd: add systemd to openembedded

* not fully functional yet
* needs udev-154 and cgroup enabled in kernel
* halt/reboot don't work with busybox

---

 recipes/systemd/files/disable_xml_generation.patch |   36 ++++++++++++
 recipes/systemd/files/execute.patch                |   17 ++++++
 recipes/systemd/files/getty-serial at .service        |   19 ++++++
 recipes/systemd/files/replace_accpet4.patch        |   26 ++++++++
 recipes/systemd/files/systemadm.patch              |   13 ++++
 recipes/systemd/systemd_git.bb                     |   61 ++++++++++++++++++++
 6 files changed, 172 insertions(+), 0 deletions(-)

diff --git a/recipes/systemd/files/disable_xml_generation.patch b/recipes/systemd/files/disable_xml_generation.patch
new file mode 100644
index 0000000..47f36b8
--- /dev/null
+++ b/recipes/systemd/files/disable_xml_generation.patch
@@ -0,0 +1,36 @@
+Index: git/Makefile.am
+===================================================================
+--- git.orig/Makefile.am	2010-06-15 22:58:46.752961117 +0200
++++ git/Makefile.am	2010-06-15 22:59:22.615040570 +0200
+@@ -75,21 +75,6 @@
+ dist_udevrules_DATA = \
+ 	src/99-systemd.rules
+ 
+-dbusinterface_DATA = \
+-	org.freedesktop.systemd1.Manager.xml \
+-	org.freedesktop.systemd1.Job.xml \
+-	org.freedesktop.systemd1.Unit.xml \
+-	org.freedesktop.systemd1.Service.xml \
+-	org.freedesktop.systemd1.Socket.xml \
+-	org.freedesktop.systemd1.Timer.xml \
+-	org.freedesktop.systemd1.Target.xml \
+-	org.freedesktop.systemd1.Device.xml \
+-	org.freedesktop.systemd1.Mount.xml \
+-	org.freedesktop.systemd1.Automount.xml \
+-	org.freedesktop.systemd1.Snapshot.xml \
+-	org.freedesktop.systemd1.Swap.xml \
+-	org.freedesktop.systemd1.Path.xml
+-
+ dist_systemunit_DATA = \
+ 	units/emergency.service \
+ 	units/basic.target \
+@@ -466,9 +451,6 @@
+ 	man/systemd.special.html.in
+ endif
+ 
+-org.freedesktop.systemd1.%.xml: systemd
+-	$(AM_V_GEN)./systemd --introspect=${@:.xml=} > $@
+-
+ CLEANFILES += $(dbusinterface_DATA)
+ 
+ install-data-hook:
diff --git a/recipes/systemd/files/execute.patch b/recipes/systemd/files/execute.patch
new file mode 100644
index 0000000..c9f88c8
--- /dev/null
+++ b/recipes/systemd/files/execute.patch
@@ -0,0 +1,17 @@
+Index: git/src/execute.c
+===================================================================
+--- git.orig/src/execute.c	2010-06-15 11:41:02.792856752 +0200
++++ git/src/execute.c	2010-06-15 11:52:02.899046198 +0200
+@@ -47,6 +47,12 @@
+ #include "cgroup.h"
+ #include "namespace.h"
+ 
++#ifndef SCHED_RESET_ON_FORK
++#  define SCHED_RESET_ON_FORK 0x40000000
++#endif
++
++
++
+ /* This assumes there is a 'tty' group */
+ #define TTY_MODE 0620
+ 
diff --git a/recipes/systemd/files/getty-serial at .service b/recipes/systemd/files/getty-serial at .service
new file mode 100644
index 0000000..62e4695
--- /dev/null
+++ b/recipes/systemd/files/getty-serial at .service
@@ -0,0 +1,19 @@
+#  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=Getty on %I
+Before=getty.target
+After=basic.target
+Conflicts=shutdown.target
+
+[Service]
+Environment=TERM=linux
+ExecStart=/sbin/getty @BAUDRATE@ %I
+Restart=restart-always
+RestartSec=0
+KillMode=process-group
diff --git a/recipes/systemd/files/replace_accpet4.patch b/recipes/systemd/files/replace_accpet4.patch
new file mode 100644
index 0000000..d57b07a
--- /dev/null
+++ b/recipes/systemd/files/replace_accpet4.patch
@@ -0,0 +1,26 @@
+Index: git/src/logger.c
+===================================================================
+--- git.orig/src/logger.c	2010-06-15 23:02:38.212932153 +0200
++++ git/src/logger.c	2010-06-15 23:02:51.091686447 +0200
+@@ -331,7 +331,7 @@
+ 
+         assert(s);
+ 
+-        if ((fd = accept4(server_fd, NULL, NULL, SOCK_NONBLOCK|SOCK_CLOEXEC)) < 0)
++        if ((fd = accept(server_fd, NULL, NULL)) < 0)
+                 return -errno;
+ 
+         if (s->n_streams >= STREAMS_MAX) {
+Index: git/src/socket.c
+===================================================================
+--- git.orig/src/socket.c	2010-06-15 23:02:16.269606647 +0200
++++ git/src/socket.c	2010-06-15 23:02:31.115021717 +0200
+@@ -1201,7 +1201,7 @@
+         if (w->socket_accept) {
+                 for (;;) {
+ 
+-                        if ((cfd = accept4(fd, NULL, NULL, SOCK_NONBLOCK)) < 0) {
++                        if ((cfd = accept(fd, NULL, NULL)) < 0) {
+ 
+                                 if (errno == EINTR)
+                                         continue;
diff --git a/recipes/systemd/files/systemadm.patch b/recipes/systemd/files/systemadm.patch
new file mode 100644
index 0000000..b9c09db
--- /dev/null
+++ b/recipes/systemd/files/systemadm.patch
@@ -0,0 +1,13 @@
+Index: git/src/systemadm.vala
+===================================================================
+--- git.orig/src/systemadm.vala	2010-06-15 11:02:35.863509632 +0200
++++ git/src/systemadm.vala	2010-06-15 11:06:16.305986249 +0200
+@@ -297,7 +297,7 @@
+ 
+                 bbox.pack_start(cancel_button, false, true, 0);
+ 
+-                bus = Bus.get(session ? BusType.SESSION : BusType.SYSTEM);
++                bus = DBus.Bus.get(session ? DBus.BusType.SESSION : DBus.BusType.SYSTEM);
+ 
+                 manager = bus.get_object(
+                                 "org.freedesktop.systemd1",
diff --git a/recipes/systemd/systemd_git.bb b/recipes/systemd/systemd_git.bb
new file mode 100644
index 0000000..da9c271
--- /dev/null
+++ b/recipes/systemd/systemd_git.bb
@@ -0,0 +1,61 @@
+DESCRIPTION = "Systemd a init replacement"
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd"
+LICENSE = "GPL"
+DEPENDS = "readline udev dbus libcap2 libcgroup gtk+"
+PRIORITY = "optional"
+SECTION = "base/shell"
+
+PR_append = "+${SRCPV}"
+
+inherit autotools vala
+
+TAG = "1ebdf2d8793181f31b766b8342391aa1978f9917"
+
+SRC_URI = "git://anongit.freedesktop.org/systemd;protocol=git;tag=${TAG} \
+           file://execute.patch \
+           file://systemadm.patch \
+           file://disable_xml_generation.patch \
+           file://replace_accpet4.patch \
+           file://getty-serial@.service \
+          "
+
+S = "${WORKDIR}/git"
+
+EXTRA_OECONF = " --with-distro=debian \
+                 --with-rootdir=${base_prefix} \
+               "
+
+PACKAGES = "${PN} ${PN}-gui ${PN}-dbg ${PN}-doc"
+
+FILES_${PN}-gui = "${bindir}/systemadm"
+
+FILES_${PN} = " ${base_bindir}/* \
+                ${datadir}/dbus-1/services \
+                ${datadir}/dbus-1/system-services \
+                ${datadir}/${PN} \
+                ${sysconfdir} \
+                ${base_libdir}/systemd/* \
+                ${base_libdir}/systemd/system/* \
+                ${base_libdir}/udev/rules.d \
+                /cgroup \
+                ${bindir}/systemd-install \
+               "
+
+FILES_${PN}-dbg += " /lib/systemd/.debug "o
+
+def get_baudrate(bb, d):
+    return bb.data.getVar('SERIAL_CONSOLE', d, 1).split()[0]
+    
+
+def get_console(bb, d):
+    return bb.data.getVar('SERIAL_CONSOLE', d, 1).split()[1]
+
+
+do_install_append(){
+        if [ ! ${@get_baudrate(bb, d)} = "" ]; then
+          sed -i -e s/\@BAUDRATE\@/${@get_baudrate(bb, d)}/g ${WORKDIR}/getty-serial at .service
+          install ${WORKDIR}/getty-serial at .service ${D}${base_libdir}/systemd/system/
+          ln -sf ${base_libdir}/systemd/system/getty-serial at .service \
+              ${D}${sysconfdir}/systemd/system/getty.target.wants/getty@${@get_console(bb, d)}.service
+        fi
+}





More information about the Openembedded-commits mailing list