summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-04-13 13:32:15 +0000
committerjkh <jkh@FreeBSD.org>1996-04-13 13:32:15 +0000
commit2d5b4f754ed0dd5ca6a7824a23a9c79d36da264a (patch)
tree75fa9d1786ffde4deed82bc4bb5c8264228a2aca /usr.sbin/sade
parent52978a6ce95dd0f923ee8fa236b96c972f6622d4 (diff)
downloadFreeBSD-src-2d5b4f754ed0dd5ca6a7824a23a9c79d36da264a.zip
FreeBSD-src-2d5b4f754ed0dd5ca6a7824a23a9c79d36da264a.tar.gz
1. Update all the copyrights to delete useless clauses 3 and 4.
2. Change more of the menu code over to new system. 3. Streamline label editor.
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r--usr.sbin/sade/Makefile3
-rw-r--r--usr.sbin/sade/command.c9
-rw-r--r--usr.sbin/sade/config.c53
-rw-r--r--usr.sbin/sade/devices.c13
-rw-r--r--usr.sbin/sade/disks.c98
-rw-r--r--usr.sbin/sade/dmenu.c55
-rw-r--r--usr.sbin/sade/globals.c9
-rw-r--r--usr.sbin/sade/install.c135
-rw-r--r--usr.sbin/sade/label.c99
-rw-r--r--usr.sbin/sade/main.c9
-rw-r--r--usr.sbin/sade/menus.c137
-rw-r--r--usr.sbin/sade/misc.c79
-rw-r--r--usr.sbin/sade/msg.c31
-rw-r--r--usr.sbin/sade/sade.h41
-rw-r--r--usr.sbin/sade/system.c14
-rw-r--r--usr.sbin/sade/variable.c9
16 files changed, 373 insertions, 421 deletions
diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile
index afeb135..c8bbe39 100644
--- a/usr.sbin/sade/Makefile
+++ b/usr.sbin/sade/Makefile
@@ -1,6 +1,7 @@
PROG= sysinstall
NOMAN= yes
CLEANFILES= makedevs.c rtermcap
+DEBUG_FLAGS+= -g3
.PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum
@@ -14,7 +15,7 @@ SRCS= anonFTP.c apache.c attr.c cdrom.c command.c config.c \
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog
DPADD= ${LIBDIALOG} ${LIBNCURSES} ${LIBMYTINFO} ${LIBUTIL} ${LIBDISK}
-LDADD= -ldialog -lncurses -lmytinfo -lutil -ldisk
+LDADD= /usr/src/gnu/lib/libdialog/obj/libdialog.a -lncurses -lmytinfo -lutil -ldisk
makedevs.c: Makefile rtermcap
rm -f makedevs.tmp
diff --git a/usr.sbin/sade/command.c b/usr.sbin/sade/command.c
index 225d4ec..fece9b0 100644
--- a/usr.sbin/sade/command.c
+++ b/usr.sbin/sade/command.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: command.c,v 1.12 1995/09/18 16:52:21 peter Exp $
+ * $Id: command.c,v 1.13 1995/12/07 10:33:33 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c
index 5609ad0..de74386 100644
--- a/usr.sbin/sade/config.c
+++ b/usr.sbin/sade/config.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: config.c,v 1.22 1996/03/24 18:57:34 joerg Exp $
+ * $Id: config.c,v 1.23 1996/04/07 03:52:18 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -156,7 +149,7 @@ configFstab(void)
if (!RunningAsInit) {
if (file_readable("/etc/fstab"))
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
else {
dialog_clear();
msgConfirm("Attempting to rebuild your /etc/fstab file. Warning: If you had\n"
@@ -169,7 +162,7 @@ configFstab(void)
if (!devs) {
dialog_clear();
msgConfirm("No disks found!");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
/* Record all the chunks */
@@ -199,7 +192,7 @@ configFstab(void)
dialog_clear();
msgConfirm("Unable to create a new /etc/fstab file! Manual intervention\n"
"will be required.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
/* Go for the burn */
@@ -239,7 +232,7 @@ configFstab(void)
fclose(fstab);
if (isDebug())
msgDebug("Wrote out /etc/fstab file\n");
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
/*
@@ -329,13 +322,13 @@ int
configSaverTimeout(dialogMenuItem *self)
{
return variable_get_value(VAR_BLANKTIME, "Enter time-out period in seconds for screen saver") ?
- RET_SUCCESS : RET_FAIL;
+ DITEM_SUCCESS : DITEM_FAILURE;
}
int
configNTP(dialogMenuItem *self)
{
- return variable_get_value(VAR_NTPDATE, "Enter the name of an NTP server") ? RET_SUCCESS : RET_FAIL;
+ return variable_get_value(VAR_NTPDATE, "Enter the name of an NTP server") ? DITEM_SUCCESS : DITEM_FAILURE;
}
int
@@ -343,12 +336,12 @@ configXFree86(dialogMenuItem *self)
{
if (file_executable("/usr/X11R6/bin/xf86config")) {
systemExecute("/usr/X11R6/bin/xf86config");
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
else {
msgConfirm("XFree86 does not appear to be installed! Please install\n"
"The XFree86 distribution before attempting to configure it.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
}
@@ -416,7 +409,7 @@ configRoutedFlags(dialogMenuItem *self)
{
return variable_get_value(VAR_ROUTEDFLAGS,
"Specify the flags for routed; -q is the default, -s is\n"
- "a good choice for gateway machines.") ? RET_SUCCESS : RET_FAIL;
+ "a good choice for gateway machines.") ? DITEM_SUCCESS : DITEM_FAILURE;
}
int
@@ -428,10 +421,10 @@ configPackages(dialogMenuItem *self)
int fd;
if (!mediaVerify())
- return RET_FAIL;
+ return DITEM_FAILURE;
if (!mediaDevice->init(mediaDevice))
- return RET_FAIL;
+ return DITEM_FAILURE;
if (!index_initted) {
msgNotify("Attempting to fetch packages/INDEX file from selected media.");
@@ -445,7 +438,7 @@ configPackages(dialogMenuItem *self)
"(or path to media) and try again. If your local site does not\n"
"carry the packages collection, then we recommend either a CD\n"
"distribution or the master distribution on ftp.freebsd.org.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
msgNotify("Got INDEX successfully, now building packages menu..");
index_init(&top, &plist);
@@ -454,7 +447,7 @@ configPackages(dialogMenuItem *self)
msgConfirm("I/O or format error on packages/INDEX file.\n"
"Please verify media (or path to media) and try again.");
mediaDevice->close(mediaDevice, fd);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
mediaDevice->close(mediaDevice, fd);
index_sort(&top);
@@ -471,9 +464,9 @@ configPackages(dialogMenuItem *self)
/* Now show the packing list menu */
pos = scroll = 0;
ret = index_menu(&plist, NULL, &pos, &scroll);
- if (ret == RET_DONE)
+ if (ret == DITEM_LEAVE_MENU)
break;
- else if (ret != RET_FAIL) {
+ else if (ret != DITEM_FAILURE) {
index_extract(mediaDevice, &top, &plist);
break;
}
@@ -493,7 +486,7 @@ configPackages(dialogMenuItem *self)
}
index_init(NULL, &plist);
mediaDevice->shutdown(mediaDevice);
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
@@ -518,11 +511,11 @@ configPorts(dialogMenuItem *self)
"reside in a directory with as much free space as possible,\n"
"as you'll need space to compile any ports.");
if (!cp || !*cp)
- return RET_FAIL;
+ return DITEM_FAILURE;
if (Mkdir(cp, NULL)) {
dialog_clear();
msgConfirm("Unable to make the %s directory!", cp);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
else {
if (strcmp(cp, "/usr/ports")) {
@@ -530,7 +523,7 @@ configPorts(dialogMenuItem *self)
if (symlink(cp, "/usr/ports") == -1) {
msgConfirm("Unable to create a symlink from /usr/ports to %s!\n"
"I can't continue, sorry!", cp);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
else {
msgConfirm("NOTE: This directory is also now symlinked to /usr/ports\n"
@@ -541,7 +534,7 @@ configPorts(dialogMenuItem *self)
}
}
msgNotify("Making a link tree from %s to %s.", dist, cp);
- if (lndir(dist, cp) != RET_SUCCESS) {
+ if (lndir(dist, cp) != DITEM_SUCCESS) {
dialog_clear();
msgConfirm("The lndir function returned an error status and may not have.\n"
"successfully generated the link tree. You may wish to inspect\n"
@@ -557,6 +550,6 @@ configPorts(dialogMenuItem *self)
}
}
else
- return RET_FAIL;
- return RET_SUCCESS;
+ return DITEM_FAILURE;
+ return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c
index 49b4c08..f3f615f 100644
--- a/usr.sbin/sade/devices.c
+++ b/usr.sbin/sade/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.42 1996/03/24 09:36:41 jkh Exp $
+ * $Id: devices.c,v 1.43 1996/04/07 03:52:19 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -356,7 +349,7 @@ deviceCount(Device **devs)
* menu is cloned.
*/
DMenu *
-deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)())
+deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d), int (*check)(dialogMenuItem *d))
{
Device **devs;
int numdevs;
@@ -381,7 +374,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)())
if (!device_names[j].name)
tmp->items[i].title = "<unknown device type>";
tmp->items[i].fire = hook;
- tmp->items[i].checked = NULL;
+ tmp->items[i].checked = check;
}
tmp->items[i].title = NULL;
return tmp;
diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c
index 6f8f3de..d151dac 100644
--- a/usr.sbin/sade/disks.c
+++ b/usr.sbin/sade/disks.c
@@ -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.38 1996/03/24 18:57:35 joerg Exp $
+ * $Id: disks.c,v 1.39 1996/04/07 03:52:20 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -148,7 +141,6 @@ getBootMgr(char *dname)
/* Figure out what kind of MBR the user wants */
sprintf(str, "Install Boot Manager for drive %s?", dname);
MenuMBRType.title = str;
- dialog_clear();
i = dmenuOpenSimple(&MenuMBRType);
}
else {
@@ -260,7 +252,7 @@ diskPartition(Device *dev, Disk *d)
variable_set2(DISK_PARTITIONED, "yes");
record_chunks(d);
}
- break;
+ break;
case 'B':
if (chunk_info[current_chunk]->type != freebsd)
@@ -361,7 +353,7 @@ diskPartition(Device *dev, Disk *d)
&& (mbrContents = getBootMgr(d->name)) != NULL)
Set_Boot_Mgr(d, mbrContents);
- if (diskPartitionWrite(NULL) != RET_SUCCESS) {
+ if (diskPartitionWrite(NULL) != DITEM_SUCCESS) {
dialog_clear();
msgConfirm("Disk partition write returned an error status!");
}
@@ -415,35 +407,33 @@ diskPartition(Device *dev, Disk *d)
}
static int
-partitionHook(char *str)
+partitionHook(dialogMenuItem *selected)
{
Device **devs = NULL;
+ WINDOW *w;
- /* Clip garbage off the ends */
- string_prune(str);
- str = string_skipwhite(str);
- /* Try and open all the disks */
- while (str) {
- char *cp;
-
- cp = index(str, '\n');
- if (cp)
- *cp++ = 0;
- if (!*str) {
- beep();
- return 0;
- }
- devs = deviceFind(str, DEVICE_TYPE_DISK);
- if (!devs) {
- dialog_clear();
- msgConfirm("Unable to find disk %s!", str);
- return 0;
- }
- devs[0]->enabled = TRUE;
- diskPartition(devs[0], (Disk *)devs[0]->private);
- str = cp;
+ devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK);
+ if (!devs) {
+ dialog_clear();
+ msgConfirm("Unable to find disk %s!", selected->prompt);
+ return DITEM_FAILURE;
}
- return devs ? 1 : 0;
+ devs[0]->enabled = TRUE;
+ w = savescr();
+ diskPartition(devs[0], (Disk *)devs[0]->private);
+ restorescr(w);
+ return DITEM_SUCCESS;
+}
+
+static int
+partitionCheck(dialogMenuItem *selected)
+{
+ Device **devs = NULL;
+
+ devs = deviceFind(selected->prompt, DEVICE_TYPE_DISK);
+ if (!devs || devs[0]->enabled == FALSE)
+ return FALSE;
+ return TRUE;
}
int
@@ -452,10 +442,9 @@ diskPartitionEditor(dialogMenuItem *self)
DMenu *menu;
Device **devs;
int i, cnt;
- char *cp, *str;
+ char *cp;
cp = variable_get(VAR_DISK);
- str= variable_get(SYSTEM_STATE);
devs = deviceFind(cp, DEVICE_TYPE_DISK);
cnt = deviceCount(devs);
if (!cnt) {
@@ -463,16 +452,15 @@ diskPartitionEditor(dialogMenuItem *self)
msgConfirm("No disks found! Please verify that your disk controller is being\n"
"properly probed at boot time. See the Hardware Guide on the\n"
"Documentation menu for clues on diagnosing this type of problem.");
- i = RET_FAIL;
+ i = DITEM_FAILURE;
}
else if (cnt == 1) {
devs[0]->enabled = TRUE;
diskPartition(devs[0], (Disk *)devs[0]->private);
- i = RET_SUCCESS;
- variable_set2(DISK_SELECTED, "yes");
+ i = DITEM_SUCCESS;
}
else {
- menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook);
+ menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook, partitionCheck);
if (!menu) {
dialog_clear();
msgConfirm("No devices suitable for installation found!\n\n"
@@ -480,15 +468,17 @@ diskPartitionEditor(dialogMenuItem *self)
"were detected properly. This can be done by pressing the\n"
"[Scroll Lock] key and using the Arrow keys to move back to\n"
"the boot messages. Press [Scroll Lock] again to return.");
- i = RET_FAIL;
+ i = DITEM_FAILURE;
}
else {
- if (!dmenuOpenSimple(menu))
- i = RET_FAIL;
- else {
- i = RET_SUCCESS;
- variable_set2(DISK_SELECTED, "yes");
- }
+ WINDOW *w;
+
+ w = savescr();
+ if (dmenuOpenSimple(menu))
+ i = DITEM_SUCCESS;
+ else
+ i = DITEM_FAILURE;
+ restorescr(w);
free(menu);
}
}
@@ -503,18 +493,18 @@ diskPartitionWrite(dialogMenuItem *self)
int i;
if ((cp = variable_get(DISK_PARTITIONED)) && strcmp(cp, "yes"))
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
else if (!cp) {
dialog_clear();
msgConfirm("You must partition the disk(s) before this option can be used.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
devs = deviceFind(NULL, DEVICE_TYPE_DISK);
if (!devs) {
dialog_clear();
msgConfirm("Unable to find any disks to write to??");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
for (i = 0; devs[i]; i++) {
@@ -529,7 +519,7 @@ diskPartitionWrite(dialogMenuItem *self)
if (Write_Disk(d)) {
dialog_clear();
msgConfirm("ERROR: Unable to write data to disk %s!", d->name);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
/* Now scan for bad blocks, if necessary */
for (c1 = d->chunks->part; c1; c1 = c1->next) {
@@ -552,5 +542,5 @@ diskPartitionWrite(dialogMenuItem *self)
}
/* Now it's not "yes", but "written" */
variable_set2(DISK_PARTITIONED, "written");
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sade/dmenu.c b/usr.sbin/sade/dmenu.c
index 0633e3a..1a366b0 100644
--- a/usr.sbin/sade/dmenu.c
+++ b/usr.sbin/sade/dmenu.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: dmenu.c,v 1.14 1996/03/02 07:31:51 jkh Exp $
+ * $Id: dmenu.c,v 1.15 1996/04/07 03:52:23 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -52,41 +45,52 @@ int
dmenuDisplayFile(dialogMenuItem *tmp)
{
systemDisplayHelp((char *)tmp->data);
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
dmenuSubmenu(dialogMenuItem *tmp)
{
+ WINDOW *w;
+
+ w = savescr();
dialog_clear();
- return dmenuOpenSimple((DMenu *)tmp->data);
+ (void)dmenuOpenSimple((DMenu *)tmp->data);
+ restorescr(w);
+ return DITEM_SUCCESS;
}
int
dmenuSystemCommand(dialogMenuItem *tmp)
{
- int i;
+ WINDOW *w;
- i = systemExecute((char *)tmp->data) ? RET_FAIL : RET_SUCCESS;
+ w = savescr();
+ systemExecute((char *)tmp->data);
dialog_clear();
- return i;
+ restorescr(w);
+ return DITEM_SUCCESS;
}
int
dmenuSystemCommandBox(dialogMenuItem *tmp)
{
+ WINDOW *w;
+
+ w = savescr();
use_helpfile(NULL);
use_helpline("Select OK to dismiss this dialog");
dialog_prgbox(tmp->title, (char *)tmp->data, 22, 76, 1, 1);
dialog_clear();
- return RET_SUCCESS;
+ restorescr(w);
+ return DITEM_SUCCESS;
}
int
dmenuCancel(dialogMenuItem *tmp)
{
cancelled = TRUE;
- return RET_SUCCESS;
+ return DITEM_LEAVE_MENU;
}
int
@@ -94,21 +98,24 @@ dmenuSetVariable(dialogMenuItem *tmp)
{
variable_set((char *)tmp->data);
msgInfo("Set %s", tmp->data);
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
dmenuSetFlag(dialogMenuItem *tmp)
{
- *((unsigned int *)tmp->data) |= tmp->aux;
- return RET_SUCCESS;
+ if (*((unsigned int *)tmp->data) & tmp->aux)
+ *((unsigned int *)tmp->data) &= ~tmp->aux;
+ else
+ *((unsigned int *)tmp->data) |= tmp->aux;
+ return DITEM_SUCCESS;
}
int
dmenuSetValue(dialogMenuItem *tmp)
{
*((unsigned int *)tmp->data) = tmp->aux;
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
/* Traverse menu but give user no control over positioning */
@@ -188,21 +195,23 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max)
use_helpfile(systemHelpFile(menu->helpfile, buf));
/* Pop up that dialog! */
- if (menu->type == DMENU_NORMAL_TYPE)
+ if (menu->type & DMENU_NORMAL_TYPE)
rval = dialog_menu((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
menu_height(menu, n), -n, menu->items, NULL, choice, scroll);
- else if (menu->type == DMENU_RADIO_TYPE)
+ else if (menu->type & DMENU_RADIO_TYPE)
rval = dialog_radiolist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
menu_height(menu, n), -n, menu->items, NULL);
- else if (menu->type == DMENU_CHECKLIST_TYPE)
+ else if (menu->type & DMENU_CHECKLIST_TYPE)
rval = dialog_checklist((u_char *)menu->title, (u_char *)menu->prompt, -1, -1,
menu_height(menu, n), -n, menu->items, NULL);
+ else
+ msgFatal("Menu: `%s' is of an unknown type\n", menu->title);
/* This seems to be the only technique that works for getting the display to look right */
dialog_clear();
- if (rval)
+ if (rval || menu->type & (DMENU_SELECTION_RETURNS | DMENU_RADIO_TYPE | DMENU_CHECKLIST_TYPE))
return FALSE;
else if (cancelled) {
cancelled = FALSE;
diff --git a/usr.sbin/sade/globals.c b/usr.sbin/sade/globals.c
index bc303e5..c528b63 100644
--- a/usr.sbin/sade/globals.c
+++ b/usr.sbin/sade/globals.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: globals.c,v 1.10.2.1 1995/10/21 14:06:41 jkh Exp $
+ * $Id: globals.c,v 1.11 1995/12/07 10:33:50 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index f789fd7..8a55b08 100644
--- a/usr.sbin/sade/install.c
+++ b/usr.sbin/sade/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.81 1996/03/24 18:57:36 joerg Exp $
+ * $Id: install.c,v 1.82 1996/04/07 03:52:25 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -168,12 +161,12 @@ installInitial(void)
static Boolean alreadyDone = FALSE;
if (alreadyDone)
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
if (!variable_get(DISK_LABELLED)) {
dialog_clear();
msgConfirm("You need to assign disk labels before you can proceed with\nthe installation.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
/* If it's labelled, assume it's also partitioned */
if (!variable_get(DISK_PARTITIONED))
@@ -186,25 +179,25 @@ installInitial(void)
"then WE STRONGLY ENCOURAGE YOU TO MAKE PROPER BACKUPS before\n"
"proceeding!\n\n"
"We can take no responsibility for lost disk contents!"))
- return RET_FAIL;
+ return DITEM_FAILURE;
- if (diskLabelCommit(NULL) != RET_SUCCESS) {
+ if (diskLabelCommit(NULL) != DITEM_SUCCESS) {
dialog_clear();
msgConfirm("Couldn't make filesystems properly. Aborting.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (!copySelf()) {
dialog_clear();
msgConfirm("Couldn't clone the boot floppy onto the root file system.\n"
"Aborting.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (chroot("/mnt") == -1) {
dialog_clear();
msgConfirm("Unable to chroot to /mnt - this is bad!");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
chdir("/");
@@ -215,11 +208,17 @@ installInitial(void)
systemCreateHoloshell();
alreadyDone = TRUE;
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
-installFixit(dialogMenuItem *self)
+installFixitCDROM(dialogMenuItem *self)
+{
+ return DITEM_SUCCESS;
+}
+
+int
+installFixitFloppy(dialogMenuItem *self)
{
struct ufs_args args;
pid_t child;
@@ -237,7 +236,7 @@ installFixit(dialogMenuItem *self)
break;
dialog_clear();
if (msgYesNo("Unable to mount the fixit floppy - do you want to try again?"))
- return RET_FAIL;
+ return DITEM_FAILURE;
}
dialog_clear();
dialog_update();
@@ -246,7 +245,7 @@ installFixit(dialogMenuItem *self)
if (!directory_exists("/tmp"))
(void)symlink("/mnt2/tmp", "/tmp");
if (!directory_exists("/var/tmp/vi.recover")) {
- if (Mkdir("/var/tmp/vi.recover", NULL) != RET_SUCCESS) {
+ if (Mkdir("/var/tmp/vi.recover", NULL) != DITEM_SUCCESS) {
dialog_clear();
msgConfirm("Warning: Was unable to create a /var/tmp/vi.recover directory.\n"
"vi will kvetch and moan about it as a result but should still\n"
@@ -254,7 +253,7 @@ installFixit(dialogMenuItem *self)
}
}
/* Link the spwd.db file */
- if (Mkdir("/etc", NULL) != RET_SUCCESS) {
+ if (Mkdir("/etc", NULL) != DITEM_SUCCESS) {
dialog_clear();
msgConfirm("Unable to create an /etc directory! Things are weird on this floppy..");
}
@@ -294,33 +293,33 @@ installFixit(dialogMenuItem *self)
unmount("/mnt2", MNT_FORCE);
dialog_clear();
msgConfirm("Please remove the fixit floppy now.");
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
installExpress(dialogMenuItem *self)
{
variable_set2(SYSTEM_STATE, "express");
- if (diskPartitionEditor(self) == RET_FAIL)
- return RET_FAIL;
+ if (diskPartitionEditor(self) == DITEM_FAILURE)
+ return DITEM_FAILURE;
- if (diskLabelEditor(self) == RET_FAIL)
- return RET_FAIL;
+ if (diskLabelEditor(self) == DITEM_FAILURE)
+ return DITEM_FAILURE;
if (!Dists) {
if (!dmenuOpenSimple(&MenuDistributions))
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (!mediaDevice) {
if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice)
- return RET_FAIL;
+ return DITEM_FAILURE;
}
- if (installCommit(self) == RET_FAIL)
- return RET_FAIL;
+ if (installCommit(self) == DITEM_FAILURE)
+ return DITEM_FAILURE;
- return RET_DONE;
+ return DITEM_LEAVE_MENU;
}
/* Novice mode installation */
@@ -336,8 +335,8 @@ installNovice(dialogMenuItem *self)
"by a (Q)uit. If you wish to allocate only free space to FreeBSD, move to a\n"
"partition marked \"unused\" and use the (C)reate command.");
- if (diskPartitionEditor(self) == RET_FAIL)
- return RET_FAIL;
+ if (diskPartitionEditor(self) == DITEM_FAILURE)
+ return DITEM_FAILURE;
dialog_clear();
msgConfirm("Next, you need to create BSD partitions inside of the fdisk partition(s)\n"
@@ -347,8 +346,8 @@ installNovice(dialogMenuItem *self)
"care for the layout chosen by (A)uto, press F1 for more information on\n"
"manual layout.");
- if (diskLabelEditor(self) == RET_FAIL)
- return RET_FAIL;
+ if (diskLabelEditor(self) == DITEM_FAILURE)
+ return DITEM_FAILURE;
dialog_clear();
msgConfirm("Now it is time to select an installation subset. There are a number of\n"
@@ -357,7 +356,7 @@ installNovice(dialogMenuItem *self)
"of distributions if none of the provided ones are suitable.");
while (1) {
if (!dmenuOpenSimple(&MenuDistributions))
- return RET_FAIL;
+ return DITEM_FAILURE;
if (Dists || !msgYesNo("No distributions selected. Are you sure you wish to continue?"))
break;
@@ -367,13 +366,13 @@ installNovice(dialogMenuItem *self)
dialog_clear();
msgConfirm("Finally, you must specify an installation medium.");
if (!dmenuOpenSimple(&MenuMedia) || !mediaDevice)
- return RET_FAIL;
+ return DITEM_FAILURE;
}
- if (installCommit(self) == RET_FAIL)
- return RET_FAIL;
+ if (installCommit(self) == DITEM_FAILURE)
+ return DITEM_FAILURE;
- return RET_DONE;
+ return DITEM_LEAVE_MENU;
}
/*
@@ -392,30 +391,30 @@ installCommit(dialogMenuItem *self)
char *str;
if (!mediaVerify())
- return RET_FAIL;
+ return DITEM_FAILURE;
str = variable_get(SYSTEM_STATE);
- i = RET_DONE;
+ i = DITEM_LEAVE_MENU;
if (RunningAsInit) {
- if (installInitial() == RET_FAIL)
- return RET_FAIL;
- if (configFstab() == RET_FAIL)
- return RET_FAIL;
+ if (installInitial() == DITEM_FAILURE)
+ return DITEM_FAILURE;
+ if (configFstab() == DITEM_FAILURE)
+ return DITEM_FAILURE;
if (!rootExtract()) {
dialog_clear();
msgConfirm("Failed to load the ROOT distribution. Please correct\n"
"this problem and try again.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
}
- if (distExtractAll(self) == RET_FAIL)
- i = RET_FAIL;
+ if (distExtractAll(self) == DITEM_FAILURE)
+ i = DITEM_FAILURE;
- if (installFixup(self) == RET_FAIL)
- i = RET_FAIL;
+ if (installFixup(self) == DITEM_FAILURE)
+ i = DITEM_FAILURE;
- if (i != RET_FAIL && !strcmp(str, "novice")) {
+ if (i != DITEM_FAILURE && !strcmp(str, "novice")) {
dialog_clear();
msgConfirm("Since you're running the novice installation, a few post-configuration\n"
"questions will be asked at this point. For any option you do not wish\n"
@@ -509,7 +508,7 @@ installCommit(dialogMenuItem *self)
/* Don't print this if we're express or novice installing */
if (strcmp(str, "express") && strcmp(str, "novice")) {
- if (Dists || i == RET_FAIL) {
+ if (Dists || i == DITEM_FAILURE) {
dialog_clear();
msgConfirm("Installation completed with some errors. You may wish to\n"
"scroll through the debugging messages on VTY1 with the\n"
@@ -523,7 +522,7 @@ installCommit(dialogMenuItem *self)
}
}
else if (!strcmp(str, "novice")) {
- if (Dists || i == RET_FAIL) {
+ if (Dists || i == DITEM_FAILURE) {
dialog_clear();
msgConfirm("Installation completed with some errors. You may wish to\n"
"scroll through the debugging messages on VTY1 with the\n"
@@ -541,7 +540,7 @@ installCommit(dialogMenuItem *self)
"may do so by typing: /stand/sysinstall.");
}
}
- variable_set2(SYSTEM_STATE, i == RET_FAIL ? "error-install" : "full-install");
+ variable_set2(SYSTEM_STATE, i == DITEM_FAILURE ? "error-install" : "full-install");
return i;
}
@@ -557,7 +556,7 @@ installFixup(dialogMenuItem *self)
if (vsystem("cp -p /kernel.GENERIC /kernel")) {
dialog_clear();
msgConfirm("Unable to link /kernel into place!");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
}
else {
@@ -565,7 +564,7 @@ installFixup(dialogMenuItem *self)
msgConfirm("Can't find a kernel image to link to on the root file system!\n"
"You're going to have a hard time getting this system to\n"
"boot from the hard disk, I'm afraid!");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
}
/* Resurrect /dev after bin distribution screws it up */
@@ -574,7 +573,7 @@ installFixup(dialogMenuItem *self)
if (vsystem("cd /dev; sh MAKEDEV all")) {
dialog_clear();
msgConfirm("MAKEDEV returned non-zero status");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
msgNotify("Resurrecting /dev entries for slices..");
@@ -597,7 +596,7 @@ installFixup(dialogMenuItem *self)
if (vsystem("cd /dev; sh MAKEDEV %sh", c1->name)) {
dialog_clear();
msgConfirm("Unable to make slice entries for %s!", c1->name);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
}
}
@@ -622,7 +621,7 @@ installFixup(dialogMenuItem *self)
vsystem("mtree -deU -f /etc/mtree/BSD.var.dist -p /var");
vsystem("mtree -deU -f /etc/mtree/BSD.usr.dist -p /usr");
}
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
/* Go newfs and/or mount all the filesystems we've been asked to */
@@ -641,7 +640,7 @@ installFilesystems(dialogMenuItem *self)
str = variable_get(SYSTEM_STATE);
if (!checkLabels(&rootdev, &swapdev, &usrdev))
- return RET_FAIL;
+ return DITEM_FAILURE;
root = (PartInfo *)rootdev->private_data;
command_clear();
@@ -653,7 +652,7 @@ installFilesystems(dialogMenuItem *self)
dialog_clear();
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (!swapon(dname))
msgNotify("Added %s as initial swap device", dname);
@@ -668,7 +667,7 @@ installFilesystems(dialogMenuItem *self)
dialog_clear();
msgConfirm("Unable to make device node for %s in /dev!\n"
"The creation of filesystems will be aborted.", dname);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (strcmp(root->mountpoint, "/")) {
@@ -685,7 +684,7 @@ installFilesystems(dialogMenuItem *self)
dialog_clear();
msgConfirm("Unable to make new root filesystem on %s!\n"
"Command returned status %d", dname, i);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
}
else {
@@ -707,7 +706,7 @@ installFilesystems(dialogMenuItem *self)
if (Mount("/mnt", dname)) {
dialog_clear();
msgConfirm("Unable to mount the root file system on %s! Giving up.", dname);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
/* Now buzz through the rest of the partitions and mount them too */
@@ -720,7 +719,7 @@ installFilesystems(dialogMenuItem *self)
if (!disk->chunks) {
dialog_clear();
msgConfirm("No chunk list found for %s!", disk->name);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (root->newfs || upgrade) {
Mkdir("/mnt/dev", NULL);
@@ -774,12 +773,12 @@ installFilesystems(dialogMenuItem *self)
if ((root->newfs || upgrade) && vsystem("find -x /dev | cpio -pdumv /mnt")) {
dialog_clear();
msgConfirm("Couldn't clone the /dev files!");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
command_sort();
command_execute();
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
@@ -802,7 +801,7 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(SYSTEM_STATE, "update");
else
variable_set2(SYSTEM_STATE, "init");
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
/* Copy the boot floppy contents into /stand */
diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c
index 774a329..7b930c7 100644
--- a/usr.sbin/sade/label.c
+++ b/usr.sbin/sade/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.40 1996/03/24 18:57:37 joerg Exp $
+ * $Id: label.c,v 1.41 1996/04/07 03:52:30 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -82,47 +75,14 @@ static int here;
static int diskLabel(char *str);
-static int
-labelHook(char *str)
-{
- Device **devs = NULL;
-
- /* Clip garbage off the ends */
- string_prune(str);
- str = string_skipwhite(str);
- /* Try and open all the disks */
- while (str) {
- char *cp;
-
- cp = index(str, '\n');
- if (cp)
- *cp++ = 0;
- if (!*str) {
- beep();
- return 0;
- }
- devs = deviceFind(str, DEVICE_TYPE_DISK);
- if (!devs) {
- dialog_clear();
- msgConfirm("Unable to find disk %s!", str);
- return 0;
- }
- devs[0]->enabled = TRUE;
- str = cp;
- }
- return devs ? 1 : 0;
-}
-
int
diskLabelEditor(dialogMenuItem *self)
{
Device **devs;
- DMenu *menu;
- int i, cnt;
- char *cp, *str;
+ int i, cnt, enabled;
+ char *cp;
cp = variable_get(VAR_DISK);
- str = variable_get(SYSTEM_STATE);
devs = deviceFind(cp, DEVICE_TYPE_DISK);
cnt = deviceCount(devs);
if (!cnt) {
@@ -130,32 +90,20 @@ diskLabelEditor(dialogMenuItem *self)
msgConfirm("No disks found! Please verify that your disk controller is being\n"
"properly probed at boot time. See the Hardware Guide on the\n"
"Documentation menu for clues on diagnosing this type of problem.");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
- else if (cnt == 1 || variable_get(DISK_SELECTED)) {
- if (cnt == 1)
- devs[0]->enabled = TRUE;
- i = diskLabel(str);
+ for (i = 0, enabled = 0; i < cnt; i++) {
+ if (devs[i]->enabled)
+ ++enabled;
}
- else {
- menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, labelHook);
- if (!menu) {
- dialog_clear();
- msgConfirm("No devices suitable for installation found!\n\n"
- "Please verify that your disk controller (and attached drives)\n"
- "were detected properly. This can be done by pressing the\n"
- "[Scroll Lock] key and using the Arrow keys to move back to\n"
- "the boot messages. Press [Scroll Lock] again to return.");
- i = RET_FAIL;
- }
- else {
- if (!dmenuOpenSimple(menu))
- i = RET_FAIL;
- else
- i = diskLabel(str);
- free(menu);
- }
+ if (!enabled) {
+ devs[0]->enabled = TRUE;
+ if (diskPartitionEditor(self) == DITEM_FAILURE)
+ return DITEM_FAILURE;
}
+ i = diskLabel(devs[0]->name);
+ if (i != DITEM_FAILURE)
+ variable_set2(DISK_LABELLED, "yes");
return i;
}
@@ -168,22 +116,22 @@ diskLabelCommit(dialogMenuItem *self)
/* Already done? */
if ((cp = variable_get(DISK_LABELLED)) && strcmp(cp, "yes")) {
variable_set2(DISK_PARTITIONED, "yes");
- i = RET_SUCCESS;
+ i = DITEM_SUCCESS;
}
else if (!cp) {
dialog_clear();
msgConfirm("You must assign disk labels before this option can be used.");
- i = RET_FAIL;
+ i = DITEM_FAILURE;
}
/* The routine will guard against redundant writes, just as this one does */
- else if (diskPartitionWrite(self) != RET_SUCCESS)
- i = RET_FAIL;
- else if (installFilesystems(self) != RET_SUCCESS)
- i = RET_FAIL;
+ else if (diskPartitionWrite(self) != DITEM_SUCCESS)
+ i = DITEM_FAILURE;
+ else if (installFilesystems(self) != DITEM_SUCCESS)
+ i = DITEM_FAILURE;
else {
msgInfo("All filesystem information written successfully.");
variable_set2(DISK_LABELLED, "written");
- i = RET_SUCCESS;
+ i = DITEM_SUCCESS;
}
return i;
}
@@ -522,7 +470,7 @@ diskLabel(char *str)
if (!devs) {
dialog_clear();
msgConfirm("No disks found!");
- return RET_FAIL;
+ return DITEM_FAILURE;
}
labeling = TRUE;
@@ -878,7 +826,6 @@ diskLabel(char *str)
break;
variable_unset(DISK_PARTITIONED);
for (i = 0; devs[i]; i++) {
- extern void diskPartition(Device *dev, Disk *d);
Disk *d;
if (!devs[i]->enabled)
@@ -945,5 +892,5 @@ diskLabel(char *str)
}
}
dialog_clear();
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c
index 9810b48..f956d13 100644
--- a/usr.sbin/sade/main.c
+++ b/usr.sbin/sade/main.c
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated for what's essentially a complete rewrite.
*
- * $Id: main.c,v 1.15 1995/12/07 10:33:55 peter Exp $
+ * $Id: main.c,v 1.16 1996/04/07 03:52:31 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c
index 14edc86..b50d77b 100644
--- a/usr.sbin/sade/menus.c
+++ b/usr.sbin/sade/menus.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: menus.c,v 1.48 1996/04/03 06:55:09 jkh Exp $
+ * $Id: menus.c,v 1.49 1996/04/07 03:52:33 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -66,13 +59,31 @@ option by pressing [ENTER].", /* prompt */
{ "Novice", "Begin a novice installation (for beginners)", NULL, installNovice },
{ "Express", "Begin a quick installation (for the impatient)", NULL, installExpress },
{ "Custom", "Begin a custom installation (for experts)", NULL, dmenuSubmenu, NULL, &MenuInstallCustom },
- { "Fixit", "Mount fixit floppy and go into repair mode", NULL, installFixit },
+ { "Fixit", "Go into repair mode with CDROM or floppy", NULL, dmenuSubmenu, NULL, &MenuFixit },
{ "Upgrade", "Upgrade an existing 2.0.5 system", NULL, installUpgrade },
{ "Configure","Do post-install configuration of FreeBSD", NULL, dmenuSubmenu, NULL, &MenuConfigure },
{ "Quit", "Exit this menu (and the installation)", NULL },
{ NULL } },
};
+DMenu MenuFixit = {
+ DMENU_NORMAL_TYPE,
+ "Please choose a fixit option",
+"There are two ways of going into \"fixit\" mode - you may either elect\n\
+to use the 2nd FreeBSD CDROM, in which case there will be full access\n\
+access to the complete set of FreeBSD commands and utilities, or you\n\
+can use the more limited fixit floppy if you don't have a CDROM or are\n\
+somehow faced with a situation where a CDROM is impractical. The fixit\n\
+floppy has only a minimal subset of commands which we deemed most useful\n\
+for fixing a system in trouble.",
+ "Press F1 for more detailed repair instructions",
+ "fixit",
+{ { "CDROM", "Use the 2nd \"live\" CDROM from the distribution", NULL, installFixitCDROM },
+ { "Floppy", "Use a floppy generated from the fixit image", NULL, installFixitFloppy },
+ { NULL } },
+};
+
+
/* The main documentation menu */
DMenu MenuDocumentation = {
DMENU_NORMAL_TYPE,
@@ -95,7 +106,7 @@ consult the README file.",
};
DMenu MenuMouse = {
- DMENU_NORMAL_TYPE,
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Please select your mouse type from the following menu",
"There are many different types of mice currently on the market,\n\
but this configuration menu should at least narrow down the choices\n\
@@ -116,7 +127,7 @@ on building a kernel.",
};
DMenu MenuMediaCDROM = {
- DMENU_NORMAL_TYPE,
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a CDROM type",
"FreeBSD can be installed directly from a CDROM containing a valid\n\
FreeBSD distribution. If you are seeing this menu it is because\n\
@@ -128,7 +139,7 @@ of the following CDROM drives as your installation drive.",
};
DMenu MenuMediaFloppy = {
- DMENU_NORMAL_TYPE,
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a Floppy drive",
"You have more than one floppy drive. Please chose the drive\n\
you would like to use for this operation",
@@ -138,7 +149,7 @@ you would like to use for this operation",
};
DMenu MenuMediaDOS = {
- DMENU_NORMAL_TYPE,
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a DOS partition",
"FreeBSD can be installed directly from a DOS partition\n\
assuming, of course, that you have copied the relevant\n\
@@ -154,7 +165,7 @@ distribution files.",
};
DMenu MenuMediaFTP = {
- DMENU_NORMAL_TYPE,
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Please select a FreeBSD FTP distribution site",
"Please select the site closest to you or \"other\" if you'd like to\n\
specify a different choice. Also note that not every site listed here\n\
@@ -276,7 +287,7 @@ guaranteed to carry the full range of possible distributions.",
};
DMenu MenuMediaTape = {
- DMENU_NORMAL_TYPE,
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Choose a tape drive type",
"FreeBSD can be installed from tape drive, though this installation\n\
method requires a certain amount of temporary storage in addition\n\
@@ -290,7 +301,7 @@ select one of the following tape devices detected on your system.",
};
DMenu MenuNetworkDevice = {
- DMENU_NORMAL_TYPE,
+ DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Network interface information required",
"If you are using PPP over a serial device (cuaa0 or cuaa1) as opposed\n\
to a direct ethernet connection, then you may first need to dial your\n\
@@ -308,7 +319,7 @@ for an ethernet installation.",
/* The media selection menu */
DMenu MenuMedia = {
- DMENU_NORMAL_TYPE,
+ DMENU_RADIO_TYPE,
"Choose Installation Media",
"FreeBSD can be installed from a variety of different installation\n\
media, ranging from floppies to an Internet FTP server. If you're\n\
@@ -317,14 +328,14 @@ the best media to use if you have no overriding reason for using other\n\
media.",
"Press F1 for more information on the various media types",
"media",
-{ { "CDROM", "Install from a FreeBSD CDROM", NULL, mediaSetCDROM },
- { "DOS", "Install from a DOS partition", NULL, mediaSetDOS },
+{ { "CDROM", "Install from a FreeBSD CDROM", NULL, mediaSetCDROM },
+ { "DOS", "Install from a DOS partition", NULL, mediaSetDOS },
{ "File System", "Install from an existing filesystem", NULL, mediaSetUFS },
- { "Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy },
- { "FTP", "Install from an FTP server", NULL, mediaSetFTPActive },
+ { "Floppy", "Install from a floppy disk set", NULL, mediaSetFloppy },
+ { "FTP", "Install from an FTP server", NULL, mediaSetFTPActive },
{ "FTP Passive", "Install from an FTP server through a firewall", NULL, mediaSetFTPPassive },
- { "NFS", "Install over NFS", NULL, mediaSetNFS },
- { "Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape },
+ { "NFS", "Install over NFS", NULL, mediaSetNFS },
+ { "Tape", "Install from SCSI or QIC tape", NULL, mediaSetTape },
{ NULL } },
};
@@ -334,19 +345,30 @@ DMenu MenuDistributions = {
"Choose Distributions",
"As a convenience, we provide several \"canned\" distribution sets.\n\
These select what we consider to be the most reasonable defaults for the\n\
-type of system in question. If you would prefer to pick and choose\n\
-the list of distributions yourself, simply select \"Custom\".",
+type of system in question. If you would prefer to pick and choose the\n\
+list of distributions yourself, simply select \"Custom\". You can also\n\
+add distribution sets together by picking more than one, fine-tuning the\n\
+final results with the Custom item. When you are finished, select Cancel",
"Press F1 for more information on these options.",
"distributions",
-{ { "Developer", "Full sources, binaries and doc but no games [180MB]", NULL, distSetDeveloper },
- { "X-Developer", "Same as above, but includes XFree86 [201MB]", NULL, distSetXDeveloper },
- { "Kern-Developer", "Full binaries and doc, kernel sources only [70MB]", NULL, distSetKernDeveloper },
- { "User", "Average user - binaries and doc but no sources [52MB]", NULL, distSetUser },
- { "X-User", "Same as above, but includes XFree86 [52MB]", NULL, distSetXUser },
- { "Minimal", "The smallest configuration possible [44MB]", NULL, distSetMinimum },
- { "Everything", "All sources, binaries and XFree86 binaries [700MB]", NULL, distSetEverything },
- { "Custom", "Specify your own distribution set [?]", NULL, dmenuSubmenu, NULL, &MenuSubDistributions },
- { "Clear", "Reset selected distribution list to None", NULL, distReset },
+{ { "Developer", "Full sources, binaries and doc but no games [180MB]",
+ NULL, distSetDeveloper },
+ { "X-Developer", "Same as above, but includes XFree86 [201MB]",
+ NULL, distSetXDeveloper },
+ { "Kern-Developer", "Full binaries and doc, kernel sources only [70MB]",
+ NULL, distSetKernDeveloper },
+ { "User", "Average user - binaries and doc but no sources [52MB]",
+ NULL, distSetUser },
+ { "X-User", "Same as above, but includes XFree86 [52MB]",
+ NULL, distSetXUser },
+ { "Minimal", "The smallest configuration possible [44MB]",
+ NULL, distSetMinimum },
+ { "Everything", "All sources, binaries and XFree86 binaries [700MB]",
+ NULL, distSetEverything },
+ { "Custom", "Specify your own distribution set [?]",
+ NULL, dmenuSubmenu, NULL, &MenuSubDistributions },
+ { "Clear", "Reset selected distribution list to None",
+ NULL, distReset },
{ NULL } },
};
@@ -378,7 +400,7 @@ DES distribution out of the U.S.! It is for U.S. customers only.",
NULL,
{ { "bin", "Binary base distribution (required) [36MB]",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BIN },
- { "commercial", "Commercial and shareware demos [10MB]",
+ { "commerce", "Commercial and shareware demos [10MB]",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMMERCIAL },
{ "compat1x", "FreeBSD 1.x binary compatibility [2MB]",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT1X },
@@ -404,7 +426,7 @@ DES distribution out of the U.S.! It is for U.S. customers only.",
srcFlagCheck, distSetSrc },
{ "XFree86", "The XFree86 3.1.2-S distribution",
x11FlagCheck, distSetXF86 },
- { "Experimental", "Work in progress!",
+ { "xperimnt", "Experimental work in progress!",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_EXPERIMENTAL },
{ NULL } },
};
@@ -479,22 +501,44 @@ clearx11(dialogMenuItem *self)
XF86ServerDists = 0;
XF86FontDists = 0;
Dists &= ~DIST_XF86;
- return 0;
+ return DITEM_REDRAW;
}
+static int
+checkx11Basic(dialogMenuItem *self)
+{
+ return XF86Dists;
+}
+
+static int
+checkx11Servers(dialogMenuItem *self)
+{
+ return XF86ServerDists;
+}
+
+static int
+checkx11Fonts(dialogMenuItem *self)
+{
+ return XF86FontDists;
+}
+
+
DMenu MenuXF86Select = {
- DMENU_NORMAL_TYPE,
+ DMENU_CHECKLIST_TYPE,
"XFree86 3.1.2-S Distribution",
"Please select the components you need from the XFree86 3.1.2-S\n\
distribution. We recommend that you select what you need from the basic\n\
component set and at least one entry from the Server and Font set menus.",
"Press F1 to read the XFree86 release notes for FreeBSD",
"XF86",
-{ { "Basic", "Basic component menu (required)", NULL, dmenuSubmenu, NULL, &MenuXF86SelectCore },
- { "Server", "X server menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer },
- { "Fonts", "Font set menu", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts },
- { "Exit", "Exit this menu (returning to previous)", NULL, dmenuCancel },
- { "Clear", "Reset XFree86 distribution list", NULL, clearx11 },
+{ { "Basic", "Basic component menu (required)",
+ checkx11Basic, dmenuSubmenu, NULL, &MenuXF86SelectCore },
+ { "Server", "X server menu",
+ checkx11Servers, dmenuSubmenu, NULL, &MenuXF86SelectServer },
+ { "Fonts", "Font set menu",
+ checkx11Fonts, dmenuSubmenu, NULL, &MenuXF86SelectFonts },
+ { "Clear", "Reset XFree86 distribution list",
+ NULL, clearx11 },
{ NULL } },
};
@@ -602,7 +646,8 @@ this operation. If you are attempting to install a boot partition\n\
on a drive other than the first one or have multiple operating\n\
systems on your machine, you will have the option to install a boot\n\
manager later. To select a drive, use the arrow keys to move to it\n\
-and press [SPACE].",
+and press [SPACE]. When you're finished, select Cancel to go on to\n\
+the next step.",
"Press F1 for important information regarding disk geometry!",
"drives",
{ { NULL } },
@@ -661,9 +706,9 @@ DMenu MenuMBRType = {
{ { "BootMgr", "Install the FreeBSD Boot Manager (\"Booteasy\")",
dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr },
{ "Standard", "Install a standard MBR (no boot manager)",
- dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '[', '*', ']', 1 },
+ dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 1 },
{ "None", "Leave the Master Boot Record untouched",
- dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '[', '*', ']', 2 },
+ dmenuRadioCheck, dmenuSetValue, NULL, &BootMgr, '(', '*', ')', 2 },
{ NULL } },
};
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index 296daf7..64b46eb 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.14 1996/01/14 21:48:57 phk Exp $
+ * $Id: misc.c,v 1.15 1996/03/18 15:28:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -16,13 +16,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -205,32 +198,41 @@ safe_realloc(void *orig, size_t size)
* for dialog_menu().
*/
-/* Add a string to an item list */
-char **
-item_add(char **list, char *item, int *curr, int *max)
+/* Add an item to an item list */
+dialogMenuItem *
+item_add(dialogMenuItem *list, char *prompt, char *title,
+ int (*checked)(dialogMenuItem *self),
+ int (*fire)(dialogMenuItem *self),
+ void (*selected)(dialogMenuItem *self, int is_selected),
+ void *data, int aux, int *curr, int *max)
{
+ dialogMenuItem *d;
if (*curr == *max) {
*max += 20;
- list = (char **)realloc(list, sizeof(char *) * *max);
+ list = (dialogMenuItem *)realloc(list, sizeof(dialogMenuItem) * *max);
}
- list[(*curr)++] = item;
- return list;
-}
-
-/* Add a pair of items to an item list (more the usual case) */
-char **
-item_add_pair(char **list, char *item1, char *item2, int *curr, int *max)
-{
- list = item_add(list, item1, curr, max);
- list = item_add(list, item2, curr, max);
+ d = &list[(*curr)++];
+ d->prompt = prompt ? strdup(prompt) : NULL;
+ d->title = title ? strdup(title) : NULL;
+ d->checked = checked;
+ d->fire = fire;
+ d->selected = selected;
+ d->data = data;
+ d->aux = aux;
return list;
}
/* Toss the items out */
void
-items_free(char **list, int *curr, int *max)
+items_free(dialogMenuItem *list, int *curr, int *max)
{
+ int i;
+
+ for (i = 0; list[i].prompt; i++) {
+ safe_free(list[i].prompt);
+ safe_free(list[i].title);
+ }
safe_free(list);
*curr = *max = 0;
}
@@ -243,7 +245,7 @@ Mkdir(char *ipath, void *data)
char *p, *path;
if (file_readable(ipath))
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
path = strdup(ipath);
if (isDebug())
@@ -261,20 +263,20 @@ Mkdir(char *ipath, void *data)
if (errno != ENOENT) {
dialog_clear();
msgConfirm("Couldn't stat directory %s: %s", path, strerror(errno));
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (isDebug())
msgDebug("mkdir(%s..)\n", path);
if (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) < 0) {
dialog_clear();
msgConfirm("Couldn't create directory %s: %s", path,strerror(errno));
- return RET_FAIL;
+ return DITEM_FAILURE;
}
}
*p = '/';
}
free(path);
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
@@ -297,7 +299,7 @@ Mount(char *mountp, void *dev)
if (Mkdir(mountpoint, NULL)) {
dialog_clear();
msgConfirm("Unable to make directory mountpoint for %s!", mountpoint);
- return RET_FAIL;
+ return DITEM_FAILURE;
}
if (isDebug())
msgDebug("mount %s %s\n", device, mountpoint);
@@ -306,7 +308,24 @@ Mount(char *mountp, void *dev)
if (mount(MOUNT_UFS, mountpoint, MNT_ASYNC, (caddr_t)&ufsargs) == -1) {
dialog_clear();
msgConfirm("Error mounting %s on %s : %s", device, mountpoint, strerror(errno));
- return RET_FAIL;
+ return DITEM_FAILURE;
}
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
+}
+
+WINDOW *
+savescr(void)
+{
+ WINDOW *w;
+
+ w = dupwin(newscr);
+ return w;
+}
+
+void
+restorescr(WINDOW *w)
+{
+ touchwin(w);
+ wrefresh(w);
+ delwin(w);
}
diff --git a/usr.sbin/sade/msg.c b/usr.sbin/sade/msg.c
index ae5e3f3..a569169 100644
--- a/usr.sbin/sade/msg.c
+++ b/usr.sbin/sade/msg.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: msg.c,v 1.29.2.8 1995/10/22 21:38:17 jkh Exp $
+ * $Id: msg.c,v 1.30 1995/12/07 10:34:09 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -214,16 +207,14 @@ msgConfirm(char *fmt, ...)
va_end(args);
use_helpline(NULL);
use_helpfile(NULL);
- w = dupwin(newscr);
+ w = savescr();
if (OnVTY) {
msgDebug("Switching back to VTY1\n");
ioctl(0, VT_ACTIVATE, 1);
msgInfo(NULL);
}
dialog_notify(errstr);
- touchwin(w);
- wrefresh(w);
- delwin(w);
+ restorescr(w);
free(errstr);
}
@@ -262,16 +253,14 @@ msgYesNo(char *fmt, ...)
va_end(args);
use_helpline(NULL);
use_helpfile(NULL);
- w = dupwin(newscr);
+ w = savescr();
if (OnVTY) {
msgDebug("Switching back to VTY1\n");
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
- touchwin(w);
- wrefresh(w);
- delwin(w);
+ restorescr(w);
free(errstr);
return ret;
}
@@ -296,16 +285,14 @@ msgGetInput(char *buf, char *fmt, ...)
strcpy(input_buffer, buf);
else
input_buffer[0] = '\0';
- w = dupwin(newscr);
+ w = savescr();
if (OnVTY) {
msgDebug("Switching back to VTY1\n");
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
rval = dialog_inputbox("Value Required", errstr, -1, -1, input_buffer);
- touchwin(w);
- wrefresh(w);
- delwin(w);
+ restorescr(w);
free(errstr);
if (!rval)
return input_buffer;
@@ -357,12 +344,12 @@ int
msgSimpleConfirm(char *str)
{
msgConfirm(str);
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
int
msgSimpleNotify(char *str)
{
msgNotify(str);
- return RET_SUCCESS;
+ return DITEM_SUCCESS;
}
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index c420f40..353da90 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.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.48 1996/03/23 07:21:31 jkh Exp $
+ * $Id: sysinstall.h,v 1.49 1996/04/07 03:52:35 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -67,10 +60,6 @@
#define INTERFACE_MAX 50 /* Maximum number of network interfaces we'll deal with */
#define MAX_FTP_RETRIES "4" /* How many times to beat our heads against the wall */
-#define RET_FAIL -1
-#define RET_SUCCESS 0
-#define RET_DONE 1
-
/*
* I make some pretty gross assumptions about having a max of 50 chunks
* total - 8 slices and 42 partitions. I can't easily display many more
@@ -145,10 +134,14 @@ typedef unsigned int Boolean;
typedef struct disk Disk;
typedef struct chunk Chunk;
-typedef enum { DMENU_NORMAL_TYPE, DMENU_RADIO_TYPE, DMENU_CHECKLIST_TYPE } dmenuType;
+/* Bitfields for menu options */
+#define DMENU_NORMAL_TYPE 0x1 /* Normal dialog menu */
+#define DMENU_RADIO_TYPE 0x2 /* Radio dialog menu */
+#define DMENU_CHECKLIST_TYPE 0x4 /* Multiple choice menu */
+#define DMENU_SELECTION_RETURNS 0x8 /* Immediate return on item selection */
typedef struct _dmenu {
- dmenuType type; /* What sort of menu we are */
+ int type; /* What sort of menu we are */
char *title; /* Our title */
char *prompt; /* Our prompt */
char *helpline; /* Line of help at bottom */
@@ -292,6 +285,7 @@ extern int BootMgr; /* Which boot manager to use */
extern DMenu MenuInitial; /* Initial installation menu */
+extern DMenu MenuFixit; /* Fixit repair menu */
extern DMenu MenuMBRType; /* Type of MBR to write on the disk */
extern DMenu MenuConfigure; /* Final configuration menu */
extern DMenu MenuDocumentation; /* Documentation menu */
@@ -366,7 +360,8 @@ extern int configRoutedFlags(dialogMenuItem *self);
extern int crc(int, unsigned long *, unsigned long *);
/* devices.c */
-extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)());
+extern DMenu *deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)(dialogMenuItem *d),
+ int (*check)(dialogMenuItem *d));
extern void deviceGetAll(void);
extern Device **deviceFind(char *name, DeviceType type);
extern int deviceCount(Device **devs);
@@ -383,6 +378,7 @@ extern void dummyShutdown(Device *dev);
/* disks.c */
extern int diskPartitionEditor(dialogMenuItem *self);
extern int diskPartitionWrite(dialogMenuItem *self);
+extern void diskPartition(Device *dev, Disk *d);
/* dist.c */
extern int distSetCustom(char *str);
@@ -452,7 +448,8 @@ int index_extract(Device *dev, PkgNodePtr top, PkgNodePtr plist);
extern int installCommit(dialogMenuItem *self);
extern int installExpress(dialogMenuItem *self);
extern int installNovice(dialogMenuItem *self);
-extern int installFixit(dialogMenuItem *self);
+extern int installFixitCDROM(dialogMenuItem *self);
+extern int installFixitFloppy(dialogMenuItem *self);
extern int installFixup(dialogMenuItem *self);
extern int installUpgrade(dialogMenuItem *self);
extern int installFilesystems(dialogMenuItem *self);
@@ -520,12 +517,16 @@ extern char *pathBaseName(const char *path);
extern void safe_free(void *ptr);
extern void *safe_malloc(size_t size);
extern void *safe_realloc(void *orig, size_t size);
-extern char **item_add(char **list, char *item, int *curr, int *max);
-extern char **item_add_pair(char **list, char *item1, char *item2,
- int *curr, int *max);
-extern void items_free(char **list, int *curr, int *max);
+extern dialogMenuItem *item_add(dialogMenuItem *list, char *prompt, char *title,
+ int (*checked)(dialogMenuItem *self),
+ int (*fire)(dialogMenuItem *self),
+ void (*selected)(dialogMenuItem *self, int is_selected),
+ void *data, int aux, int *curr, int *max);
+extern void items_free(dialogMenuItem *list, int *curr, int *max);
extern int Mkdir(char *, void *data);
extern int Mount(char *, void *data);
+extern WINDOW *savescr(void);
+extern void restorescr(WINDOW *w);
/* msg.c */
extern Boolean isDebug(void);
diff --git a/usr.sbin/sade/system.c b/usr.sbin/sade/system.c
index 3622f90..14f125a 100644
--- a/usr.sbin/sade/system.c
+++ b/usr.sbin/sade/system.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: system.c,v 1.48 1996/03/18 15:28:08 jkh Exp $
+ * $Id: system.c,v 1.49 1996/03/21 09:30:17 jkh Exp $
*
* Jordan Hubbard
*
@@ -129,21 +129,17 @@ systemDisplayHelp(char *file)
snprintf(buf, FILENAME_MAX, "The %s file is not provided on this particular floppy image.", file);
use_helpfile(NULL);
use_helpline(NULL);
- w = dupwin(newscr);
+ w = savescr();
dialog_mesgbox("Sorry!", buf, -1, -1);
- touchwin(w);
- wrefresh(w);
- delwin(w);
+ restorescr(w);
return 1;
}
else {
use_helpfile(NULL);
use_helpline(NULL);
- w = dupwin(newscr);
+ w = savescr();
dialog_textbox(file, fname, LINES, COLS);
- touchwin(w);
- wrefresh(w);
- delwin(w);
+ restorescr(w);
}
return 0;
}
diff --git a/usr.sbin/sade/variable.c b/usr.sbin/sade/variable.c
index 5cbaa84..6fbd643 100644
--- a/usr.sbin/sade/variable.c
+++ b/usr.sbin/sade/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.6.2.7 1995/10/26 08:56:18 jkh Exp $
+ * $Id: variable.c,v 1.7 1995/12/07 10:34:23 peter Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -19,13 +19,6 @@
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by Jordan Hubbard
- * for the FreeBSD Project.
- * 4. The name of Jordan Hubbard or the FreeBSD project may not be used to
- * endorse or promote products derived from this software without specific
- * prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY JORDAN HUBBARD ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
OpenPOWER on IntegriCloud