diff mbox series

[v3,9/9] package/bash: use target finalize hook

Message ID 1516356909-18620-10-git-send-email-romain.naour@smile.fr
State Accepted
Headers show
Series Add /etc/shells handling | expand

Commit Message

Romain Naour Jan. 19, 2018, 10:15 a.m. UTC
Arnout reported an issue with the upcoming top-level parallel build.
The file /etc/shells can be modified by several packages (shell providers)

Signed-off-by: Romain Naour <romain.naour@smile.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
---
 package/bash/bash.mk | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Yann E. MORIN Feb. 3, 2018, 3:13 p.m. UTC | #1
Romain, All,

On 2018-01-19 11:15 +0100, Romain Naour spake thusly:
> Arnout reported an issue with the upcoming top-level parallel build.
> The file /etc/shells can be modified by several packages (shell providers)
> 
> Signed-off-by: Romain Naour <romain.naour@smile.fr>
> Cc: Arnout Vandecappelle <arnout@mind.be>

Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

> ---
>  package/bash/bash.mk | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/package/bash/bash.mk b/package/bash/bash.mk
> index ab6b43b..12f33f1 100644
> --- a/package/bash/bash.mk
> +++ b/package/bash/bash.mk
> @@ -40,14 +40,18 @@ endif
>  endif
>  
>  # Make /bin/sh -> bash (no other shell, better than busybox shells)

While reviewing this patch, I was really puzzled at what this comment
meant. It turns out I was not careful years ago when I made /bin/sh
configurable.

Patch sent: https://patchwork.ozlabs.org/patch/868907/

Regards,
Yann E. MORIN.

> -# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
> -# can reject the user connexion. See man shells.
>  define BASH_INSTALL_TARGET_CMDS
>  	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
>  		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
>  	rm -f $(TARGET_DIR)/bin/bashbug
> +endef
> +
> +# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
> +# can reject the user connection. See man shells.
> +define BASH_ADD_MKSH_TO_SHELLS
>  	grep -qsE '^/bin/bash$$' $(TARGET_DIR)/etc/shells \
>  		|| echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
>  endef
> +BASH_TARGET_FINALIZE_HOOKS += BASH_ADD_MKSH_TO_SHELLS
>  
>  $(eval $(autotools-package))
> -- 
> 2.7.4
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
diff mbox series

Patch

diff --git a/package/bash/bash.mk b/package/bash/bash.mk
index ab6b43b..12f33f1 100644
--- a/package/bash/bash.mk
+++ b/package/bash/bash.mk
@@ -40,14 +40,18 @@  endif
 endif
 
 # Make /bin/sh -> bash (no other shell, better than busybox shells)
-# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
-# can reject the user connexion. See man shells.
 define BASH_INSTALL_TARGET_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
 		DESTDIR=$(TARGET_DIR) exec_prefix=/ install
 	rm -f $(TARGET_DIR)/bin/bashbug
+endef
+
+# Add /bin/bash to /etc/shells otherwise some login tools like dropbear
+# can reject the user connection. See man shells.
+define BASH_ADD_MKSH_TO_SHELLS
 	grep -qsE '^/bin/bash$$' $(TARGET_DIR)/etc/shells \
 		|| echo "/bin/bash" >> $(TARGET_DIR)/etc/shells
 endef
+BASH_TARGET_FINALIZE_HOOKS += BASH_ADD_MKSH_TO_SHELLS
 
 $(eval $(autotools-package))