Make "Fake" turn off more potentially system-nuking options.

This commit is contained in:
Jordan K. Hubbard 1996-06-25 18:41:10 +00:00
parent 6a0f4b7e11
commit 48800325a6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=16718
9 changed files with 66 additions and 48 deletions

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.50 1996/06/08 09:08:32 jkh Exp $
* $Id: disks.c,v 1.51 1996/06/11 13:07:57 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -543,12 +543,14 @@ diskPartitionWrite(dialogMenuItem *self)
int ret;
msgNotify("Running bad block scan on partition %s", c1->name);
ret = vsystem("bad144 -v /dev/r%s 1234", c1->name);
if (ret)
msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret);
ret = vsystem("bad144 -v -s /dev/r%s", c1->name);
if (ret)
msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
if (!Fake) {
ret = vsystem("bad144 -v /dev/r%s 1234", c1->name);
if (ret)
msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret);
ret = vsystem("bad144 -v -s /dev/r%s", c1->name);
if (ret)
msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
}
}
}
}

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.101 1996/06/13 17:36:28 jkh Exp $
* $Id: install.c,v 1.102 1996/06/14 14:33:55 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -658,21 +658,21 @@ installFilesystems(dialogMenuItem *self)
/* As the very first thing, try to get ourselves some swap space */
sprintf(dname, "/dev/%s", swapdev->name);
if (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname)) {
if (!Fake && (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname))) {
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
return DITEM_FAILURE;
}
if (!swapon(dname))
if (!Fake && !swapon(dname))
msgNotify("Added %s as initial swap device", dname);
else
else if (!Fake)
msgConfirm("WARNING! Unable to swap to %s: %s\n"
"This may cause the installation to fail at some point\n"
"if you don't have a lot of memory.", dname, strerror(errno));
/* Next, create and/or mount the root device */
sprintf(dname, "/dev/r%sa", rootdev->disk->name);
if (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname)) {
if (!Fake && (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname))) {
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
return DITEM_FAILURE;
@ -723,7 +723,8 @@ installFilesystems(dialogMenuItem *self)
}
if (root->newfs || upgrade) {
Mkdir("/mnt/dev", NULL);
MakeDevDisk(disk, "/mnt/dev");
if (!Fake)
MakeDevDisk(disk, "/mnt/dev");
}
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
@ -749,7 +750,7 @@ installFilesystems(dialogMenuItem *self)
if (c2 == swapdev)
continue;
sprintf(fname, "/mnt/dev/%s", c2->name);
i = swapon(fname);
i = (Fake || swapon(fname));
if (!i)
msgNotify("Added %s as an additional swap device", fname);
else

View file

@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
* $Id: misc.c,v 1.18 1996/04/28 03:27:21 jkh Exp $
* $Id: misc.c,v 1.19 1996/06/17 21:48:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -255,7 +255,7 @@ Mkdir(char *ipath, void *data)
int final=0;
char *p, *path;
if (file_readable(ipath))
if (file_readable(ipath) || Fake)
return DITEM_SUCCESS;
path = strdup(ipath);
@ -295,6 +295,9 @@ Mount(char *mountp, void *dev)
char device[80];
char mountpoint[FILENAME_MAX];
if (Fake)
return DITEM_SUCCESS;
if (*((char *)dev) != '/') {
sprintf(device, "/mnt/dev/%s", (char *)dev);
sprintf(mountpoint, "/mnt%s", mountp);

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.50 1996/06/08 09:08:32 jkh Exp $
* $Id: disks.c,v 1.51 1996/06/11 13:07:57 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -543,12 +543,14 @@ diskPartitionWrite(dialogMenuItem *self)
int ret;
msgNotify("Running bad block scan on partition %s", c1->name);
ret = vsystem("bad144 -v /dev/r%s 1234", c1->name);
if (ret)
msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret);
ret = vsystem("bad144 -v -s /dev/r%s", c1->name);
if (ret)
msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
if (!Fake) {
ret = vsystem("bad144 -v /dev/r%s 1234", c1->name);
if (ret)
msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret);
ret = vsystem("bad144 -v -s /dev/r%s", c1->name);
if (ret)
msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
}
}
}
}

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.101 1996/06/13 17:36:28 jkh Exp $
* $Id: install.c,v 1.102 1996/06/14 14:33:55 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -658,21 +658,21 @@ installFilesystems(dialogMenuItem *self)
/* As the very first thing, try to get ourselves some swap space */
sprintf(dname, "/dev/%s", swapdev->name);
if (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname)) {
if (!Fake && (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname))) {
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
return DITEM_FAILURE;
}
if (!swapon(dname))
if (!Fake && !swapon(dname))
msgNotify("Added %s as initial swap device", dname);
else
else if (!Fake)
msgConfirm("WARNING! Unable to swap to %s: %s\n"
"This may cause the installation to fail at some point\n"
"if you don't have a lot of memory.", dname, strerror(errno));
/* Next, create and/or mount the root device */
sprintf(dname, "/dev/r%sa", rootdev->disk->name);
if (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname)) {
if (!Fake && (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname))) {
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
return DITEM_FAILURE;
@ -723,7 +723,8 @@ installFilesystems(dialogMenuItem *self)
}
if (root->newfs || upgrade) {
Mkdir("/mnt/dev", NULL);
MakeDevDisk(disk, "/mnt/dev");
if (!Fake)
MakeDevDisk(disk, "/mnt/dev");
}
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
@ -749,7 +750,7 @@ installFilesystems(dialogMenuItem *self)
if (c2 == swapdev)
continue;
sprintf(fname, "/mnt/dev/%s", c2->name);
i = swapon(fname);
i = (Fake || swapon(fname));
if (!i)
msgNotify("Added %s as an additional swap device", fname);
else

