Date: Sat, 31 Jan 1998 17:46:07 +1030 From: Mike Smith <mike@smith.net.au> To: "Jordan K. Hubbard" <jkh@time.cdrom.com> Cc: Mike Smith <mike@smith.net.au>, Charlie ROOT <root@korin.warman.org.pl>, freebsd-current@FreeBSD.ORG Subject: Re: /kernel.config takes over boot: -c :-(( Message-ID: <199801310716.RAA00927@word.smith.net.au> In-Reply-To: Your message of "Fri, 30 Jan 1998 05:34:04 -0800." <20160.886167244@time.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
> > I would be inclined to say that the "expected" behaviour would be to
> > have userconfig *not* exit after reading the kernel.config data *if* -c
> > was supplied.
>
> Fine, if you want to add the ability to tell the difference between
> being invoked with -c or compiled with USERCONFIG_BOOT, go for it! :-)
Can I have a review/test on this? After my last blunder through
-stable, I'll roll with the trainer wheels on this one. 8)
[-- Attachment #2 --]
--- userconfig.c.old Sat Jan 31 17:29:28 1998
+++ userconfig.c Sat Jan 31 17:39:29 1998
@@ -132,6 +132,7 @@
#ifdef USERCONFIG_BOOT
char userconfig_from_boot[512] = "";
+static int userconfig_boot_parsing; /* set if we are reading from the boot instructions */
static int
getchar(void)
@@ -147,8 +148,10 @@
}
}
if (*next) {
+ userconfig_boot_parsing = 1;
return (*next++);
} else {
+ userconfig_boot_parsing = 1;
return cngetc();
}
}
@@ -2836,6 +2839,15 @@
static int
quitfunc(CmdParm *parms)
{
+#ifdef USERCONFIG_BOOT
+ /*
+ * If kernel config supplied, and we are parsing it, and -c also supplied,
+ * ignore a quit command, This provides a safety mechanism to allow
+ * recovery from a damaged/buggy kernel config.
+ */
+ if ((boothowto & RB_CONFIG) && userconfig_boot_parsing)
+ return 0;
+#endif
return 1;
}
[-- Attachment #3 --]
\\ Sometimes you're ahead, \\ Mike Smith
\\ sometimes you're behind. \\ mike@smith.net.au
\\ The race is long, and in the \\ msmith@freebsd.org
\\ end it's only with yourself. \\
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801310716.RAA00927>
