From owner-freebsd-current Fri Jan 30 23:26:22 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id XAA03548 for current-outgoing; Fri, 30 Jan 1998 23:26:22 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from word.smith.net.au (ppp6.portal.net.au [202.12.71.106]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id XAA03537 for ; Fri, 30 Jan 1998 23:26:17 -0800 (PST) (envelope-from mike@word.smith.net.au) Received: from word (localhost [127.0.0.1]) by word.smith.net.au (8.8.8/8.8.5) with ESMTP id RAA00927; Sat, 31 Jan 1998 17:46:08 +1030 (CST) Message-Id: <199801310716.RAA00927@word.smith.net.au> X-Mailer: exmh version 2.0zeta 7/24/97 To: "Jordan K. Hubbard" cc: Mike Smith , Charlie ROOT , freebsd-current@FreeBSD.ORG Subject: Re: /kernel.config takes over boot: -c :-(( In-reply-to: Your message of "Fri, 30 Jan 1998 05:34:04 -0800." <20160.886167244@time.cdrom.com> Mime-Version: 1.0 Content-Type: multipart/mixed ; boundary="==_Exmh_20067113640" Date: Sat, 31 Jan 1998 17:46:07 +1030 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe current" This is a multipart MIME message. --==_Exmh_20067113640 Content-Type: text/plain; charset=us-ascii > > 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) --==_Exmh_20067113640 Content-Type: text/plain; name="uc.diff"; charset=us-ascii Content-Description: uc.diff Content-Disposition: attachment; filename="uc.diff" --- 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; } --==_Exmh_20067113640 Content-Type: text/plain; charset=us-ascii \\ 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. \\ --==_Exmh_20067113640--