summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>2001-10-12 07:36:34 +0000
committerjkh <jkh@FreeBSD.org>2001-10-12 07:36:34 +0000
commita05a408d1477a5343412025e2e3b23c405a7d380 (patch)
treef739d4371630cf7f94d9f84c599f9c7716b75403 /usr.sbin/sysinstall
parentfa0b53723556b0757603a7686ae1cb2bbcda6e08 (diff)
downloadFreeBSD-src-a05a408d1477a5343412025e2e3b23c405a7d380.zip
FreeBSD-src-a05a408d1477a5343412025e2e3b23c405a7d380.tar.gz
DTRT in the restart case
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/globals.c2
-rw-r--r--usr.sbin/sysinstall/install.c2
-rw-r--r--usr.sbin/sysinstall/main.c4
-rw-r--r--usr.sbin/sysinstall/sysinstall.h1
-rw-r--r--usr.sbin/sysinstall/system.c2
5 files changed, 8 insertions, 3 deletions
diff --git a/usr.sbin/sysinstall/globals.c b/usr.sbin/sysinstall/globals.c
index b12dbd8..4323bd0 100644
--- a/usr.sbin/sysinstall/globals.c
+++ b/usr.sbin/sysinstall/globals.c
@@ -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;
diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c
index 4f4c223..208f4ef 100644
--- a/usr.sbin/sysinstall/install.c
+++ b/usr.sbin/sysinstall/install.c
@@ -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;
diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c
index a562029..db56dc0 100644
--- a/usr.sbin/sysinstall/main.c
+++ b/usr.sbin/sysinstall/main.c
@@ -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;
diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h
index fb764b8..f143b38 100644
--- a/usr.sbin/sysinstall/sysinstall.h
+++ b/usr.sbin/sysinstall/sysinstall.h
@@ -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? */
diff --git a/usr.sbin/sysinstall/system.c b/usr.sbin/sysinstall/system.c
index deb9e9f..7cbb12f 100644
--- a/usr.sbin/sysinstall/system.c
+++ b/usr.sbin/sysinstall/system.c
@@ -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;
OpenPOWER on IntegriCloud