From patchwork Fri Mar 23 15:49:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 148461 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id A8B04B6EE6 for ; Sat, 24 Mar 2012 02:51:04 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id CE58A272CC; Fri, 23 Mar 2012 15:51:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KTYInR-vpFij; Fri, 23 Mar 2012 15:50:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 31F86269A5; Fri, 23 Mar 2012 15:50:41 +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 6D9478F753 for ; Fri, 23 Mar 2012 15:50:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 607828C3E7 for ; Fri, 23 Mar 2012 15:50:31 +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 KJvf26pkrNgI for ; Fri, 23 Mar 2012 15:50:22 +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 61B6B8F715 for ; Fri, 23 Mar 2012 15:50:22 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 678731A5; Fri, 23 Mar 2012 16:50:19 +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 AC332182 for ; Fri, 23 Mar 2012 16:50:01 +0100 (CET) From: Maxime Ripard To: buildroot@busybox.net Date: Fri, 23 Mar 2012 16:49:54 +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"