extern short nohalt; //idle.inc
extern char *default_cmd; //"default" command line
+extern char *onerror; //"onerror" command line
#endif /* __CONFIG_H__ */
static void load_kernel(void)
{
enum kernel_type type;
+ const char *cmdline;
if (defaultlevel == LEVEL_UI)
type = KT_COM32;
type = KT_KERNEL;
execute(default_cmd, type);
+
+ /*
+ * If we fail to boot the kernel execute the "onerror" command
+ * line.
+ */
+ if (onerrorlen) {
+ rsprintf(&cmdline, "%s %s", onerror, default_cmd);
+ execute(cmdline, KT_COM32);
+ }
}
static int ldlinux_main(int argc, char **argv)
short nohalt = 1; //idle.inc
char *default_cmd = NULL; //"default" command line
+char *onerror = NULL; //"onerror" command line
/* Empty refstring */
const char *empty_string;
refstr_put(m->onerror);
m->onerror = refstrdup(skipspace(p + 7));
onerrorlen = strlen(m->onerror);
+ refstr_put(onerror);
+ onerror = refstrdup(m->onerror);
} else if (looking_at(p, "master")) {
p = skipspace(p + 6);
if (looking_at(p, "passwd")) {
nocomplete = atoi(skipspace(p + 10));
} else if (looking_at(p, "nohalt")) {
nohalt = atoi(skipspace(p + 8));
+ } else if (looking_at(p, "onerror")) {
+ refstr_put(m->onerror);
+ m->onerror = refstrdup(skipspace(p + 7));
+ onerrorlen = strlen(m->onerror);
+ refstr_put(onerror);
+ onerror = refstrdup(m->onerror);
}
/* serial setting, bps, flow control */