View file

@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
* $Id: misc.c,v 1.18 1996/04/28 03:27:21 jkh Exp $
* $Id: misc.c,v 1.19 1996/06/17 21:48:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -255,7 +255,7 @@ Mkdir(char *ipath, void *data)
int final=0;
char *p, *path;
if (file_readable(ipath))
if (file_readable(ipath) || Fake)
return DITEM_SUCCESS;
path = strdup(ipath);
@ -295,6 +295,9 @@ Mount(char *mountp, void *dev)
char device[80];
char mountpoint[FILENAME_MAX];
if (Fake)
return DITEM_SUCCESS;
if (*((char *)dev) != '/') {
sprintf(device, "/mnt/dev/%s", (char *)dev);
sprintf(mountpoint, "/mnt%s", mountp);

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: disks.c,v 1.50 1996/06/08 09:08:32 jkh Exp $
* $Id: disks.c,v 1.51 1996/06/11 13:07:57 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -543,12 +543,14 @@ diskPartitionWrite(dialogMenuItem *self)
int ret;
msgNotify("Running bad block scan on partition %s", c1->name);
ret = vsystem("bad144 -v /dev/r%s 1234", c1->name);
if (ret)
msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret);
ret = vsystem("bad144 -v -s /dev/r%s", c1->name);
if (ret)
msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
if (!Fake) {
ret = vsystem("bad144 -v /dev/r%s 1234", c1->name);
if (ret)
msgConfirm("Bad144 init on %s returned status of %d!", c1->name, ret);
ret = vsystem("bad144 -v -s /dev/r%s", c1->name);
if (ret)
msgConfirm("Bad144 scan on %s returned status of %d!", c1->name, ret);
}
}
}
}

View file

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.101 1996/06/13 17:36:28 jkh Exp $
* $Id: install.c,v 1.102 1996/06/14 14:33:55 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -658,21 +658,21 @@ installFilesystems(dialogMenuItem *self)
/* As the very first thing, try to get ourselves some swap space */
sprintf(dname, "/dev/%s", swapdev->name);
if (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname)) {
if (!Fake && (!MakeDevChunk(swapdev, "/dev") || !file_readable(dname))) {
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
return DITEM_FAILURE;
}
if (!swapon(dname))
if (!Fake && !swapon(dname))
msgNotify("Added %s as initial swap device", dname);
else
else if (!Fake)
msgConfirm("WARNING! Unable to swap to %s: %s\n"
"This may cause the installation to fail at some point\n"
"if you don't have a lot of memory.", dname, strerror(errno));
/* Next, create and/or mount the root device */
sprintf(dname, "/dev/r%sa", rootdev->disk->name);
if (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname)) {
if (!Fake && (!MakeDevChunk(rootdev, "/dev") || !file_readable(dname))) {
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
return DITEM_FAILURE;
@ -723,7 +723,8 @@ installFilesystems(dialogMenuItem *self)
}
if (root->newfs || upgrade) {
Mkdir("/mnt/dev", NULL);
MakeDevDisk(disk, "/mnt/dev");
if (!Fake)
MakeDevDisk(disk, "/mnt/dev");
}
for (c1 = disk->chunks->part; c1; c1 = c1->next) {
@ -749,7 +750,7 @@ installFilesystems(dialogMenuItem *self)
if (c2 == swapdev)
continue;
sprintf(fname, "/mnt/dev/%s", c2->name);
i = swapon(fname);
i = (Fake || swapon(fname));
if (!i)
msgNotify("Added %s as an additional swap device", fname);
else

View file

@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
* $Id: misc.c,v 1.18 1996/04/28 03:27:21 jkh Exp $
* $Id: misc.c,v 1.19 1996/06/17 21:48:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -255,7 +255,7 @@ Mkdir(char *ipath, void *data)
int final=0;
char *p, *path;
if (file_readable(ipath))
if (file_readable(ipath) || Fake)
return DITEM_SUCCESS;
path = strdup(ipath);
@ -295,6 +295,9 @@ Mount(char *mountp, void *dev)
char device[80];
char mountpoint[FILENAME_MAX];
if (Fake)
return DITEM_SUCCESS;
if (*((char *)dev) != '/') {
sprintf(device, "/mnt/dev/%s", (char *)dev);
sprintf(mountpoint, "/mnt%s", mountp);