From patchwork Sat Jul 28 07:21:20 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 173833 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 3AA1B2C007A for ; Sat, 28 Jul 2012 17:22:01 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 89DE625C31; Sat, 28 Jul 2012 07:21:58 +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 mmTDFWfqV-we; Sat, 28 Jul 2012 07:21:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 69C96313C2; Sat, 28 Jul 2012 07:21:52 +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 75C018F783 for ; Sat, 28 Jul 2012 07:21:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5F5668D22B for ; Sat, 28 Jul 2012 07:21:51 +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 oCV3cA+6DI54 for ; Sat, 28 Jul 2012 07:21:48 +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 33CA78D15E for ; Sat, 28 Jul 2012 07:21:48 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id 4A11E1A5; Sat, 28 Jul 2012 09:21:33 +0200 (CEST) Received: from localhost (unknown [88.238.76.47]) by mail.free-electrons.com (Postfix) with ESMTPSA id D87DC169 for ; Sat, 28 Jul 2012 09:21:24 +0200 (CEST) From: Maxime Ripard To: buildroot@busybox.net Date: Sat, 28 Jul 2012 09:21:20 +0200 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 1/3] 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 Acked-by: Arnout Vandecappelle (Essensium/Mind) --- package/busybox/busybox.mk | 7 +++++++ package/pkg-generic.mk | 8 ++++++++ target/generic/Config.in | 25 +++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk index 394a1ae..17ee50a 100644 --- a/package/busybox/busybox.mk +++ b/package/busybox/busybox.mk @@ -134,6 +134,12 @@ define BUSYBOX_DISABLE_MMU_APPLETS endef endif +ifeq ($(BR2_INIT_BUSYBOX),y) +define BUSYBOX_SET_INIT + $(call KCONFIG_ENABLE_OPT,CONFIG_INIT,$(BUSYBOX_BUILD_CONFIG)) +endef +endif + define BUSYBOX_INSTALL_LOGGING_SCRIPT if grep -q CONFIG_SYSLOGD=y $(@D)/.config; then \ [ -f $(TARGET_DIR)/etc/init.d/S01logging ] || \ @@ -168,6 +174,7 @@ define BUSYBOX_CONFIGURE_CMDS $(BUSYBOX_NETKITTELNET) $(BUSYBOX_INTERNAL_SHADOW_PASSWORDS) $(BUSYBOX_DISABLE_MMU_APPLETS) + $(BUSYBOX_SET_INIT) $(BUSYBOX_SET_WATCHDOG) @yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \ -C $(@D) oldconfig diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index d1f4f2a..68d23ba 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -133,6 +133,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 $@ @@ -151,6 +155,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/target/generic/Config.in b/target/generic/Config.in index 88f0718..309ef55 100644 --- a/target/generic/Config.in +++ b/target/generic/Config.in @@ -37,6 +37,31 @@ comment "udev requires a toolchain with LARGEFILE + WCHAR support" endchoice +choice + prompt "Init system" + default BR2_INIT_BUSYBOX + +config BR2_INIT_BUSYBOX + bool "Busybox" + select BR2_PACKAGE_BUSYBOX + +config BR2_INIT_SYSV + bool "systemV" + select BR2_PACKAGE_SYSVINIT + +config BR2_INIT_SYSTEMD + bool "systemd" + depends on BR2_LARGEFILE + depends on BR2_USE_WCHAR + depends on BR2_INET_IPV6 + select BR2_PACKAGE_DBUS + 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"