Date: Tue, 09 Oct 2001 20:11:40 -0700 From: Jordan Hubbard <jkh@freebsd.org> To: eugen@www.svzserv.kemerovo.su Cc: stable@freebsd.org Subject: Re: Bug in sysinstall (4-STABLE): broken Ctrl-Alt-Del/Restart Message-ID: <20011009201140R.jkh@freebsd.org> In-Reply-To: <20011010105040.A98969@svzserv.kemerovo.su> References: <20011010105040.A98969@svzserv.kemerovo.su>
next in thread | previous in thread | raw e-mail | index | archive | help
> Suppose, you start an installation or binary upgrade using sysinstall > from network. And suppose, you need to stop it and restart. Hmmm, this is a good point. I'm sure there are a number of things which need to be fixed up when you restart, but here's a beginning: Index: globals.c =================================================================== RCS file: /home/ncvs/src/release/sysinstall/Attic/globals.c,v retrieving revision 1.24.2.1 diff -u -r1.24.2.1 globals.c --- globals.c 2000/07/24 18:46:23 1.24.2.1 +++ globals.c 2001/10/10 03:08:04 @@ -47,6 +47,7 @@ Boolean DialogActive; /* Is libdialog initialized? */ Boolean ColorDisplay; /* Are we on a color display? */ Boolean OnVTY; /* Are we on a VTY? */ +Boolean Restarting; /* Are we restarting sysinstall? */ Variable *VarHead; /* The head of the variable chain */ Device *mediaDevice; /* Where we're installing from */ int BootMgr; /* Which boot manager we're using */ @@ -63,6 +64,7 @@ DebugFD = -1; ColorDisplay = FALSE; Fake = FALSE; + Restarting = FALSE; OnVTY = FALSE; DialogActive = FALSE; VarHead = NULL; Index: install.c =================================================================== RCS file: /home/ncvs/src/release/sysinstall/Attic/install.c,v retrieving revision 1.268.2.28 diff -u -r1.268.2.28 install.c --- install.c 2001/09/14 18:30:48 1.268.2.28 +++ install.c 2001/10/10 03:09:29 @@ -225,7 +225,7 @@ return DITEM_FAILURE; } - if (chroot("/mnt") == -1) { + if (!Restarting && chroot("/mnt") == -1) { msgConfirm("installInitial: Unable to chroot to %s - this is bad!", "/mnt"); return DITEM_FAILURE; Index: main.c =================================================================== RCS file: /home/ncvs/src/release/sysinstall/Attic/main.c,v retrieving revision 1.57.2.6 diff -u -r1.57.2.6 main.c --- main.c 2001/08/30 16:26:07 1.57.2.6 +++ main.c 2001/10/10 03:07:29 @@ -91,6 +91,8 @@ Fake = TRUE; msgConfirm("I'll be just faking it from here on out, OK?"); } + if (argc > 1 && !strcmp(argv[1], "-restart")) + Restarting = TRUE; /* Try to preserve our scroll-back buffer */ if (OnVTY) { @@ -119,7 +121,7 @@ if (!strstr(argv[0], "sysinstall")) start_arg = 0; - else if (Fake) + else if (Fake || Restarting) start_arg = 2; else start_arg = 1; Index: sysinstall.h =================================================================== RCS file: /home/ncvs/src/release/sysinstall/Attic/sysinstall.h,v retrieving revision 1.186.2.23 diff -u -r1.186.2.23 sysinstall.h --- sysinstall.h 2001/09/27 06:57:44 1.186.2.23 +++ sysinstall.h 2001/10/10 03:10:16 @@ -345,6 +345,7 @@ extern jmp_buf BailOut; /* Used to get the heck out */ extern int DebugFD; /* Where diagnostic output goes */ extern Boolean Fake; /* Don't actually modify anything - testing */ +extern Boolean Restarting; /* Are we restarting sysinstall? */ extern Boolean SystemWasInstalled; /* Did we install it? */ extern Boolean RunningAsInit; /* Are we running stand-alone? */ extern Boolean DialogActive; /* Is the dialog() stuff up? */ Index: system.c =================================================================== RCS file: /home/ncvs/src/release/sysinstall/Attic/system.c,v retrieving revision 1.103.2.6 diff -u -r1.103.2.6 system.c --- system.c 2001/09/27 07:01:49 1.103.2.6 +++ system.c 2001/10/10 03:05:46 @@ -59,7 +59,7 @@ int ret; free_variables(); - ret = execl(StartName, StartName, (char *)NULL); + ret = execl(StartName, StartName, "-restart", (char *)NULL); msgDebug("execl failed (%s)\n", strerror(errno)); /* NOTREACHED */ return -1; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011009201140R.jkh>