From 67481196cc523d56254397da973416c1867ffbea Mon Sep 17 00:00:00 2001 From: John Birrell Date: Wed, 5 May 1999 12:20:23 +0000 Subject: [PATCH] Allow the init_path to be customised in an embedded system using the INIT_PATH config option. Also fix two bugs which caused an infinite loop in none of the programs in the init_path were found. That code was obviously not tested! --- sys/kern/init_main.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c index c2d2d0f265f..0cfa167fe16 100644 --- a/sys/kern/init_main.c +++ b/sys/kern/init_main.c @@ -39,10 +39,11 @@ * SUCH DAMAGE. * * @(#)init_main.c 8.9 (Berkeley) 1/21/94 - * $Id: init_main.c,v 1.116 1999/04/29 22:51:59 dt Exp $ + * $Id: init_main.c,v 1.117 1999/05/03 23:57:19 billf Exp $ */ #include "opt_devfs.h" +#include "opt_init_path.h" #include #include @@ -589,7 +590,11 @@ kthread_init(dummy) * List of paths to try when searching for "init". */ static char init_path[MAXPATHLEN] = +#ifdef INIT_PATH + __XSTRING(INIT_PATH); +#else "/sbin/init;/sbin/oinit;/sbin/init.bak;/stand/sysinstall"; +#endif SYSCTL_STRING(_kern, OID_AUTO, init_path, CTLFLAG_RD, init_path, 0, ""); /* @@ -623,10 +628,10 @@ start_init(p) init_path[sizeof init_path - 1] = 0; } - for (path = init_path; path != '\0'; path = next) { + for (path = init_path; *path != '\0'; path = next) { while (*path == ';') path++; - if (path == '\0') + if (*path == '\0') break; for (next = path; *next != '\0' && *next != ';'; next++) /* nothing */ ;