From patchwork Tue Oct 13 19:41:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1381701 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=rockwellcollins.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=M++7IeBf; 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 4C9mCV0d5Jz9sVH for ; Wed, 14 Oct 2020 06:42:14 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id BBBA287D67; Tue, 13 Oct 2020 19:42:11 +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 RXpASTwBrbDg; Tue, 13 Oct 2020 19:42:08 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 928A087D5E; Tue, 13 Oct 2020 19:42:08 +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 8AB0D1BF868 for ; Tue, 13 Oct 2020 19:42:07 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 878EE875D9 for ; Tue, 13 Oct 2020 19:42:07 +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 cTjVSK16ATsy for ; Tue, 13 Oct 2020 19:42:06 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs03.rockwellcollins.com (da1vs03.rockwellcollins.com [205.175.227.47]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 971D2874D2 for ; Tue, 13 Oct 2020 19:42:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=m6G+o/b1J79kKtE8FuEoZx99ZyO6Yom+TeBdnb49a/I=; b=M++7IeBfiqwvfCha0BjXQFeOy9Uh90QNrwifGvSTJGewvoQMgI+MOM4/ TSvn1+PCQYNBviDdGi2CVDQ0b00IML+rPzDWeTEIQNFPMrDNz6C4iL6nj wZE6HzPcfOY7uNhnxtWgDLCP0+2s2CNKpnojqJzU0oJg9nOg2byI1id7s X6XkgbdQ5X9IAzbGMslwATPvDPmnjoLWA70TbHcJYRiEJ0rpx4vU6ki4y QTZAFYFg8+tkQ4sKtHGuM7/OfZJ2Y8kxUsmUuug4o0LbY61PhHKokJAje lUAGNFWTPVZhStZPCopzxhqHM4pegGj+QACQz6Y0v54qGsr9nSKkGDZqE w==; IronPort-SDR: EeMzZjwr/nQkAqHquxF3qwz9mL94YUTjg0GeC4OFWj0q1vMDltjP0mjihy01n3k3aD6LuSgivP /n6Y++AehNbaCUK3lbXfQjfb5WQhQRYwaJo80Am8UNCE23M/r/lGFEapCVUUdg1zweeiO7vvRO qq4A+THsj9yAg7pJkElZztVyy49fcYzxV6k5LECUyitclPKyxxg932al0p0ZIlKK2txYWJqRPB VvgxfEkW2eC0KBWJ41y2y4/PxMpGJVXGZlx22vXSqZ0Nbxw+E9AOrFabigqLCboKMmmxsxQg+t Pk4= Received: from ofwda1n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.227.14]) by da1vs03.rockwellcollins.com with ESMTP; 13 Oct 2020 14:42:06 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id 7310420052; Tue, 13 Oct 2020 14:42:05 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Tue, 13 Oct 2020 14:41:48 -0500 Message-Id: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] system: Move skeleton-init-* selection to init 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: Brandon Maier , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In preparation for supporting br2-external inits, move the 'select' for the BR2_PACKAGE_SKELETON_INIT_* to their respective init systems. This will allow a br2-external init to 'select' which skeleton it needs. Signed-off-by: Brandon Maier --- system/Config.in | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/system/Config.in b/system/Config.in index b8b7c16529..ec61fac781 100644 --- a/system/Config.in +++ b/system/Config.in @@ -1,21 +1,17 @@ menu "System configuration" -# Note: usually, it is not possible to select a provider of a virtual -# package. But here we have an exception: there are only four providers -# and they only get selected by separate entries in this choice and -# under different, exclusive conditions. So this is a safe situation. +# Note on package/skeleton: usually, it is not safe to 'select' a +# provider of a virtual package. But below we have an exception: each +# init system may select one of the virtual skeleton-init-* packages. As +# only one init system may be enabled, only one skeleton-init-* may be +# selected. So this is a safe situation. choice prompt "Root FS skeleton" config BR2_ROOTFS_SKELETON_DEFAULT bool "default target skeleton" - 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_OPENRC if BR2_INIT_OPENRC - select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_INIT_SYSTEMD - select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_INIT_NONE help - Use default target skeleton + Use default target skeleton for selected init system. config BR2_ROOTFS_SKELETON_CUSTOM bool "custom target skeleton" @@ -91,6 +87,7 @@ config BR2_INIT_BUSYBOX bool "BusyBox" select BR2_PACKAGE_BUSYBOX select BR2_PACKAGE_INITSCRIPTS + select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_ROOTFS_SKELETON_DEFAULT config BR2_INIT_SYSV bool "systemV" @@ -98,12 +95,14 @@ config BR2_INIT_SYSV select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # sysvinit select BR2_PACKAGE_INITSCRIPTS select BR2_PACKAGE_SYSVINIT + select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_ROOTFS_SKELETON_DEFAULT config BR2_INIT_OPENRC bool "OpenRC" depends on BR2_USE_MMU depends on !BR2_STATIC_LIBS select BR2_PACKAGE_OPENRC + select BR2_PACKAGE_SKELETON_INIT_OPENRC if BR2_ROOTFS_SKELETON_DEFAULT comment "openrc needs a toolchain w/ dynamic library" depends on BR2_USE_MMU @@ -126,6 +125,7 @@ config BR2_INIT_SYSTEMD depends on BR2_HOST_GCC_AT_LEAST_5 select BR2_ROOTFS_MERGED_USR select BR2_PACKAGE_SYSTEMD + select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_ROOTFS_SKELETON_DEFAULT comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10, host and target gcc >= 5" depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS @@ -138,6 +138,7 @@ comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10, host and targe config BR2_INIT_NONE bool "None" + select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT help Buildroot will not install any init system. You will have to provide your own, either with a new package From patchwork Tue Oct 13 19:41:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1381702 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=rockwellcollins.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=dy3bbTNV; 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 4C9mCX3BqHz9sTK for ; Wed, 14 Oct 2020 06:42:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2F0502E38B; Tue, 13 Oct 2020 19:42:14 +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 bENv0NlZICk8; Tue, 13 Oct 2020 19:42:10 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 93C7D2E429; Tue, 13 Oct 2020 19:42:10 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id A6BBD1BF868 for ; Tue, 13 Oct 2020 19:42:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A377F87D4C for ; Tue, 13 Oct 2020 19:42:09 +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 4g66gz8h+HvJ for ; Tue, 13 Oct 2020 19:42:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs04.rockwellcollins.com (ch3vs04.rockwellcollins.com [205.175.226.52]) by whitealder.osuosl.org (Postfix) with ESMTPS id 2C73387D4B for ; Tue, 13 Oct 2020 19:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ngmudTNxXj5KuMHTMmkWnAKI+cPubNxauP5h6aqtHgY=; b=dy3bbTNVxCBB97BhWjhLGYBrvJBOOdVGr2wD0owhjITLxZ6Kx+cNHELf +eWT29K97GgRkw3ETebLfbYCSOYJ+xEICzyYVX+louu/OfUmxvXCBnyDT 4xgCuEct2ffswHpd+KHH2vmTIIDLzL3TeZVP/DUs9+BGDJ2f8wSCKtF6Z 52VDi2QV7pUwit+45+UUakgCFOC8eBrOEknuzobJaJ5sa7GXc8dyQ9c+g Qpms09EJLvJrNxiGy0YTgUTBsawkGF7gT/SqVyrfxvGAvxVR0VxECD6P0 IsHiIsqOfJ4Cgqy5NaA7yKCfrpNnSgZijsuPXhHjUjSn08kLuCT9mZBHv g==; IronPort-SDR: Llnau4oDjkOyWjFeVi2ulsCTliclZAzCf6//6RTeP0Qcnmdl/Ut9/NOOfL7KA2QFOPsaBO0IvP IbnVkYLRlcD315NDw6IigJpd/+PxgycbAQF3vpFIz46Qf4sjGB6hOObsJOIHzY8X42Ij7LAX1g mTiiDwTUS1thx1QmcqZZuFV+/hxuypD9+jNI+ct2NvAXnMH+lIylSMQdGMct9XiHcz9jxPpHro FMlC/Ya2ISwV8VIiUPziX5jI9o5r5iEersQPX9z/PnKY0fwsyOA+pOXKdkUgbR1y1nq3Q6dZPf CtE= Received: from ofwch3n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.226.14]) by ch3vs04.rockwellcollins.com with ESMTP; 13 Oct 2020 14:42:06 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id A1DF92007E; Tue, 13 Oct 2020 14:42:05 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Tue, 13 Oct 2020 14:41:49 -0500 Message-Id: <20201013194149.171518-2-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> References: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] system: support br2-external init systems 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: Brandon Maier , yann.morin.1998@free.fr, thomas.petazzoni@bootlin.com Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Some externals may wish to provide custom init systems for tightly integrated boot. This has been supported through the BR2_INIT_NONE, however a downside to the BR2_INIT_NONE is it forces the custom init system to use either skeleton-custom and roll a custom skeleton for each target, or skeleton-init-none which isn't a complete skeleton. Allowing br2-external to define custom BR2_INIT_* means they can now safely 'select' the BR2_PACKAGE_SKELETON_INIT_* and use a sysv style skeleton if they want. Signed-off-by: Brandon Maier --- support/scripts/br2-external | 17 +++++++++++++++++ system/Config.in | 3 +++ 2 files changed, 20 insertions(+) diff --git a/support/scripts/br2-external b/support/scripts/br2-external index ededd2d900..f6ad722f72 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -161,6 +161,7 @@ do_kconfig() { toolchains jpeg openssl + init ) for br2 in "${items[@]}"; do @@ -224,7 +225,23 @@ do_kconfig() { else printf '# No openssl from: %s\n\n' "${br2_desc}" fi >>"${outputdir}/.br2-external.in.openssl" + + if [ -f "${br2_ext}/provides/init.in" ]; then + printf 'comment "init from: %s"\n' "${br2_desc}" + printf 'source "%s/provides/init.in"\n' "${br2_ext}" + printf '\n' + else + printf '# No init from: %s\n\n' "${br2_desc}" + fi >>"${outputdir}/.br2-external.in.init" done + if [ -f "${br2_ext}/provides/toolchains.in" ]; then + printf 'comment "Toolchains from: %s"\n' "${br2_desc}" + printf 'source "%s/provides/toolchains.in"\n' "${br2_ext}" + printf '\n' + else + printf '# No toolchain from: %s\n\n' "${br2_desc}" + fi >>"${outputdir}/.br2-external.in.toolchains" + printf 'endmenu\n' >>"${outputdir}/.br2-external.in.menus" } diff --git a/system/Config.in b/system/Config.in index ec61fac781..ff7a470561 100644 --- a/system/Config.in +++ b/system/Config.in @@ -144,6 +144,9 @@ config BR2_INIT_NONE have to provide your own, either with a new package or with a rootfs-overlay. +# Init systems from br2-external trees, if any +source "$BR2_BASE_DIR/.br2-external.in.init" + endchoice choice From patchwork Tue Oct 13 22:36:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1381742 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=rockwellcollins.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=t8peAjfK; 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 4C9r5447Qlz9sVH for ; Wed, 14 Oct 2020 09:36:56 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1C0352E1FB; Tue, 13 Oct 2020 22:36:55 +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 Hu-jtz0cYShQ; Tue, 13 Oct 2020 22:36:43 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 057E52E206; Tue, 13 Oct 2020 22:36:40 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 2291F1BF5A5 for ; Tue, 13 Oct 2020 22:36:34 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 1399C2E1E1 for ; Tue, 13 Oct 2020 22:36:34 +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 GvOUjhIOWruw for ; Tue, 13 Oct 2020 22:36:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from secvs05.rockwellcollins.com (secvs05.rockwellcollins.com [205.175.225.131]) by silver.osuosl.org (Postfix) with ESMTPS id 02A8D2E1F3 for ; Tue, 13 Oct 2020 22:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=E1EGkFb1890e2fzfQWxyBy+mBqmuKXVhG90Gr5omaMs=; b=t8peAjfKfyV9dfoKIeAg8cSjWOuFTxO/EqSWfSvy3c05tV3BWiT1/QoL TUw3800ZMjplYAGZ/AfX6rJIYXJDOpRWj/vKtdQTXCu0rpF/gNtkVJcxR 0n8IEg3N9EDzOcW+wBxM6Sjut1aqdLXwVLsVcuLFhq9A8/SDFFvbXrebn CUP0IM/EuT2E0H6/sfi6feVODiV9mJ4vgcOMuh+hcLzMHz4B53aGL1wwP vT2OYETees9uaenZkFi7xu1ssodrjoDwx4jshf9eVhXCbdd4WajmAQwRS 6Xh7u0Hts/9eL4/eZGKA4vMObzNq11yKsGC2N8d7N6PIvQvoM6VahONdb A==; IronPort-SDR: hVxScrOg40pFkoVNuh7B1/Z8EWvFmnd6t7UuCiai1D1WEWd7hXjA6ylFmP6f5bwHHaB0Bo7WZw tjvdhtI367CFSccE3u7fv51oyWUehAwZr7LaITlAD4eCzb8zaZnBTdTtgnIdSiENju1ArGYeRp bTJELi+E97nSJGlEDmfNaF22yUuh3pBjC1Fl4QVCRkNCqLd7R2nA3aMTo86xJz4O7SgMVC7mSS 0PNHu/o2iGRSSvlqAsscJzjy9KeOsX7Q2usAZkP8rfWrJz+0wAITRmN/kdNY4dH4ZTENMGrVPQ uZo= Received: from ofwgwc03.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.225.12]) by secvs05.rockwellcollins.com with ESMTP; 13 Oct 2020 17:36:27 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id 16E792007E; Tue, 13 Oct 2020 17:36:27 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Tue, 13 Oct 2020 17:36:03 -0500 Message-Id: <20201013223605.188920-3-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> References: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 3/5] system: Move skeleton-init-* selection to init 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: thomas.petazzoni@bootlin.com, Brandon Maier , yann.morin.1998@free.fr, Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In preparation for supporting br2-external inits, move the 'select' for the BR2_PACKAGE_SKELETON_INIT_* to their respective init systems. This will allow a br2-external init to 'select' which skeleton it needs. Signed-off-by: Brandon Maier --- system/Config.in | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/system/Config.in b/system/Config.in index a363e099e5..f062e5be93 100644 --- a/system/Config.in +++ b/system/Config.in @@ -1,21 +1,17 @@ menu "System configuration" -# Note: usually, it is not possible to select a provider of a virtual -# package. But here we have an exception: there are only four providers -# and they only get selected by separate entries in this choice and -# under different, exclusive conditions. So this is a safe situation. +# Note on package/skeleton: usually, it is not safe to 'select' a +# provider of a virtual package. But below we have an exception: each +# init system may select one of the virtual skeleton-init-* packages. As +# only one init system may be enabled, only one skeleton-init-* may be +# selected. So this is a safe situation. choice prompt "Root FS skeleton" config BR2_ROOTFS_SKELETON_DEFAULT bool "default target skeleton" - 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_OPENRC if BR2_INIT_OPENRC - select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_INIT_SYSTEMD - select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_INIT_NONE help - Use default target skeleton + Use default target skeleton for selected init system. config BR2_ROOTFS_SKELETON_CUSTOM bool "custom target skeleton" @@ -94,6 +90,7 @@ config BR2_INIT_BUSYBOX bool "BusyBox" select BR2_PACKAGE_BUSYBOX select BR2_PACKAGE_INITSCRIPTS + select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_ROOTFS_SKELETON_DEFAULT config BR2_INIT_SYSV bool "systemV" @@ -101,12 +98,14 @@ config BR2_INIT_SYSV select BR2_PACKAGE_BUSYBOX_SHOW_OTHERS # sysvinit select BR2_PACKAGE_INITSCRIPTS select BR2_PACKAGE_SYSVINIT + select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_ROOTFS_SKELETON_DEFAULT config BR2_INIT_OPENRC bool "OpenRC" depends on BR2_USE_MMU depends on !BR2_STATIC_LIBS select BR2_PACKAGE_OPENRC + select BR2_PACKAGE_SKELETON_INIT_OPENRC if BR2_ROOTFS_SKELETON_DEFAULT comment "openrc needs a toolchain w/ dynamic library" depends on BR2_USE_MMU @@ -129,6 +128,7 @@ config BR2_INIT_SYSTEMD depends on BR2_HOST_GCC_AT_LEAST_5 select BR2_ROOTFS_MERGED_USR select BR2_PACKAGE_SYSTEMD + select BR2_PACKAGE_SKELETON_INIT_SYSTEMD if BR2_ROOTFS_SKELETON_DEFAULT comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10, host and target gcc >= 5" depends on BR2_PACKAGE_SYSTEMD_ARCH_SUPPORTS @@ -141,6 +141,7 @@ comment "systemd needs a glibc toolchain w/ SSP, headers >= 3.10, host and targe config BR2_INIT_NONE bool "None" + select BR2_PACKAGE_SKELETON_INIT_NONE if BR2_ROOTFS_SKELETON_DEFAULT help Buildroot will not install any init system. You will have to provide your own, either with a new package From patchwork Tue Oct 13 22:36:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1381737 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=rockwellcollins.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=uCAiWMUG; 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 4C9r4g0tgPz9ryj for ; Wed, 14 Oct 2020 09:36:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3E72287842; Tue, 13 Oct 2020 22:36:31 +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 IgsvzKt8CI76; Tue, 13 Oct 2020 22:36:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 282F087443; Tue, 13 Oct 2020 22:36:30 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0CF421BF5A5 for ; Tue, 13 Oct 2020 22:36:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 09D8487443 for ; Tue, 13 Oct 2020 22:36:29 +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 lYtgSFWgzVdU for ; Tue, 13 Oct 2020 22:36:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from ch3vs04.rockwellcollins.com (ch3vs04.rockwellcollins.com [205.175.226.52]) by whitealder.osuosl.org (Postfix) with ESMTPS id 0FC8D87429 for ; Tue, 13 Oct 2020 22:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=VB9MeJfQihTIgRzCcdr+25Ygzx2gcANKNVxUTwML3vY=; b=uCAiWMUGaXGqJ49oA37KBwQdrBeagaZ2tyeoP9FkV6yA5CeibgpginHn v48/cTERLyLqLj8TQLqcNBPT6sCDQvbPsr2C+kwVlztCNWGmJq7/oDxPY byGCFg654fOt0eW0OaceHypIcHir0E3wNzpQOxcIclMYgCPoFJCGpdG7R uB+Y8nUFZaOih1tymPAfADIPOfN38rEdp64qRgBJlU4y2HAjU93ctCOtU kFDCqGY6pHRfDpY80Dr27m4L8rXwJgBNK6Zrn6dmqBvi4BOKnZVPDrkuf j0tWetkLebC5F3ONXbh0SDF+FQ6iHFS+i9bPvfAd0tVbdmzQfKqVatojx w==; IronPort-SDR: K8Tz5A20gGkv8fl+Lp6cG/tbvr0XyPVjwNiioSiL2L7172r93txVEF06AhHDJ1W75+JrgsB2CA mUGwrxrN/gtTUsdRR2jdGmbX7vpH9B+9Yx81XCVxubhLzJZJKgmmngGgj7Zv5KU3JZvLMt1CJ6 1bljBdZBI/tToCc8mDpz2rhCxYroHq8Yn1IuWiHOi+FkepcLzccCjD3bhQZLePzHRQiBacVhC9 m/wm5rYO16qhdzpWBzJgaABgYFRrf3FlwAVTfC3H+41asKHDfZACC9sfyHmHu1SxBDu8NQasWa LWQ= Received: from ofwch3n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.226.14]) by ch3vs04.rockwellcollins.com with ESMTP; 13 Oct 2020 17:36:28 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id 32D9720088; Tue, 13 Oct 2020 17:36:27 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Tue, 13 Oct 2020 17:36:04 -0500 Message-Id: <20201013223605.188920-4-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> References: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 4/5] system: support br2-external init systems 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: thomas.petazzoni@bootlin.com, Brandon Maier , yann.morin.1998@free.fr, Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Some externals may wish to provide custom init systems for tightly integrated boot. This has been supported through the BR2_INIT_NONE, however a downside to the BR2_INIT_NONE is it forces the custom init system to use either skeleton-custom and roll a custom skeleton for each target, or skeleton-init-none which isn't a complete skeleton. Allowing br2-external to define custom BR2_INIT_* means they can now safely 'select' the BR2_PACKAGE_SKELETON_INIT_* and use a sysv style skeleton if they want. Signed-off-by: Brandon Maier --- v2 - Remove bad code from a rebase --- support/scripts/br2-external | 9 +++++++++ system/Config.in | 3 +++ 2 files changed, 12 insertions(+) diff --git a/support/scripts/br2-external b/support/scripts/br2-external index 01804e1220..56dc6f53ca 100755 --- a/support/scripts/br2-external +++ b/support/scripts/br2-external @@ -162,6 +162,7 @@ do_kconfig() { jpeg openssl skeleton + init ) for br2 in "${items[@]}"; do @@ -233,6 +234,14 @@ do_kconfig() { else printf '# No skeleton from: %s\n\n' "${br2_desc}" fi >>"${outputdir}/.br2-external.in.skeleton" + + if [ -f "${br2_ext}/provides/init.in" ]; then + printf 'comment "init from: %s"\n' "${br2_desc}" + printf 'source "%s/provides/init.in"\n' "${br2_ext}" + printf '\n' + else + printf '# No init from: %s\n\n' "${br2_desc}" + fi >>"${outputdir}/.br2-external.in.init" done printf 'endmenu\n' >>"${outputdir}/.br2-external.in.menus" diff --git a/system/Config.in b/system/Config.in index f062e5be93..33abb9beb1 100644 --- a/system/Config.in +++ b/system/Config.in @@ -147,6 +147,9 @@ config BR2_INIT_NONE have to provide your own, either with a new package or with a rootfs-overlay. +# Init systems from br2-external trees, if any +source "$BR2_BASE_DIR/.br2-external.in.init" + endchoice choice From patchwork Tue Oct 13 22:36:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brandon Maier X-Patchwork-Id: 1381739 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=rockwellcollins.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rockwellcollins.com header.i=@rockwellcollins.com header.a=rsa-sha256 header.s=hrcrc2020 header.b=hDRRIIuB; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C9r4m47lfz9ryj for ; Wed, 14 Oct 2020 09:36:40 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id B6F5C8759B; Tue, 13 Oct 2020 22:36:34 +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 SXkrhhEjIUkB; Tue, 13 Oct 2020 22:36:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 253848759E; Tue, 13 Oct 2020 22:36:33 +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 997151BF5A5 for ; Tue, 13 Oct 2020 22:36:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 95B44875B3 for ; Tue, 13 Oct 2020 22:36:29 +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 iPUOnKWErqrM for ; Tue, 13 Oct 2020 22:36:28 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from da1vs03.rockwellcollins.com (da1vs03.rockwellcollins.com [205.175.227.47]) by fraxinus.osuosl.org (Postfix) with ESMTPS id B8AC5875A5 for ; Tue, 13 Oct 2020 22:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rockwellcollins.com; s=hrcrc2020; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8TwsXM9yzfvd7kwnlO/JhBuc37h/6bFcO3vAbY+mElE=; b=hDRRIIuB2mibll8+M+4ACb1fVRNzcy8KsszCQ+LWVTMyTSkoXP9Xb73S tHS8ehLHlDSbddQ9odSkxGqVanR30pc0V/+d4f/bm8COg9QNIXcp9M6sb WUs8341NhOkVuoGmKPYUoeHqyKnNX+dCZ1l0rLorPthecbgu/yO2sR8g2 VupEipoa41NBx1z/COp/ry2GJrKK8OkJK4k0doRFgy+OdENa5ak4w4OPE iWO5zngXYHRDAhMR1FUomKajoHMsF/inYkauF3yQdY3qz1FcSpWsjx2in QRVbA/7cNbEv7oozE+a2VAMNmQiCvTy5z0aganU3jucVHxHru7tuZ0uNQ g==; IronPort-SDR: P6gujn3hXTaPMcX/K+hRO5ybiB7xh3uV93+ZTGAGHjcPXBlTF0WusGYpZKd49SMQrbbfW4vzR3 oBgfV3HIsand2LWT79n54UGCaEIXDT6XexiVrZ6b4Pel9508wwcB7yba4fT5vw0cnv4O/uSPAJ eePnEHGcK0rHPtFGt2eV/FuMjsqObwjWMn7UFkUciwRK7anmDIVEXgX+6Oz340fiEG74wmVa/y P5kwtaEUZxmU74h+/ewBwDC/q2LLy22sC9EAf9OtbdEs64RykrSfRzqP5N53kBA4pvOFFuEAYX C3I= Received: from ofwda1n02.rockwellcollins.com (HELO ciulimr02.rockwellcollins.com) ([205.175.227.14]) by da1vs03.rockwellcollins.com with ESMTP; 13 Oct 2020 17:36:28 -0500 X-Received: from righttwix.rockwellcollins.com (righttwix.rockwellcollins.com [192.168.141.218]) by ciulimr02.rockwellcollins.com (Postfix) with ESMTP id 4E4AC20051; Tue, 13 Oct 2020 17:36:27 -0500 (CDT) From: Brandon Maier To: buildroot@buildroot.org Date: Tue, 13 Oct 2020 17:36:05 -0500 Message-Id: <20201013223605.188920-5-brandon.maier@rockwellcollins.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> References: <20201013194149.171518-1-brandon.maier@rockwellcollins.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2 5/5] docs/manual: add section about br2-external init 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: thomas.petazzoni@bootlin.com, Brandon Maier , yann.morin.1998@free.fr, Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Signed-off-by: Brandon Maier --- docs/manual/customize-outside-br.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt index c24516680c..59a01f278d 100644 --- a/docs/manual/customize-outside-br.txt +++ b/docs/manual/customize-outside-br.txt @@ -203,6 +203,8 @@ a set of files that define those alternatives: * +provides/jpeg.in+ defines the alternative libjpeg implementations; * +provides/openssl.in+ defines the alternative openssl implementations. * +provides/skeleton.in+ defines the alternative skeleton implementations. +* +provides/init.in+ defines the alternative init system implementations, this + can be used to select a default skeleton for your init. ===== Free-form content @@ -343,6 +345,13 @@ illustration, of course): | |$(eval $(generic-package)) | `---- | + |- provides/init.in + | |config BR2_INIT_MINE + | | bool "my custom init" + | | select BR2_PACKAGE_MY_INIT + | | select BR2_PACKAGE_SKELETON_INIT_SYSV if BR2_ROOTFS_SKELETON_DEFAULT + | `---- + | |- linux/Config.ext.in | |config BR2_LINUX_KERNEL_EXT_EXAMPLE_DRIVER | | bool "example-external-driver"