From ed70fbe40c6ddb789398ca4e8f68d1224328cd5d Mon Sep 17 00:00:00 2001 From: Andrzej Bialecki Date: Fri, 8 Jan 1999 21:00:26 +0000 Subject: [PATCH] Fix faulty logic in handling userconfig_script, INTRO_USERCONFIG and RB_CONFIG. Now, the code should do the right thing in the following cases, when kernel is compiled with INTRO_USERCONFIG: * when booted without userconfig_script and without RB_CONFIG, present intro screen, and wait for user input. * when booted with userconfig_script and without RB_CONFIG, DON'T present intro screen unless explicitly asked in userconfig_script, basing on assumption that if a user loads userconfig_script, (s)he already decided what parameters to configure. Proceed with booting. * when booted without userconfig_script, and with RB_CONFIG, enter configuration utility and wait for user input. * when booted with userconfig_script, and with RB_CONFIG, execute all commands from userconfig_script, and DON'T leave the config utility, but wait for user input. And finally, regardless of the combination of the above parameters, when intro screen is invoked either first or next times, and user chooses to go back to CLI interface, unblock the quit command. --- sys/i386/i386/userconfig.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index 1dba634925f1..a822f86edadc 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -46,7 +46,7 @@ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** - ** $Id: userconfig.c,v 1.119 1999/01/06 09:09:22 abial Exp $ + ** $Id: userconfig.c,v 1.120 1999/01/07 09:49:28 abial Exp $ **/ /** @@ -239,14 +239,22 @@ getchar(void) * script (userconfig_boot_parsing==1), otherwise * we would always block here waiting for user input. */ + intro = 1; if (userconfig_boot_parsing == 0) { - intro = 1; + /* userconfig_boot_parsing will be set to 1 on next pass, + * which will allow using 'intro' in the middle of other + * userconfig_script commands. + */ c = 'i'; asp = "ntro\n"; assize = strlen(asp); + } else { + userconfig_boot_parsing = 0; + assize=-1; } #else + userconfig_boot_parsing = 0; if (!(boothowto & RB_CONFIG)) { /* don't want to drop to interpreter */ @@ -2507,7 +2515,7 @@ visuserconfig(void) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: userconfig.c,v 1.119 1999/01/06 09:09:22 abial Exp $ + * $Id: userconfig.c,v 1.120 1999/01/07 09:49:28 abial Exp $ */ #include "scbus.h" @@ -3142,6 +3150,8 @@ introfunc(CmdParm *parms) return visuserconfig(); else { putxy(0, 1, "Type \"help\" for help or \"quit\" to exit."); + /* enable quitfunc */ + userconfig_boot_parsing=0; move (0, 3); boothowto |= RB_CONFIG; /* force -c */ return 0;