From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 13 May 2024 15:23:27 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1s6VeJ-00CevV-1G for lore@lore.pengutronix.de; Mon, 13 May 2024 15:23:27 +0200 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1s6VeI-000072-Jp; Mon, 13 May 2024 15:23:26 +0200 Received: from smtp66.iad3a.emailsrvr.com ([173.203.187.66]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s6Vdq-0008I6-SW for ptxdist@pengutronix.de; Mon, 13 May 2024 15:23:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20221208-6x11dpa4; t=1715606577; bh=OTvhSWvOsy/DfHazaysi/G3ymLocmYAWGp+eDPngdyE=; h=From:To:Subject:Date:From; b=SpuOl9+Ed8wLe52GJcYw/Z6ryfqNqmb8NqSpVE9fAMm3lmntADJ56yQT4qeR2X0cG JPhD2Ev+biwgjTjJ3soh6m1AP1FPFEEyNLgc3qQHs3F20Au7fed98x8BiygALGCIY/ wQ4Ff5MOrY0x7e3djAEoJqKRH024nGEJUu0FSws0= X-Auth-ID: abbotti@mev.co.uk Received: by smtp33.relay.iad3a.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 6DFDD5494; Mon, 13 May 2024 09:22:57 -0400 (EDT) From: Ian Abbott To: ptxdist@pengutronix.de Date: Mon, 13 May 2024 13:55:06 +0100 Message-ID: <20240513132247.25521-3-abbotti@mev.co.uk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240513132247.25521-1-abbotti@mev.co.uk> References: <20240513132247.25521-1-abbotti@mev.co.uk> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Classification-ID: 1eebba18-7917-4316-985a-0dbc62ca213b-3-1 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-3.5 required=4.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Subject: [ptxdist] [PATCH 2/2] bash: allow installation of /usr/bin/sh symlink to be chosen manually X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: Ian Abbott Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false It is possible for any of BusyBox, Dash, or Bash to install the /usr/bin/sh symbolic link. Only allow BASH_SH to be enabled if the symbolic link is not being installed by either BusyBox or Dash (unless overridden by ALLYES). Default to enabled if the link is not being installed by BusyBox or Dash. Also allow it to be manually disabled. Rationale: It is common for Bash to be installed as an interactive login shell, but to use something lighter and faster for non-interactive use. Shell scripts typically use /bin/sh as the interpreter selected by the "shebang" line. Signed-off-by: Ian Abbott --- rules/bash.in | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/rules/bash.in b/rules/bash.in index 3b3dd845d..5276df8d1 100644 --- a/rules/bash.in +++ b/rules/bash.in @@ -262,8 +262,20 @@ config BASH_CURSES bool prompt "Use libcurses instead of libtermcap" +comment "BusyBox sh is selected" + depends on BUSYBOX && !BUSYBOX_SH_IS_NONE + +comment "Dash sh is selected" + depends on DASH_LINK_SH + config BASH_SH bool - default BUSYBOX = n || BUSYBOX_SH_IS_NONE + depends on (!BUSYBOX || BUSYBOX_SH_IS_NONE) && !DASH_LINK_SH || ALLYES + default (!BUSYBOX || BUSYBOX_SH_IS_NONE) && !DASH_LINK_SH + prompt "link to /bin/sh" + help + Create a link symbolic link "/usr/bin/sh" ("/bin/sh") to + "bash". Select this to use bash as the interpreter for Bourne + shell scripts using the canonical "#!/bin/sh" shebang line. endif -- 2.43.0