[Buildroot] [git commit] system: directly use system shell as root shell

Peter Korsgaard peter at korsgaard.com
Thu Aug 1 20:49:50 UTC 2019


commit: https://git.buildroot.net/buildroot/commit/?id=ffe9eaf3377222b76bafc7e7f49f499e5b5a65e6
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

Rather than through the /bin/sh symlink, because because invocating bash as
sh causes bash to mimic sh (see INVOCATION in bash(1)).

Signed-off-by: Philip Molloy <philip.a.molloy at gmail.com>
[yann.morin.1998 at free.fr: use the system shell, not a new option,
 as suggested by Arnout]
[Peter: describe why this is done using the description from Philip's help
 text]
Signed-off-by: Yann E. MORIN <yann.morin.1998 at free.fr>
Cc: Arnout Vandecappelle <arnout at mind.be>
Signed-off-by: Peter Korsgaard <peter at korsgaard.com>
---
 package/skeleton-init-common/skeleton-init-common.mk | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/package/skeleton-init-common/skeleton-init-common.mk b/package/skeleton-init-common/skeleton-init-common.mk
index e429b13d78..4a67f51c19 100644
--- a/package/skeleton-init-common/skeleton-init-common.mk
+++ b/package/skeleton-init-common/skeleton-init-common.mk
@@ -95,6 +95,8 @@ SKELETON_INIT_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_INIT_COMMON_ADD_SH_TO_SHE
 ifneq ($(SKELETON_INIT_COMMON_BIN_SH),)
 define SKELETON_INIT_COMMON_SET_BIN_SH
 	ln -sf $(SKELETON_INIT_COMMON_BIN_SH) $(TARGET_DIR)/bin/sh
+	$(SED) '/^root:/s,[^/]*$$,$(SKELETON_INIT_COMMON_BIN_SH),' \
+		$(TARGET_DIR)/etc/passwd
 endef
 endif
 endif


More information about the buildroot mailing list