DTRT in the restart case

This commit is contained in:
jkh 2001-10-12 07:36:34 +00:00
parent fa0b537235
commit a05a408d14
10 changed files with 16 additions and 6 deletions

View File

@ -47,6 +47,7 @@ Boolean RunningAsInit; /* Are we running as init? */
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 @@ globalsInit(void)
DebugFD = -1;
ColorDisplay = FALSE;
Fake = FALSE;
Restarting = FALSE;
OnVTY = FALSE;
DialogActive = FALSE;
VarHead = NULL;

View File

@ -225,7 +225,7 @@ installInitial(void)
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;

View File

@ -91,6 +91,8 @@ main(int argc, char **argv)
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) {
@ -129,7 +131,7 @@ main(int argc, char **argv)
if (!strstr(argv[0], "sysinstall"))
start_arg = 0;
else if (Fake)
else if (Fake || Restarting)
start_arg = 2;
else
start_arg = 1;

View File

@ -346,6 +346,7 @@ typedef struct _devPriv {
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? */

View File

@ -63,7 +63,7 @@ intr_restart(dialogMenuItem *self)
fdmax = getdtablesize();
for (fd = 3; fd < fdmax; fd++)
close(fd);
ret = execl(StartName, StartName, (char *)NULL);
ret = execl(StartName, StartName, "-restart", (char *)NULL);
msgDebug("execl failed (%s)\n", strerror(errno));
/* NOTREACHED */
return -1;

View File

@ -47,6 +47,7 @@ Boolean RunningAsInit; /* Are we running as init? */
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 @@ globalsInit(void)
DebugFD = -1;
ColorDisplay = FALSE;
Fake = FALSE;
Restarting = FALSE;
OnVTY = FALSE;
DialogActive = FALSE;
VarHead = NULL;

View File

@ -225,7 +225,7 @@ installInitial(void)
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;

View File

@ -91,6 +91,8 @@ main(int argc, char **argv)
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) {
@ -129,7 +131,7 @@ main(int argc, char **argv)
if (!strstr(argv[0], "sysinstall"))
start_arg = 0;
else if (Fake)
else if (Fake || Restarting)
start_arg = 2;
else
start_arg = 1;

View File

@ -346,6 +346,7 @@ typedef struct _devPriv {
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? */

View File

@ -63,7 +63,7 @@ intr_restart(dialogMenuItem *self)
fdmax = getdtablesize();
for (fd = 3; fd < fdmax; fd++)
close(fd);
ret = execl(StartName, StartName, (char *)NULL);
ret = execl(StartName, StartName, "-restart", (char *)NULL);
msgDebug("execl failed (%s)\n", strerror(errno));
/* NOTREACHED */
return -1;