summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1999-05-05 12:20:23 +0000
committerjb <jb@FreeBSD.org>1999-05-05 12:20:23 +0000
commit8a1c5093d7f2e0e5596401d665169eb124efb373 (patch)
tree5805ea75aeaa89c7a142fe474f8ca784bab57fda /sys/kern/init_main.c
parent2f046ead7857172f2e15013c7430ce094707232b (diff)
downloadFreeBSD-src-8a1c5093d7f2e0e5596401d665169eb124efb373.zip
FreeBSD-src-8a1c5093d7f2e0e5596401d665169eb124efb373.tar.gz
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!
Diffstat (limited to 'sys/kern/init_main.c')
-rw-r--r--sys/kern/init_main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
index c2d2d0f..0cfa167 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 <sys/param.h>
#include <sys/file.h>
@@ -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 */ ;
OpenPOWER on IntegriCloud