All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/5] Add the systemd package
Date: Fri, 23 Mar 2012 16:49:52 +0100	[thread overview]
Message-ID: <9a7c56191b38df92795748612702c89e86c8c9b9.1332517725.git.maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <cover.1332517725.git.maxime.ripard@free-electrons.com>

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 package/Config.in                               |    1 +
 package/dbus/dbus.mk                            |    4 ++
 package/systemd/Config.in                       |   20 +++++++
 package/systemd/systemd-37-fix-getty-unit.patch |   34 ++++++++++++
 package/systemd/systemd.mk                      |   62 +++++++++++++++++++++++
 package/udev/udev.mk                            |    4 ++
 6 files changed, 125 insertions(+), 0 deletions(-)
 create mode 100644 package/systemd/Config.in
 create mode 100644 package/systemd/systemd-37-fix-getty-unit.patch
 create mode 100644 package/systemd/systemd.mk

diff --git a/package/Config.in b/package/Config.in
index 85583c6..623c79a 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -577,6 +577,7 @@ source "package/rsyslog/Config.in"
 source "package/sysklogd/Config.in"
 source "package/sysvinit/Config.in"
 endif
+source "package/systemd/Config.in"
 source "package/util-linux/Config.in"
 source "package/dsp-tools/Config.in"
 endmenu
diff --git a/package/dbus/dbus.mk b/package/dbus/dbus.mk
index e18e291..0942b33 100644
--- a/package/dbus/dbus.mk
+++ b/package/dbus/dbus.mk
@@ -39,6 +39,10 @@ else
 DBUS_CONF_OPT += --without-x
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+DBUS_CONF_OPT += --with-systemdsystemunitdir=/lib/systemd/system
+endif
+
 # fix rebuild (dbus makefile errors out if /var/lib/dbus is a symlink)
 define DBUS_REMOVE_VAR_LIB_DBUS
 	rm -rf $(TARGET_DIR)/var/lib/dbus
diff --git a/package/systemd/Config.in b/package/systemd/Config.in
new file mode 100644
index 0000000..8df3318
--- /dev/null
+++ b/package/systemd/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_SYSTEMD
+	bool "systemd"
+	depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+	depends on BR2_INET_IPV6
+	select BR2_PACKAGE_DBUS
+	select BR2_PACKAGE_LIBCAP
+	help
+	  systemd is a system and service manager for Linux, compatible with
+	  SysV and LSB init scripts. systemd provides aggressive parallelization
+	  capabilities, uses socket and D-Bus activation for starting services,
+	  offers on-demand starting of daemons, keeps track of processes using
+	  Linux cgroups, supports snapshotting and restoring of the system
+	  state, maintains mount and automount points and implements an
+	  elaborate transactional dependency-based service control logic.
+	  It can work as a drop-in replacement for sysvinit.
+
+	  http://freedesktop.org/wiki/Software/systemd
+
+comment "systemd not available (depends on /dev management with udev and ipv6 support)"
+	depends on !(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV && BR2_INET_IPV6)
diff --git a/package/systemd/systemd-37-fix-getty-unit.patch b/package/systemd/systemd-37-fix-getty-unit.patch
new file mode 100644
index 0000000..6df54b1
--- /dev/null
+++ b/package/systemd/systemd-37-fix-getty-unit.patch
@@ -0,0 +1,34 @@
+Prefer getty to agetty in console setup systemd units
+
+Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
+---
+ units/getty at .service.m4        |    2 +-
+ units/serial-getty at .service.m4 |    2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+Index: systemd-37/units/getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/getty at .service.m4
++++ systemd-37/units/getty at .service.m4
+@@ -32,7 +32,7 @@
+ 
+ [Service]
+ Environment=TERM=linux
+-ExecStart=-/sbin/agetty %I 38400
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
+Index: systemd-37/units/serial-getty at .service.m4
+===================================================================
+--- systemd-37.orig/units/serial-getty at .service.m4
++++ systemd-37/units/serial-getty at .service.m4
+@@ -32,7 +32,7 @@
+ 
+ [Service]
+ Environment=TERM=vt100
+-ExecStart=-/sbin/agetty -s %I 115200,38400,9600
++ExecStart=-/sbin/getty -L %I 115200 vt100
+ Restart=always
+ RestartSec=0
+ UtmpIdentifier=%I
diff --git a/package/systemd/systemd.mk b/package/systemd/systemd.mk
new file mode 100644
index 0000000..fc49f3c
--- /dev/null
+++ b/package/systemd/systemd.mk
@@ -0,0 +1,62 @@
+#############################################################
+#
+# systemd
+#
+#############################################################
+SYSTEMD_VERSION = 37
+SYSTEMD_SITE = http://www.freedesktop.org/software/systemd/
+SYSTEMD_SOURCE = systemd-$(SYSTEMD_VERSION).tar.bz2
+SYSTEMD_DEPENDENCIES = \
+	host-intltool \
+	libcap \
+	udev \
+	dbus
+
+# Make sure that systemd will always be built after busybox so that we have
+# a consistent init setup between two builds
+ifeq ($(BR2_PACKAGE_BUSYBOX),y)
+	SYSTEMD_DEPENDENCIES += busybox
+endif
+
+SYSTEMD_CONF_OPT += \
+	--with-distro=other \
+	--disable-selinux \
+	--disable-pam \
+	--disable-libcryptsetup \
+	--disable-gtk \
+	--disable-plymouth \
+	--with-rootdir=/ \
+	--with-dbuspolicydir=/etc/dbus-1/system.d \
+	--with-dbussessionservicedir=/usr/share/dbus-1/services \
+	--with-dbussystemservicedir=/usr/share/dbus-1/system-services \
+	--with-dbusinterfacedir=/usr/share/dbus-1/interfaces \
+	--with-udevrulesdir=/etc/udev/rules.d \
+	--with-sysvinit-path=/etc/init.d/ \
+	--without-sysvrcd-path
+
+ifeq ($(BR2_PACKAGE_ACL),y)
+	SYSTEMD_CONF_OPT += --enable-acl
+	SYSTEMD_DEPENDENCIES += acl
+else
+	SYSTEMD_CONF_OPT += --disable-acl
+endif
+
+define SYSTEMD_INSTALL_INIT_HOOK
+	ln -fs ../bin/systemd $(TARGET_DIR)/sbin/init
+	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/halt
+	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/poweroff
+	ln -fs ../bin/systemctl $(TARGET_DIR)/sbin/reboot
+
+	ln -fs ../../../../lib/systemd/system/multi-user.target $(TARGET_DIR)/etc/systemd/system/default.target
+endef
+
+define SYSTEMD_INSTALL_TTY_HOOK
+	rm -f $(TARGET_DIR)/etc/systemd/system/getty.target.wants/getty at tty1.service
+	ln -fs ../../../../lib/systemd/system/serial-getty at .service $(TARGET_DIR)/etc/systemd/system/getty.target.wants/serial-getty@$(BR2_TARGET_GENERIC_GETTY_PORT).service
+endef
+
+SYSTEMD_POST_INSTALL_TARGET_HOOKS += \
+	SYSTEMD_INSTALL_INIT_HOOK \
+	SYSTEMD_INSTALL_TTY_HOOK \
+
+$(eval $(call AUTOTARGETS))
diff --git a/package/udev/udev.mk b/package/udev/udev.mk
index d445a2f..ed41511 100644
--- a/package/udev/udev.mk
+++ b/package/udev/udev.mk
@@ -35,6 +35,10 @@ UDEV_CONF_OPT +=		\
 	--disable-gudev
 endif
 
