Browse Source

initd: allow overriding early PATH through build time define

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich 8 years ago
parent
commit
08cd2c661e
2 changed files with 5 additions and 1 deletions
  1. 1 1
      initd/early.c
  2. 4 0
      initd/init.h

+ 1 - 1
initd/early.c

@@ -90,7 +90,7 @@ early_mounts(void)
 static void
 early_env(void)
 {
-	setenv("PATH", "/usr/sbin:/usr/bin:/sbin:/bin", 1);
+	setenv("PATH", EARLY_PATH, 1);
 }
 
 void

+ 4 - 0
initd/init.h

@@ -18,6 +18,10 @@
 
 #include "../log.h"
 
+#ifndef EARLY_PATH
+#define EARLY_PATH "/usr/sbin:/sbin:/usr/bin:/bin"
+#endif
+
 void preinit(void);
 void early(void);
 int mkdev(const char *progname, int progmode);