]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
package/bash: use target finalize hook
authorRomain Naour <romain.naour@smile.fr>
Fri, 19 Jan 2018 10:15:09 +0000 (11:15 +0100)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Thu, 3 May 2018 21:15:07 +0000 (23:15 +0200)
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>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/bash/bash.mk

index 2182bede1550034568670734a544ba6b926a62ad..bb52bf32598323bdb6f37452806cc3160594e299 100644 (file)
@@ -39,14 +39,18 @@ BASH_CONF_ENV += bash_cv_getenv_redef=yes
 endif
 endif
 
-# 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))