summaryrefslogtreecommitdiffstats
path: root/release/sysinstall
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-07-18 09:42:02 +0000
committerjkh <jkh@FreeBSD.org>1998-07-18 09:42:02 +0000
commitc1d10d181de9930858213c26964bf148cbe069b5 (patch)
treebfa3f95ddcd21759181a743fd429f5a33e0d0ad1 /release/sysinstall
parent7466f92c1a75cdfc614e9b0f5eccf1f8afb31d06 (diff)
downloadFreeBSD-src-c1d10d181de9930858213c26964bf148cbe069b5.zip
FreeBSD-src-c1d10d181de9930858213c26964bf148cbe069b5.tar.gz
MF22: Paul Traina's changes.
Diffstat (limited to 'release/sysinstall')
-rw-r--r--release/sysinstall/devices.c11
-rw-r--r--release/sysinstall/dispatch.c38
-rw-r--r--release/sysinstall/floppy.c18
-rw-r--r--release/sysinstall/install.c30
-rw-r--r--release/sysinstall/label.c14
-rw-r--r--release/sysinstall/sysinstall.h5
-rw-r--r--release/sysinstall/variable.c26
7 files changed, 114 insertions, 28 deletions
diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c
index d76b897..e0902a1 100644
--- a/release/sysinstall/devices.c
+++ b/release/sysinstall/devices.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: devices.c,v 1.78 1998/05/24 20:01:23 jkh Exp $
+ * $Id: devices.c,v 1.79 1998/06/29 09:28:01 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -76,10 +76,15 @@ static struct _devname {
{ DEVICE_TYPE_DISK, "rwd%d", "IDE/ESDI/MFM/ST506 disk device", 3, 65538, 8, 16, 'c' },
{ DEVICE_TYPE_DISK, "od%d", "SCSI optical disk device", 20, 65538, 8, 4, 'b' },
{ DEVICE_TYPE_DISK, "rod%d", "SCSI optical disk device", 70, 65538, 8, 4, 'c' },
- { DEVICE_TYPE_DISK, "wfd%d", "ATAPI FLOPPY (LS-120) device", 1, 65538, 8, 4, 'b' },
- { DEVICE_TYPE_DISK, "rwfd%d", "ATAPI FLOPPY (LS-120) device", 87, 65538, 8, 4, 'c' },
+ { DEVICE_TYPE_DISK, "wfd%d", "ATAPI floppy device", 1, 65538, 8, 4, 'b' },
+ { DEVICE_TYPE_DISK, "rwfd%d", "ATAPI floppy device", 87, 65538, 8, 4, 'c' },
{ DEVICE_TYPE_FLOPPY, "fd%d", "floppy drive unit A", 2, 0, 64, 4, 'b' },
+ { DEVICE_TYPE_FLOPPY, "wfd%d", "ATAPI floppy drive unit A", 1, 0, 8, 4, 'b' },
{ DEVICE_TYPE_FLOPPY, "worm%d", "SCSI optical disk / CDR", 23, 0, 1, 4, 'b' },
+ { DEVICE_TYPE_NETWORK, "fpa", "DEC DEFPA PCI FDDI card" },
+ { DEVICE_TYPE_NETWORK, "sr", "SDL T1/E1 sync serial PCI card" },
+ { DEVICE_TYPE_NETWORK, "cc3i", "SDL HSSI sync serial PCI card" },
+ { DEVICE_TYPE_NETWORK, "en", "Efficient Networks ATM PCI card" },
{ DEVICE_TYPE_NETWORK, "de", "DEC DE435 PCI NIC or other DC21040-AA based card" },
{ DEVICE_TYPE_NETWORK, "fxp", "Intel EtherExpress Pro/100B PCI Fast Ethernet card" },
{ DEVICE_TYPE_NETWORK, "ed", "WD/SMC 80xx; Novell NE1000/2000; 3Com 3C503 card" },
diff --git a/release/sysinstall/dispatch.c b/release/sysinstall/dispatch.c
index 67e09d6..9bac849 100644
--- a/release/sysinstall/dispatch.c
+++ b/release/sysinstall/dispatch.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: dispatch.c,v 1.23 1997/09/16 18:57:08 jkh Exp $
+ * $Id: dispatch.c,v 1.24 1997/09/17 16:18:13 pst Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -44,6 +44,7 @@
static int dispatch_shutdown(dialogMenuItem *unused);
static int dispatch_systemExecute(dialogMenuItem *unused);
+static int dispatch_msgConfirm(dialogMenuItem *unused);
static struct _word {
char *name;
@@ -88,6 +89,7 @@ static struct _word {
{ "installFilesystems", installFilesystems },
{ "installVarDefaults", installVarDefaults },
{ "loadConfig", dispatch_load_file },
+ { "loadFloppyConfig", dispatch_load_floppy },
{ "mediaSetCDROM", mediaSetCDROM },
{ "mediaSetFloppy", mediaSetFloppy },
{ "mediaSetDOS", mediaSetDOS },
@@ -100,6 +102,7 @@ static struct _word {
{ "mediaSetFTPUserPass", mediaSetFTPUserPass },
{ "mediaSetCPIOVerbosity", mediaSetCPIOVerbosity },
{ "mediaGetType", mediaGetType },
+ { "msgConfirm", dispatch_msgConfirm },
{ "optionsEditor", optionsEditor },
{ "register", configRegister }, /* Alias */
{ "packageAdd", packageAdd },
@@ -107,6 +110,8 @@ static struct _word {
{ "addUser", userAddUser },
{ "shutdown", dispatch_shutdown },
{ "system", dispatch_systemExecute },
+ { "dumpVariables", dump_variables },
+ { "tcpMenuSelect", tcpMenuSelect },
{ NULL, NULL },
};
@@ -183,6 +188,20 @@ dispatch_systemExecute(dialogMenuItem *unused)
}
static int
+dispatch_msgConfirm(dialogMenuItem *unused)
+{
+ char *msg = variable_get(VAR_COMMAND);
+
+ if (msg) {
+ msgConfirm(msg);
+ return DITEM_SUCCESS;
+ }
+
+ msgDebug("_msgConfirm: No message passed in `command' variable.\n");
+ return DITEM_FAILURE;
+}
+
+static int
call_possible_resword(char *name, dialogMenuItem *value, int *status)
{
int i, rval;
@@ -272,12 +291,17 @@ dispatch_execute(qelement *head)
{
int result = DITEM_SUCCESS;
command_buffer *item;
+ char *old_interactive;
if (!head)
return result | DITEM_FAILURE;
+ old_interactive = variable_get(VAR_NONINTERACTIVE);
+ if (old_interactive)
+ old_interactive = strdup(old_interactive); /* save copy */
+
/* Hint to others that we're running from a script, should they care */
- variable_set2(VAR_NONINTERACTIVE, "YES");
+ variable_set2(VAR_NONINTERACTIVE, "yes");
while (!EMPTYQUE(*head)) {
item = (command_buffer *) head->q_forw;
@@ -301,7 +325,12 @@ dispatch_execute(qelement *head)
dispatch_free_all(head);
- variable_unset(VAR_NONINTERACTIVE);
+ if (!old_interactive)
+ variable_unset(VAR_NONINTERACTIVE);
+ else {
+ variable_set2(VAR_NONINTERACTIVE, old_interactive);
+ free(old_interactive);
+ }
return result;
}
@@ -394,7 +423,8 @@ dispatch_load_floppy(dialogMenuItem *self)
what |= dispatch_execute(list);
}
else {
- msgConfirm("Configuration file '%s' not found.", cp);
+ if (!variable_get(VAR_NO_ERROR))
+ msgConfirm("Configuration file '%s' not found.", cp);
variable_unset(VAR_INSTALL_CFG);
what |= DITEM_FAILURE;
mediaClose();
diff --git a/release/sysinstall/floppy.c b/release/sysinstall/floppy.c
index ec3f70c..ec87289 100644
--- a/release/sysinstall/floppy.c
+++ b/release/sysinstall/floppy.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: floppy.c,v 1.27 1998/02/08 20:18:19 jkh Exp $
+ * $Id: floppy.c,v 1.28 1998/02/10 18:31:22 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -73,10 +73,14 @@ mediaInitFloppy(Device *dev)
}
msgDebug("Init floppy called for %s distribution.\n", distWanted ? distWanted : "some");
- if (!distWanted)
- msgConfirm("Please insert floppy in %s", dev->description);
- else
- msgConfirm("Please insert floppy containing %s in %s", distWanted, dev->description);
+
+ if (!variable_get(VAR_NONINTERACTIVE)) {
+ if (!distWanted)
+ msgConfirm("Please insert floppy in %s", dev->description);
+ else
+ msgConfirm("Please insert floppy containing %s in %s",
+ distWanted, dev->description);
+ }
memset(&dosargs, 0, sizeof dosargs);
dosargs.fspec = dev->devname;
@@ -141,7 +145,9 @@ mediaShutdownFloppy(Device *dev)
else {
floppyMounted = FALSE;
msgDebug("Floppy unmounted successfully.\n");
- msgConfirm("You may remove the floppy from %s", dev->description);
+ if (!variable_get(VAR_NONINTERACTIVE))
+ msgConfirm("You may remove the floppy from %s",
+ dev->description);
}
}
}
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index 130e37a..b05f5c2 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -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.207 1998/03/10 13:42:01 jkh Exp $
+ * $Id: install.c,v 1.208 1998/03/24 09:51:57 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -94,7 +94,7 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd
if (c1->type == freebsd) {
for (c2 = c1->part; c2; c2 = c2->next) {
if (c2->type == part && c2->subtype != FS_SWAP && c2->private_data) {
- if (c2->flags & CHUNK_IS_ROOT) {
+ if (!strcmp(((PartInfo *)c2->private_data)->mountpoint, "/")) {
if (rootdev) {
if (whinge)
msgConfirm("WARNING: You have more than one root device set?!\n"
@@ -177,7 +177,7 @@ checkLabels(Boolean whinge, Chunk **rdev, Chunk **sdev, Chunk **udev, Chunk **vd
"swap partition.");
status = FALSE;
}
- if (!usrdev && whinge) {
+ if (!usrdev && whinge && !variable_get(VAR_NO_USR)) {
msgConfirm("WARNING: No /usr filesystem found. This is not technically\n"
"an error if your root filesystem is big enough (or you later\n"
"intend to mount your /usr filesystem over NFS), but it may otherwise\n"
@@ -212,11 +212,13 @@ installInitial(void)
/* If we refuse to proceed, bail. */
dialog_clear_norefresh();
- if (msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\n"
- "If you're running this on a disk with data you wish to save\n"
- "then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n"
- "proceeding!\n\n"
- "We can take no responsibility for lost disk contents!") != 0)
+ if (!variable_get(VAR_NO_WARN))
+ if (msgYesNo(
+ "Last Chance! Are you SURE you want continue the installation?\n\n"
+ "If you're running this on a disk with data you wish to save\n"
+ "then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n"
+ "proceeding!\n\n"
+ "We can take no responsibility for lost disk contents!") != 0)
return DITEM_FAILURE | DITEM_RESTORE;
if (DITEM_STATUS(diskLabelCommit(NULL)) != DITEM_SUCCESS) {
@@ -337,10 +339,18 @@ installFixitFloppy(dialogMenuItem *self)
return DITEM_SUCCESS;
variable_set2(SYSTEM_STATE, "fixit");
- memset(&args, 0, sizeof(args));
- args.fspec = "/dev/fd0";
Mkdir("/mnt2");
+ /* Try to open the floppy drive */
+ if (DITEM_STATUS(mediaSetFloppy(NULL)) == DITEM_FAILURE) {
+ msgConfirm("Unable to set media device to floppy.");
+ mediaClose();
+ return DITEM_FAILURE;
+ }
+
+ memset(&args, 0, sizeof(args));
+ args.fspec = mediaDevice->devname;
+
while (1) {
msgConfirm("Please insert a writable fixit floppy and press return");
if (mount("ufs", "/mnt2", 0, (caddr_t)&args) != -1)
diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c
index 90ec8f9..858bf8d 100644
--- a/release/sysinstall/label.c
+++ b/release/sysinstall/label.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: label.c,v 1.81 1998/02/06 04:35:21 jkh Exp $
+ * $Id: label.c,v 1.82 1998/03/13 11:09:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -786,8 +786,15 @@ diskLabel(Device *dev)
if (!vardev) {
cp = variable_get(VAR_VAR_SIZE);
+ if (cp)
+ sz = atoi(cp) * ONE_MEG;
+ else
+ sz = variable_get(VAR_NO_USR)
+ ? space_free(label_chunk_info[here].c)
+ : VAR_MIN_SIZE * ONE_MEG;
+
tmp = Create_Chunk_DWIM(label_chunk_info[here].c->disk, label_chunk_info[here].c,
- (cp ? atoi(cp) : VAR_MIN_SIZE) * ONE_MEG, part, FS_BSDFFS, 0);
+ sz, part, FS_BSDFFS, 0);
if (!tmp) {
msgConfirm("Less than %dMB free for /var - you will need to\n"
"partition your disk manually with a custom install!",
@@ -800,7 +807,7 @@ diskLabel(Device *dev)
record_label_chunks(devs, dev);
}
- if (!usrdev) {
+ if (!usrdev && !variable_get(VAR_NO_USR)) {
cp = variable_get(VAR_USR_SIZE);
if (cp)
sz = atoi(cp) * ONE_MEG;
@@ -828,6 +835,7 @@ diskLabel(Device *dev)
record_label_chunks(devs, dev);
}
}
+
/* At this point, we're reasonably "labelled" */
if (((cp = variable_get(DISK_LABELLED)) == NULL) || (strcmp(cp, "written")))
variable_set2(DISK_LABELLED, "yes");
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index c0b3314..eda63b9 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/sysinstall/sysinstall.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.145 1998/03/23 06:08:55 yokota Exp $
+ * $Id: sysinstall.h,v 1.146 1998/05/24 20:01:33 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -39,6 +39,7 @@
#include <sys/types.h>
#include <sys/wait.h>
+#include <errno.h>
#include <setjmp.h>
#include <stdio.h>
#include <stdlib.h>
@@ -143,6 +144,7 @@
#define VAR_NO_CONFIRM "noConfirm"
#define VAR_NO_ERROR "noError"
#define VAR_NO_WARN "noWarn"
+#define VAR_NO_USR "noUsr"
#define VAR_NONINTERACTIVE "nonInteractive"
#define VAR_NOVELL "novell"
#define VAR_NTPDATE_FLAGS "ntpdate_flags"
@@ -725,6 +727,7 @@ extern int variable_cmp(char *var, char *value);
extern void variable_unset(char *var);
extern char *variable_get_value(char *var, char *prompt);
extern int variable_check(char *data);
+extern int dump_variables(dialogMenuItem *self);
/* wizard.c */
extern void slice_wizard(Disk *d);
diff --git a/release/sysinstall/variable.c b/release/sysinstall/variable.c
index 610fb3d..2dc227a 100644
--- a/release/sysinstall/variable.c
+++ b/release/sysinstall/variable.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: variable.c,v 1.22 1998/03/10 17:24:08 jkh Exp $
+ * $Id: variable.c,v 1.23 1998/03/15 17:10:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -198,3 +198,27 @@ variable_check(char *data)
else
return getenv(tmp) ? TRUE : FALSE;
}
+
+int
+dump_variables(dialogMenuItem *unused)
+{
+ FILE *fp;
+ Variable *vp;
+
+ if (isDebug())
+ msgDebug("Writing sysinstall variables to file..");
+
+ fp = fopen("/etc/sysinstall.vars", "w");
+ if (!fp) {
+ msgConfirm("Unable to write to /etc/sysinstall.vars: %s",
+ strerror(errno));
+ return DITEM_FAILURE;
+ }
+
+ for (vp = VarHead; vp; vp = vp->next)
+ fprintf(fp, "%s=\"%s\"\n", vp->name, vp->value);
+
+ fclose(fp);
+
+ return DITEM_SUCCESS;
+}
OpenPOWER on IntegriCloud