+ifeq ($(BR2_PACKAGE_SYSTEMD),y)
+	UDEV_CONF_OPT += --with-systemdsystemunitdir=/lib/systemd/system/
+endif
+
 define UDEV_INSTALL_INITSCRIPT
 	$(INSTALL) -m 0755 package/udev/S10udev $(TARGET_DIR)/etc/init.d/S10udev
 endef
-- 
1.7.5.4

  reply	other threads:[~2012-03-23 15:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23 15:49 [Buildroot] [pull request v4] Pull request for branch for-2012.05/systemd Maxime Ripard
2012-03-23 15:49 ` Maxime Ripard [this message]
2012-03-31 21:59   ` [Buildroot] [PATCH 1/5] Add the systemd package Peter Korsgaard
2012-03-23 15:49 ` [Buildroot] [PATCH 2/5] Enable cgroups in Linux if we use systemd Maxime Ripard
2012-04-02 21:14   ` Peter Korsgaard
2012-03-23 15:49 ` [Buildroot] [PATCH 3/5] Rework of the init system Maxime Ripard
2012-03-23 15:49 ` [Buildroot] [PATCH 4/5] Fix installation for the lighttpd package Maxime Ripard
2012-03-23 15:49 ` [Buildroot] [PATCH 5/5] Add systemd unit for lighttpd Maxime Ripard
  -- strict thread matches above, loose matches on Subject: below --
2012-03-23  9:26 [Buildroot] [pull request v3] Pull request for branch for-2012.05/systemd Maxime Ripard
2012-03-23  9:26 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
2012-03-22  9:27 [Buildroot] [pull request v2] Pull request for branch for-2012.05/systemd Maxime Ripard
2012-03-22  9:27 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
2012-03-22 20:39   ` Peter Korsgaard
2012-03-23  8:51     ` Maxime Ripard
2012-03-23  9:04       ` Peter Korsgaard
2012-02-03 14:27 [Buildroot] [RFC v2] Add systemd to buildroot Maxime Ripard
2012-02-03 14:27 ` [Buildroot] [PATCH 1/5] Add the systemd package Maxime Ripard
2012-02-03 20:32   ` Peter Korsgaard
2012-02-04 13:13     ` Maxime Ripard
2012-02-05  9:58       ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9a7c56191b38df92795748612702c89e86c8c9b9.1332517725.git.maxime.ripard@free-electrons.com \
    --to=maxime.ripard@free-electrons.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.