[PATCH] startup: export PATH variable

Sascha Hauer s.hauer at pengutronix.de
Thu Jan 14 04:30:55 EST 2021


The PATH environment variable is set at the shell prompt, but it is not
exported, so currently scripts can't execute other scripts in PATH
anymore. PATH used to be exported in the init script, but this part was
lost when converting the init script to C. Add it back.

Fixes: 90df2a955e ("defaultenv: Convert init script to C")
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/startup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/common/startup.c b/common/startup.c
index 767d178de8..1ac36d950c 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -307,6 +307,7 @@ static int run_init(void)
 	struct stat s;
 
 	setenv("PATH", "/env/bin");
+	export("PATH");
 
 	/* Run legacy /env/bin/init if it exists */
 	env_bin_init_exists = stat(INITFILE, &s) == 0;
-- 
2.20.1




More information about the barebox mailing list