From patchwork Thu Mar 22 09:27:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 148196 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 45E8DB6EEF for ; Thu, 22 Mar 2012 20:28:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8DE428D6F1; Thu, 22 Mar 2012 09:28:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Yfx9WsSeBcZv; Thu, 22 Mar 2012 09:28:24 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A2E9C8D864; Thu, 22 Mar 2012 09:28:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 533998F753 for ; Thu, 22 Mar 2012 09:27:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 186BF8AAAC for ; Thu, 22 Mar 2012 09:27:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BV9TWqwVf6Ue for ; Thu, 22 Mar 2012 09:27:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by whitealder.osuosl.org (Postfix) with ESMTP id 1DD3D8D6C6 for ; Thu, 22 Mar 2012 09:27:44 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id A23F31B0; Thu, 22 Mar 2012 10:27:39 +0100 (CET) Received: from localhost (col31-4-88-188-83-94.fbx.proxad.net [88.188.83.94]) by mail.free-electrons.com (Postfix) with ESMTPSA id C3057192 for ; Thu, 22 Mar 2012 10:27:24 +0100 (CET) From: Maxime Ripard To: buildroot@busybox.net Date: Thu, 22 Mar 2012 10:27:18 +0100 Message-Id: X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 3/5] Rework of the init system X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net 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 --- 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"