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 3/5] Rework of the init system
Date: Thu, 22 Mar 2012 10:27:18 +0100	[thread overview]
Message-ID: <c679b15fffb3a2810a4ec000e4393d5d11677f53.1332408273.git.maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <cover.1332408273.git.maxime.ripard@free-electrons.com>

Since we have now two uncompatible init systems, and we want only one of
them at the same time in use in the rootfs, we need to select a
particular init system. This patch also adds $(PKG)_INSTALL_INIT_SYSTEMD
and $(PKG)_INSTALL_INIT_SYSV hooks that are called when the matching
init systems are selected to install properly the init scripts of the
package.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 package/Makefile.package.in |    8 ++++++++
 package/sysvinit/Config.in  |    1 +
 target/generic/Config.in    |   28 ++++++++++++++++++++++++++++
 3 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/package/Makefile.package.in b/package/Makefile.package.in
index f7b6566..3992247 100644
--- a/package/Makefile.package.in
+++ b/package/Makefile.package.in
@@ -427,6 +427,10 @@ $(BUILD_DIR)/%/.stamp_images_installed:
 # Install to target dir
 $(BUILD_DIR)/%/.stamp_target_installed:
 	@$(call MESSAGE,"Installing to target")
+	$(if $(BR2_INIT_SYSTEMD),\
+		$($(PKG)_INSTALL_INIT_SYSTEMD))
+	$(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
+		$($(PKG)_INSTALL_INIT_SYSV))
 	$($(PKG)_INSTALL_TARGET_CMDS)
 	$(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
 	$(Q)touch $@
@@ -445,6 +449,10 @@ $(BUILD_DIR)/%/.stamp_uninstalled:
 	rm -f $($(PKG)_TARGET_INSTALL_TARGET)
 	$($(PKG)_UNINSTALL_STAGING_CMDS)
 	$($(PKG)_UNINSTALL_TARGET_CMDS)
+	$(if $(BR2_INIT_SYSTEMD),\
+		$($(PKG)_UNINSTALL_INIT_SYSTEMD))
+	$(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
+		$($(PKG)_UNINSTALL_INIT_SYSV))
 
 # Remove package sources
 $(BUILD_DIR)/%/.stamp_dircleaned:
diff --git a/package/sysvinit/Config.in b/package/sysvinit/Config.in
index 34ec391..d91c643 100644
--- a/package/sysvinit/Config.in
+++ b/package/sysvinit/Config.in
@@ -1,5 +1,6 @@
 config BR2_PACKAGE_SYSVINIT
 	bool "sysvinit"
+	depends on BR2_INIT_SYSV
 	help
 	  /sbin/init - parent of all processes
 
diff --git a/target/generic/Config.in b/target/generic/Config.in
index 88f0718..40009bd 100644
--- a/target/generic/Config.in
+++ b/target/generic/Config.in
@@ -37,6 +37,34 @@ comment "udev requires a toolchain with LARGEFILE + WCHAR support"
 
 endchoice
 
+choice
+	prompt "Init system"
+	default BR2_INIT_BUSYBOX
+	help
+	  To select systemd, you first need to have dbus and udev enabled
+
+config BR2_INIT_BUSYBOX
+	bool "Busybox init"
+	select BR2_PACKAGE_BUSYBOX
+
+config BR2_INIT_SYSV
+	bool "Use systemV init"
+	select BR2_PACKAGE_SYSVINIT
+
+config BR2_INIT_SYSTEMD
+	bool "Use systemd"
+	depends on BR2_LARGEFILE
+	depends on BR2_USE_WCHAR
+	depends on BR2_INET_IPV6
+	select BR2_PACKAGE_DBUS
+	select BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+	select BR2_PACKAGE_SYSTEMD
+
+comment 'systemd requires largefile, wchar and IPv6 support'
+	depends on !(BR2_LARGEFILE && BR2_USE_WCHAR && BR2_INET_IPV6)
+
+endchoice
+
 config BR2_ROOTFS_DEVICE_TABLE
 	string "Path to the permission tables"
 	default "target/generic/device_table.txt"
-- 
1.7.5.4

  parent reply	other threads:[~2012-03-22  9:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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-03-22  9:27 ` [Buildroot] [PATCH 2/5] Enable cgroups in Linux if we use systemd Maxime Ripard
2012-03-22  9:27 ` Maxime Ripard [this message]
2012-03-22  9:27 ` [Buildroot] [PATCH 4/5] Fix installation for the lighttpd package Maxime Ripard
2012-03-22 20:59   ` Arnout Vandecappelle
2012-03-22 22:02   ` Peter Korsgaard
2012-03-23  9:07     ` Maxime Ripard
2012-03-22  9:27 ` [Buildroot] [PATCH 5/5] Add systemd unit for lighttpd Maxime Ripard
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 3/5] Rework of the init system Maxime Ripard
2012-03-23 15:49 [Buildroot] [pull request v4] Pull request for branch for-2012.05/systemd Maxime Ripard
2012-03-23 15:49 ` [Buildroot] [PATCH 3/5] Rework of the init system Maxime Ripard

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=c679b15fffb3a2810a4ec000e4393d5d11677f53.1332408273.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.