mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/2] Change selection of /usr/bin/sh symlink
@ 2024-05-13 12:55 Ian Abbott
  2024-05-13 12:55 ` [ptxdist] [PATCH 1/2] dash: install /usr/bin/sh symlink by default if not provided by BusyBox Ian Abbott
  2024-05-13 12:55 ` [ptxdist] [PATCH 2/2] bash: allow installation of /usr/bin/sh symlink to be chosen manually Ian Abbott
  0 siblings, 2 replies; 5+ messages in thread
From: Ian Abbott @ 2024-05-13 12:55 UTC (permalink / raw)
  To: ptxdist

BusyBox, Dash, and Bash all allow installation of the /usr/bin/sh
symbolic link to their respective executable, busybox, dash or bash.

This patch series only allows Dash to install the /usr/bin/sh symlink if
it is not installed by BusyBox (unless overridden by the ALLYES config
option), and only allows Bash to install the /usr/bin/sh symlink if it
is not installed by either BusyBox or Dash (unless overridden by the
ALLYES config option).

Bash is powerful but slow compared to BusyBox or Dash shells, so it is
common to install a faster shell for executing shell scripts that
typically use /bin/sh as the interpreter selected by their "shebang"
line, and reserve Bash for use mostly as the interactive login shell.

Patches:

1) dash: install /usr/bin/sh symlink by default if not provided by BusyBox
2) bash: allow installation of /usr/bin/sh symlink to be chosen manually

 rules/bash.in | 14 +++++++++++++-
 rules/dash.in |  5 +++++
 2 files changed, 18 insertions(+), 1 deletion(-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH 1/2] dash: install /usr/bin/sh symlink by default if not provided by BusyBox
  2024-05-13 12:55 [ptxdist] [PATCH 0/2] Change selection of /usr/bin/sh symlink Ian Abbott
@ 2024-05-13 12:55 ` Ian Abbott
  2024-05-31  6:08   ` [ptxdist] [APPLIED] " Michael Olbrich
  2024-05-13 12:55 ` [ptxdist] [PATCH 2/2] bash: allow installation of /usr/bin/sh symlink to be chosen manually Ian Abbott
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Abbott @ 2024-05-13 12:55 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

Only allow DASH_LINK_SH to be enabled if the /usr/bin/sh symbolic link
is not being installed by BusyBox (unless overridden by ALLYES).
Default to enabled if the link is not being installed by BusyBox.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
 rules/dash.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/rules/dash.in b/rules/dash.in
index 88ea87942..b9579c308 100644
--- a/rules/dash.in
+++ b/rules/dash.in
@@ -11,8 +11,13 @@ menuconfig DASH
 
 if DASH
 
+comment "BusyBox sh is selected"
+	depends on BUSYBOX && !BUSYBOX_SH_IS_NONE
+
 config DASH_LINK_SH
 	bool
+	depends on !BUSYBOX || BUSYBOX_SH_IS_NONE || ALLYES
+	default !BUSYBOX || BUSYBOX_SH_IS_NONE
 	prompt "link to /bin/sh"
 	help
 	  Create a link "/bin/sh" that points to "/bin/dash". Select
-- 
2.43.0




^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ptxdist] [PATCH 2/2] bash: allow installation of /usr/bin/sh symlink to be chosen manually
  2024-05-13 12:55 [ptxdist] [PATCH 0/2] Change selection of /usr/bin/sh symlink Ian Abbott
  2024-05-13 12:55 ` [ptxdist] [PATCH 1/2] dash: install /usr/bin/sh symlink by default if not provided by BusyBox Ian Abbott
@ 2024-05-13 12:55 ` Ian Abbott
  2024-05-31  6:08   ` [ptxdist] [APPLIED] " Michael Olbrich
  1 sibling, 1 reply; 5+ messages in thread
From: Ian Abbott @ 2024-05-13 12:55 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

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 <abbotti@mev.co.uk>
---
 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




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [APPLIED] dash: install /usr/bin/sh symlink by default if not provided by BusyBox
  2024-05-13 12:55 ` [ptxdist] [PATCH 1/2] dash: install /usr/bin/sh symlink by default if not provided by BusyBox Ian Abbott
@ 2024-05-31  6:08   ` Michael Olbrich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Olbrich @ 2024-05-31  6:08 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

Thanks, applied as e320da8efe25e2a8b1dcc88cf7944f3a4b817d8e.

Michael

[sent from post-receive hook]

On Fri, 31 May 2024 08:08:29 +0200, Ian Abbott <abbotti@mev.co.uk> wrote:
> Only allow DASH_LINK_SH to be enabled if the /usr/bin/sh symbolic link
> is not being installed by BusyBox (unless overridden by ALLYES).
> Default to enabled if the link is not being installed by BusyBox.
> 
> Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
> Message-Id: <20240513132247.25521-2-abbotti@mev.co.uk>
> [mol: simplify 'default']
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/dash.in b/rules/dash.in
> index 88ea87942f6e..16b57b78a5bd 100644
> --- a/rules/dash.in
> +++ b/rules/dash.in
> @@ -11,8 +11,13 @@ menuconfig DASH
>  
>  if DASH
>  
> +comment "BusyBox sh is selected"
> +	depends on BUSYBOX && !BUSYBOX_SH_IS_NONE
> +
>  config DASH_LINK_SH
>  	bool
> +	depends on !BUSYBOX || BUSYBOX_SH_IS_NONE || ALLYES
> +	default y
>  	prompt "link to /bin/sh"
>  	help
>  	  Create a link "/bin/sh" that points to "/bin/dash". Select



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [ptxdist] [APPLIED] bash: allow installation of /usr/bin/sh symlink to be chosen manually
  2024-05-13 12:55 ` [ptxdist] [PATCH 2/2] bash: allow installation of /usr/bin/sh symlink to be chosen manually Ian Abbott
@ 2024-05-31  6:08   ` Michael Olbrich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Olbrich @ 2024-05-31  6:08 UTC (permalink / raw)
  To: ptxdist; +Cc: Ian Abbott

Thanks, applied as 2b2bc8abf7ef1d4000c02a18b0a573948f6f5138.

Michael

[sent from post-receive hook]

On Fri, 31 May 2024 08:08:29 +0200, Ian Abbott <abbotti@mev.co.uk> wrote:
> 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 <abbotti@mev.co.uk>
> Message-Id: <20240513132247.25521-3-abbotti@mev.co.uk>
> [mol: simplify 'default']
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/bash.in b/rules/bash.in
> index 3b3dd845d4e2..0f8f33f82499 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 y
> +	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



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-05-31  6:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-13 12:55 [ptxdist] [PATCH 0/2] Change selection of /usr/bin/sh symlink Ian Abbott
2024-05-13 12:55 ` [ptxdist] [PATCH 1/2] dash: install /usr/bin/sh symlink by default if not provided by BusyBox Ian Abbott
2024-05-31  6:08   ` [ptxdist] [APPLIED] " Michael Olbrich
2024-05-13 12:55 ` [ptxdist] [PATCH 2/2] bash: allow installation of /usr/bin/sh symlink to be chosen manually Ian Abbott
2024-05-31  6:08   ` [ptxdist] [APPLIED] " Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox