From patchwork Wed Jan 16 21:51:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1026231 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N7LBDI6X"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43g10T0x23z9sDr for ; Thu, 17 Jan 2019 08:43:04 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 043CE25AE2; Wed, 16 Jan 2019 21:43:03 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id S7fJb+RgFVGg; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id CEA64254EB; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 22EA71BF2EF for ; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2016C878A8 for ; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1xSQ5ekUthOJ for ; Wed, 16 Jan 2019 21:42:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by hemlock.osuosl.org (Postfix) with ESMTPS id 870A287852 for ; Wed, 16 Jan 2019 21:42:59 +0000 (UTC) Received: by mail-lj1-f171.google.com with SMTP id l15-v6so6747122lja.9 for ; Wed, 16 Jan 2019 13:42:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=M8pyY0nihz0sOh1PZJ0Pn9WkeRCH1/UYlTpRoRn1ua8=; b=N7LBDI6XeRbgBmusKc9AJexhHF7QyCPcN2E1swfxTjEUSKsG87EguTwfHzrMNXj11P xK6Pr519z2LPwXB32mKyUEnq8pFrtJ1p02kRjqa8e/UxfYcwrTOejZ5A4UwhKSpbQSLA Be2vK4K9mLrF5yeZGuGWJCNArKgUe7E0310m0RPF8qNvIY9+++GQIeUEZuZJC9mPUdAX nGPFBqC8Yzwmk/EdCrWkUExUERHR/h8uwXeZI5SFBrTXUJ07oN6/w3NNZ6jWjfIUF1Hs T4eTXHpwf0hN5jEeCiht6bJ5NGQhxjkTZ5/HtmStVJVj3ArR1wb/jRi5ubV2irEPvTzr yERQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=M8pyY0nihz0sOh1PZJ0Pn9WkeRCH1/UYlTpRoRn1ua8=; b=bt8a4ESdMonOO/JuVqQa+e6dMEVXO+RqBOPzzNCVnYYNtJ4AOOiSy53dGEhWmxYKuW Cvi5lB4BqZmmpQU5B8SSA4JXwODJyBrglCrN1XpY4/Xa+XSzk8QpBlvrcS7XYxrPylkz 9utS0iBdf3omCAtqfLKmJdg8TwJ+YFitEapkNBwjc7aZleSFlNVMsj77bT1D2Nl6ULEb i/9W/pyxUg6K99zoYp+Tic/KePk+DhhgUU9kEb6rqRv6SorOBw8B8+snw/moAcKQf2je STMDYrDeHkaQmdxyXT2ihgxQWZANwRpaRKQpHLy5JNjPOZQswFrxeaICQoHNKphalcJt Bwiw== X-Gm-Message-State: AJcUukcPCrXYSuVStTKUyGXWBgdxfLlZn2K25fWUBOlleRWgJnnyYHo8 +lnxofyzG5/ukIiw+QyG9eFSUFNu X-Google-Smtp-Source: ALg8bN7V8yOlTkb0g0kUReyPyKXm0QYakLRxdq/6PA76dC7QfoSwe2gPI5zmc4qrfJGMDO7hgpdjSw== X-Received: by 2002:a2e:908b:: with SMTP id l11-v6mr8031278ljg.150.1547674977122; Wed, 16 Jan 2019 13:42:57 -0800 (PST) Received: from vkochan-ThinkPad-T470p.lan ([213.109.80.185]) by smtp.gmail.com with ESMTPSA id p67sm1393016lfe.14.2019.01.16.13.42.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 13:42:56 -0800 (PST) From: Vadim Kochan To: buildroot@buildroot.org Date: Wed, 16 Jan 2019 23:51:33 +0200 Message-Id: <20190116215135.32142-2-vadim4j@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190116215135.32142-1-vadim4j@gmail.com> References: <20190116215135.32142-1-vadim4j@gmail.com> Subject: [Buildroot] [RFC 1/3] package/s6-linux-init: Build also for the host X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Le Bihan , Vadim Kochan MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add strict dependency for host-s6-linux-init to use s6-linux-init-maker on the host during the rootfs generation. Signed-off-by: Vadim Kochan --- package/s6-linux-init/s6-linux-init.mk | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/package/s6-linux-init/s6-linux-init.mk b/package/s6-linux-init/s6-linux-init.mk index d25504ae5a..913f837c1f 100644 --- a/package/s6-linux-init/s6-linux-init.mk +++ b/package/s6-linux-init/s6-linux-init.mk @@ -8,7 +8,7 @@ S6_LINUX_INIT_VERSION = 0.4.0.0 S6_LINUX_INIT_SITE = http://skarnet.org/software/s6-linux-init S6_LINUX_INIT_LICENSE = ISC S6_LINUX_INIT_LICENSE_FILES = COPYING -S6_LINUX_INIT_DEPENDENCIES = s6 s6-linux-utils s6-portable-utils +S6_LINUX_INIT_DEPENDENCIES = s6 s6-linux-utils s6-portable-utils host-s6-linux-init S6_LINUX_INIT_CONF_OPTS = \ --prefix=/usr \ @@ -33,4 +33,31 @@ define S6_LINUX_INIT_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install endef +HOST_S6_LINUX_INIT_DEPENDENCIES = host-s6 + +HOST_S6_LINUX_INIT_CONF_OPTS = \ + --prefix=$(HOST_DIR) \ + --with-sysdeps=$(HOST_DIR)/usr/lib/skalibs/sysdeps \ + --with-include=$(HOST_DIR)/usr/include \ + --with-dynlib=$(HOST_DIR)/usr/lib \ + --with-lib=$(HOST_DIR)/usr/lib/execline \ + --with-lib=$(HOST_DIR)/usr/lib/s6 \ + --with-lib=$(HOST_DIR)/usr/lib/skalibs \ + --disable-static \ + --enable-shared \ + --disable-allstatic + +define HOST_S6_LINUX_INIT_CONFIGURE_CMDS + (cd $(@D); $(HOST_CONFIGURE_OPTS) ./configure $(HOST_S6_LINUX_INIT_CONF_OPTS)) +endef + +define HOST_S6_LINUX_INIT_BUILD_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) +endef + +define HOST_S6_LINUX_INIT_INSTALL_CMDS + $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install +endef + $(eval $(generic-package)) +$(eval $(host-generic-package)) From patchwork Wed Jan 16 21:51:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1026233 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="vAYUn5ck"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43g10Z2pZ4z9sCh for ; Thu, 17 Jan 2019 08:43:10 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BF2A525935; Wed, 16 Jan 2019 21:43:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mq+5aPeXcDxc; Wed, 16 Jan 2019 21:43:04 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 8D77D25AA6; Wed, 16 Jan 2019 21:43:04 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id BF47B1BF2EF for ; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id BC87785F43 for ; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Nx_T5xGbxl4i for ; Wed, 16 Jan 2019 21:43:00 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5169185C4A for ; Wed, 16 Jan 2019 21:43:00 +0000 (UTC) Received: by mail-lj1-f174.google.com with SMTP id l15-v6so6747157lja.9 for ; Wed, 16 Jan 2019 13:43:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9pH8pRFrdl2CzlMya4OPmkjTnxlO2B/vR+Soq4rpMVI=; b=vAYUn5cklQ7RYzbHCBzTlCenMYStnXgA4kieWvDhECL9VV1GzIoPIelvO5v1HuUN7x ypny0Y/dg1BQMu2CrnRWRe2qUM3Nk7CmfYvRpC5AA06DQoD3xXFp9GsQf1pHuGiH77NM HEMPmuxE4b5voeJuebwqkK87jWIgY4EoIhkp82oh97HmoxyppEjQQ0vNWLnh9zWZqfCs aCssm2qEizPctuxOp9kcgYFW2J2NslvBwwbpUFd7MEOTheYowVjoHP5TSU3MyCI7uw7H FSGfx2gE1pIFPdbTH/XNyr2arjT9vrMgzKBbhLRFP1xbxtBeLCRw5wVIXuu/JVDiMLK8 mImQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9pH8pRFrdl2CzlMya4OPmkjTnxlO2B/vR+Soq4rpMVI=; b=SiZkAWXjLG+tc2XTbMTbfRQCzUNqExdm/eUeu3CJQu8hPeLoa65IEHkqesjzHoYdwP n670lKEvJQltbchzwL2JYMBPlGts5tfc35rmKdJSkjgvMLXxRoaI25o0W9PoRP/59fJ+ LTYEvDNpAcX/r7hfREHPKH7xf8XDljJDeDBRFGWZORxxUguuM1BMiSv+MGTEcIznnRJd 80qQLpjLSX9phGUfObD14GCUhZXEaN1KqmZfAcFN6elQgl/Q75PFwduiBNd8yMOscxZB SUyuk7DSeuMjQv3jPGda3W3mXKtJIXkOUotxcnReR/LmwdjBZBO/hXrylaHHaXGH9nte SUPw== X-Gm-Message-State: AJcUukf9XKKwg1riLbORQadIDT43fLZxUROwxgAuX+emt+tzl5VzI2WZ dfNQ2WP+xGTOTHLzNnZ9uIT6C8AG X-Google-Smtp-Source: ALg8bN7puyFFkpXmF43dEaxHQ8gKVXasiLE8rUOk0FGB+OSQu51WuTUwPYkEJc5M5lbQqOTyYkeFBA== X-Received: by 2002:a2e:3603:: with SMTP id d3-v6mr7733488lja.46.1547674978176; Wed, 16 Jan 2019 13:42:58 -0800 (PST) Received: from vkochan-ThinkPad-T470p.lan ([213.109.80.185]) by smtp.gmail.com with ESMTPSA id p67sm1393016lfe.14.2019.01.16.13.42.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 13:42:57 -0800 (PST) From: Vadim Kochan To: buildroot@buildroot.org Date: Wed, 16 Jan 2019 23:51:34 +0200 Message-Id: <20190116215135.32142-3-vadim4j@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190116215135.32142-1-vadim4j@gmail.com> References: <20190116215135.32142-1-vadim4j@gmail.com> Subject: [Buildroot] [RFC 2/3] package/s6-linux-init: Allow to install as init system X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Le Bihan , Vadim Kochan MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Add BR2_INIT_S6 option which allows to install minimal init support by s6-linux-init-maker into /etc/s6 and link /sbin/init to it. Also 2 additional files /etc/rc.init and /etc/rc.shutdown are generated as dummy "execline'd" scripts which are triggered by /etc/s6/init. Consider generic tty option support and generate getty service if needed by s6-linux-init-maker. Signed-off-by: Vadim Kochan --- package/s6-linux-init/s6-linux-init.mk | 40 ++++++++++++++++++++++++++++++++++ system/Config.in | 9 ++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/package/s6-linux-init/s6-linux-init.mk b/package/s6-linux-init/s6-linux-init.mk index 913f837c1f..c298d62477 100644 --- a/package/s6-linux-init/s6-linux-init.mk +++ b/package/s6-linux-init/s6-linux-init.mk @@ -33,6 +33,46 @@ define S6_LINUX_INIT_INSTALL_TARGET_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(TARGET_DIR) install endef +ifeq ($(BR2_INIT_S6),y) + +# Don't let Busybox to install it's own tools like poweroff, reboot, halt, etc +S6_LINUX_INIT_DEPENDENCIES += $(if $(BR2_PACKAGE_BUSYBOX),busybox) + +S6_LINUX_INIT_MAKER_OPTS = -b /usr/bin -c /etc/s6 + +ifeq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y) +S6_LINUX_INIT_MAKER_OPTS += -d 0 +else +S6_LINUX_INIT_MAKER_OPTS += $(if $(BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_DEVTMPFS),,-d 1) +endif + +ifeq ($(BR2_TARGET_GENERIC_GETTY),y) +S6_LINUX_INIT_MAKER_OPTS += -G "/sbin/getty -L \ + $(SYSTEM_GETTY_OPTIONS) \ + $(SYSTEM_GETTY_PORT) \ + $(SYSTEM_GETTY_BAUDRATE) \ + $(SYSTEM_GETTY_TERM)" +endif + +define S6_LINUX_INIT_INSTALL_INIT + ln -sf ../etc/s6/init $(TARGET_DIR)/sbin/init + + ln -sf /usr/bin/s6-reboot $(TARGET_DIR)/sbin/reboot + ln -sf /usr/bin/s6-poweroff $(TARGET_DIR)/sbin/poweroff + ln -sf /usr/bin/s6-halt $(TARGET_DIR)/sbin/halt + + echo "#! /usr/bin/execlineb -P" > $(@D)/rc.init + $(INSTALL) -m 0755 $(@D)/rc.init $(TARGET_DIR)/etc/rc.init + echo "#! /usr/bin/execlineb -P" > $(@D)/rc.shutdown + $(INSTALL) -m 0755 $(@D)/rc.shutdown $(TARGET_DIR)/etc/rc.shutdown + + rm -rf $(TARGET_DIR)/etc/s6 + $(HOST_DIR)/bin/s6-linux-init-maker $(S6_LINUX_INIT_MAKER_OPTS) $(TARGET_DIR)/etc/s6 +endef +S6_LINUX_INIT_POST_INSTALL_TARGET_HOOKS += S6_LINUX_INIT_INSTALL_INIT + +endif # BR2_INIT_S6 + HOST_S6_LINUX_INIT_DEPENDENCIES = host-s6 HOST_S6_LINUX_INIT_CONF_OPTS = \ diff --git a/system/Config.in b/system/Config.in index 9941807e5d..5bab283931 100644 --- a/system/Config.in +++ b/system/Config.in @@ -12,6 +12,7 @@ config BR2_ROOTFS_SKELETON_DEFAULT select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_INIT_SYSV select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_INIT_BUSYBOX select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_INIT_SYSTEMD + select BR2_PACKAGE_SKELETON_INIT_COMMON if BR2_INIT_S6 select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_INIT_NONE help Use default target skeleton @@ -124,6 +125,10 @@ comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10" !BR2_TOOLCHAIN_HAS_SSP || \ !BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_10 +config BR2_INIT_S6 + bool "s6" + select BR2_PACKAGE_S6_LINUX_INIT + config BR2_INIT_NONE bool "None" help @@ -342,7 +347,7 @@ config BR2_TARGET_GENERIC_GETTY_TERM string "TERM environment variable" default "vt100" # currently observed only by busybox and sysvinit - depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV + depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV || BR2_INIT_S6 help Specify a TERM type. @@ -350,7 +355,7 @@ config BR2_TARGET_GENERIC_GETTY_OPTIONS string "other options to pass to getty" default "" # currently observed only by busybox and sysvinit - depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV + depends on BR2_INIT_BUSYBOX || BR2_INIT_SYSV || BR2_INIT_S6 help Any other flags you want to pass to getty, Refer to getty --help for details. From patchwork Wed Jan 16 21:51:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadym Kochan X-Patchwork-Id: 1026232 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AF0yWtqx"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43g10X4dlzz9sCh for ; Thu, 17 Jan 2019 08:43:08 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3620F86BBD; Wed, 16 Jan 2019 21:43:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Rov6eMjwo+e0; Wed, 16 Jan 2019 21:43:06 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 5813786BB9; Wed, 16 Jan 2019 21:43:06 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 2D0D81BF2EF for ; Wed, 16 Jan 2019 21:43:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 2A77987877 for ; Wed, 16 Jan 2019 21:43:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UoZ3xpTth9im for ; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by hemlock.osuosl.org (Postfix) with ESMTPS id 62E3F87852 for ; Wed, 16 Jan 2019 21:43:01 +0000 (UTC) Received: by mail-lf1-f66.google.com with SMTP id y14so6100598lfg.13 for ; Wed, 16 Jan 2019 13:43:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6Mo1F8aDnE9FHFhaqFtGlxkxxqcvAK68Auf007ohrfw=; b=AF0yWtqxv6KRsgRJdVbTm4QB1yFhY6TPzWoW8lqoDN2TEWnPuyx69RE4Q+dNthMWPB p00d8McAd5zRWjBbYOwub0XTY9DCzNXog8HCt0I6LzzKf8cujCxaRUKWo1qhx1MuWjTC 3Y19ZUwe7UfYzOXEDRS2BxEcXldupRSj5zsAPhEFu602VFZt6MgMqvSdlRVyjquYbCa7 OJaplQ6vLN9jP/jS9byAZW9DNRhJvzCAP0bH75O+Ft0zjkKBi6QvdErhKvt6dqtNQ0OO JAFrkqlHGoTKjk7nr3CEAPkiSNwowqA+9dhhBF+1MnuQincw/VDqGDCUofU54JkbWfws YDRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6Mo1F8aDnE9FHFhaqFtGlxkxxqcvAK68Auf007ohrfw=; b=UhcFErCBUnmU9TqWu3F8qF0W7njsiRevnsH5TJqRQmU8wVZxfg8hkkE/q7NPuapgfs Fy6HIaKwn3XtIpyRfdWdXcgcwpEYaDVieEJrAARQ6scyXeyBPofRBlL8jmIamAzOqET6 a7SceGpTR1d64sFcE7WEAu/ybpejGCwVz4ILqZhBFpmYxBIuk6sdpyqy0auO4IW+QeXZ Ca5tqz8ag8kSB8iWA0kf/Ju+VE+eDLnbaF/i94TS7KKLOrVLLjxL7MZfmbgX+Ihp1ECi F1RX2n0NkgQZatrRF5lsLb/4gk2JovbqPdW7r0tJ6ZPbWmj186P6TfLry5eEaTy2UG0P NYfQ== X-Gm-Message-State: AJcUukcA2WvIZGBsKTbKdPypPriqnLsp1sQti2z6xh+of81hm4mruMHR 2+BJym6ZQZi2pXkJfpBH+q+/qY/k X-Google-Smtp-Source: ALg8bN5S/B9M4mFibshygMhvpf5axJI8GSvCG/h6msHVV6XYJ6Y8asugs1X7q4bj8vHxpi6XFry5sQ== X-Received: by 2002:a19:945b:: with SMTP id w88mr7986236lfd.15.1547674979303; Wed, 16 Jan 2019 13:42:59 -0800 (PST) Received: from vkochan-ThinkPad-T470p.lan ([213.109.80.185]) by smtp.gmail.com with ESMTPSA id p67sm1393016lfe.14.2019.01.16.13.42.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 13:42:58 -0800 (PST) From: Vadim Kochan To: buildroot@buildroot.org Date: Wed, 16 Jan 2019 23:51:35 +0200 Message-Id: <20190116215135.32142-4-vadim4j@gmail.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20190116215135.32142-1-vadim4j@gmail.com> References: <20190116215135.32142-1-vadim4j@gmail.com> Subject: [Buildroot] [RFC 3/3] package/s6-rc: Allow to integrate s6-rc services X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eric Le Bihan , Vadim Kochan MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" It allows to install s6-rc services by board or package into /etc/s6-rc/service which will be compiled as s6-rc db as /etc/s6-rc/compiled-initial. Services are compiled on stage when rootfs overlay & post-build already performed. Added rc.init & rc.shutdown scripts which are needed to run s6-rc services. This is very basic s6-rc system support which even does not have the basic stuff like /proc /sys /dev setup, but this might be added in future work. All above is only possible if BR2_INIT_S6 is selected. Signed-off-by: Vadim Kochan --- package/s6-rc/rc.init | 4 ++++ package/s6-rc/rc.shutdown | 3 +++ package/s6-rc/s6-rc.mk | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 package/s6-rc/rc.init create mode 100644 package/s6-rc/rc.shutdown diff --git a/package/s6-rc/rc.init b/package/s6-rc/rc.init new file mode 100644 index 0000000000..6709c6488b --- /dev/null +++ b/package/s6-rc/rc.init @@ -0,0 +1,4 @@ +#! /usr/bin/execlineb -P + +if { s6-rc-init /run/service } +if { s6-rc -t 600000 -- change default } diff --git a/package/s6-rc/rc.shutdown b/package/s6-rc/rc.shutdown new file mode 100644 index 0000000000..58d49b5cfd --- /dev/null +++ b/package/s6-rc/rc.shutdown @@ -0,0 +1,3 @@ +#! /usr/bin/execlineb -P + +s6-rc -da change diff --git a/package/s6-rc/s6-rc.mk b/package/s6-rc/s6-rc.mk index 222ba139c6..007e7d9e1b 100644 --- a/package/s6-rc/s6-rc.mk +++ b/package/s6-rc/s6-rc.mk @@ -11,6 +11,13 @@ S6_RC_LICENSE_FILES = COPYING S6_RC_INSTALL_STAGING = YES S6_RC_DEPENDENCIES = s6 +ifeq ($(BR2_INIT_S6),y) +# Needs s6-rc-compile to create initial rc db, also +# build after s6-linux-init to rewrite rc.init for run +# s6-rc services. +S6_RC_DEPENDENCIES += host-s6-rc s6-linux-init +endif + S6_RC_CONF_OPTS = \ --prefix=/usr \ --with-sysdeps=$(STAGING_DIR)/usr/lib/skalibs/sysdeps \ @@ -44,6 +51,31 @@ define S6_RC_INSTALL_STAGING_CMDS $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) DESTDIR=$(STAGING_DIR) install endef +ifeq ($(BR2_INIT_S6),y) + +define S6_RC_PREPARE_INIT_RC + mkdir -p $(TARGET_DIR)/etc/s6-rc/service/default + echo bundle > $(TARGET_DIR)/etc/s6-rc/service/default/type + touch $(TARGET_DIR)/etc/s6-rc/service/default/contents + + mkdir -p $(TARGET_DIR)/etc/s6-rc/compiled-initial + ln -sf compiled-initial $(TARGET_DIR)/etc/s6-rc/compiled + + $(INSTALL) -m 0755 $(S6_RC_PKGDIR)/rc.init $(TARGET_DIR)/etc/rc.init + $(INSTALL) -m 0755 $(S6_RC_PKGDIR)/rc.shutdown $(TARGET_DIR)/etc/rc.shutdown +endef +S6_RC_POST_INSTALL_TARGET_HOOKS += S6_RC_PREPARE_INIT_RC + +define S6_RC_FINALIZE_INIT_RC + rm -rf $(TARGET_DIR)/etc/s6-rc/compiled-initial + $(HOST_DIR)/bin/s6-rc-compile -v 1 \ + $(TARGET_DIR)/etc/s6-rc/compiled-initial \ + $(TARGET_DIR)/etc/s6-rc/service +endef +S6_RC_ROOTFS_PRE_CMD_HOOKS += S6_RC_FINALIZE_INIT_RC + +endif # BR2_INIT_S6 + HOST_S6_RC_DEPENDENCIES = host-s6 HOST_S6_RC_CONF_OPTS = \