diff options
author | jkh <jkh@FreeBSD.org> | 1995-05-17 14:40:00 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-05-17 14:40:00 +0000 |
commit | 51db685ce5136b113343b379f9e1ff5110ce2097 (patch) | |
tree | 3c4b835b80329341731037a431c9a5964fa0a92e | |
parent | 795504cd3724527d413d54f657c8c077ca836b59 (diff) | |
download | FreeBSD-src-51db685ce5136b113343b379f9e1ff5110ce2097.zip FreeBSD-src-51db685ce5136b113343b379f9e1ff5110ce2097.tar.gz |
Commit my latest so that Gary can sync up - this version should also
be the grounds for our first round of testing in the release I'm rolling.
It doesn't load the distributions yet, but it should do everything else.
38 files changed, 609 insertions, 501 deletions
diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile index 4b18445..949b57d 100644 --- a/release/sysinstall/Makefile +++ b/release/sysinstall/Makefile @@ -9,7 +9,7 @@ SRCS= globals.c main.c dmenu.c menus.c \ termcap.c makedevs.c media.c variable.c \ devices.c dist.c lang.c wizard.c \ disks.c command.c decode.c label.c \ - tcpip.c + tcpip.c media_strategy.c CFLAGS+= -Wall -g -I${.CURDIR}/../libdisk \ -I${.CURDIR}/../../gnu/lib/libdialog @@ -30,13 +30,13 @@ BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot .endif makedevs.c: dev2c.sh Makefile rtermcap -# mkdir -p dev -# cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev -# ( cd dev; sh ./MAKEDEV all ) -# sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp -# rm -rf dev rm -f makedevs.tmp + mkdir -p dev echo '#include <sys/types.h>' > makedevs.tmp + cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev + ( cd dev; sh ./MAKEDEV all ) + sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp + rm -rf dev uudecode < ${.CURDIR}/bteasy17.uu file2c 'const unsigned char boot0[] = {' '};' \ < bteasy17 >> makedevs.tmp diff --git a/release/sysinstall/decode.c b/release/sysinstall/decode.c index a3d965f..1297fd6 100644 --- a/release/sysinstall/decode.c +++ b/release/sysinstall/decode.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: decode.c,v 1.2 1995/05/11 06:10:43 jkh Exp $ + * $Id: decode.c,v 1.3 1995/05/16 02:52:57 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -99,7 +99,6 @@ dispatch(DMenuItem *tmp, char *name) case DMENU_SET_VARIABLE: variable_set((char *)tmp->ptr); - msgInfo("Setting option %s", tmp->ptr); break; case DMENU_SET_FLAG: diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c index 893b1b1..091bac7 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.15 1995/05/16 02:53:00 jkh Exp $ + * $Id: devices.c,v 1.16 1995/05/16 11:37:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -91,10 +91,11 @@ static struct { { DEVICE_TYPE_TAPE, "wt0", "Wangtek tape drive" }, { DEVICE_TYPE_DISK, "sd", "SCSI disk device" }, { DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" }, + { DEVICE_TYPE_FLOPPY, "fd0a", "Floppy disk drive (unit A)" }, + { DEVICE_TYPE_FLOPPY, "fd1a", "Floppy disk drive (unit B)" }, { DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" }, { DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" }, { DEVICE_TYPE_NETWORK, "ppp", "Point-to-Point Protocol (PPP) interface" }, - { DEVICE_TYPE_NETWORK, "tun", "Tunneling IP driver (not for direct use)" }, { DEVICE_TYPE_NETWORK, "ed", "WD/SMC 80xx; Novell NE1000/2000; 3Com 3C503 cards" }, { DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 interface card" }, { DEVICE_TYPE_NETWORK, "el", "3Com 3C501 interface card" }, @@ -210,13 +211,28 @@ deviceGetAll(void) Devices[numDevs]->get = mediaGetTape; Devices[numDevs]->close = mediaCloseTape; Devices[numDevs]->private = NULL; - msgDebug("Found a device of type TAPE named: %s\n", - device_names[i].name); + msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name); ++numDevs; } break; case DEVICE_TYPE_FLOPPY: + fd = deviceTry(device_names[i].name); + if (fd > 0) { + close(fd); + CHECK_DEVS; + Devices[numDevs] = new_device(device_names[i].name); + Devices[numDevs]->type = DEVICE_TYPE_FLOPPY; + Devices[numDevs]->enabled = TRUE; + Devices[numDevs]->init = mediaInitFloppy; + Devices[numDevs]->get = mediaGetFloppy; + Devices[numDevs]->close = mediaCloseFloppy; + Devices[numDevs]->private = NULL; + msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name); + ++numDevs; + } + break; + default: break; } @@ -241,8 +257,13 @@ deviceGetAll(void) ifflags = ifc.ifc_req->ifr_flags; end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) { + /* If it's not a link entry, forget it */ if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK) continue; + /* Eliminate network devices that don't make sense */ + if (!strncmp(ifptr->ifr_name, "tun", 3) + || !strncmp(ifptr->ifr_name, "lo0", 3)) + continue; CHECK_DEVS; Devices[numDevs] = new_device(ifptr->ifr_name); Devices[numDevs]->type = DEVICE_TYPE_NETWORK; @@ -251,8 +272,7 @@ deviceGetAll(void) Devices[numDevs]->get = mediaGetNetwork; Devices[numDevs]->close = mediaCloseNetwork; Devices[numDevs]->private = NULL; - msgDebug("Found a device of type network named: %s\n", - ifptr->ifr_name); + msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name); ++numDevs; close(s); if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { @@ -278,8 +298,8 @@ deviceFind(char *name, DeviceType class) int i, j; for (i = 0, j = 0; i < numDevs; i++) { - if ((!name || !strcmp(Devices[i]->name, name)) && - (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) + if ((!name || !strcmp(Devices[i]->name, name)) + && (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) found[j++] = Devices[i]; } found[j] = NULL; @@ -304,8 +324,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)()) return NULL; for (numdevs = 0; devs[numdevs]; numdevs++); - tmp = (DMenu *)safe_malloc(sizeof(DMenu) + - (sizeof(DMenuItem) * (numdevs + 1))); + tmp = (DMenu *)safe_malloc(sizeof(DMenu) + (sizeof(DMenuItem) * (numdevs + 1))); bcopy(menu, tmp, sizeof(DMenu)); for (i = 0; devs[i]; i++) { tmp->items[i].title = devs[i]->name; diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c index 0f21f60..6dae821 100644 --- a/release/sysinstall/disks.c +++ b/release/sysinstall/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.18 1995/05/16 02:53:02 jkh Exp $ + * $Id: disks.c,v 1.19 1995/05/16 11:37:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -312,22 +312,20 @@ partitionHook(char *str) return devs ? 1 : 0; } -extern DMenu MenuInstall; - int diskPartitionEditor(char *str) { int scroll, choice, curr, max; - extern DMenu MenuDiskDevices; DMenu *menu; menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook); if (!menu) { msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully."); - return 0; } - choice = scroll = curr = max = 0; - dmenuOpen(menu, &choice, &scroll, &curr, &max); - free(menu); + else { + choice = scroll = curr = max = 0; + dmenuOpen(menu, &choice, &scroll, &curr, &max); + free(menu); + } return 0; } diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c index e3951f3..42f7db2 100644 --- a/release/sysinstall/dist.c +++ b/release/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.4 1995/05/16 02:53:05 jkh Exp $ + * $Id: dist.c,v 1.5 1995/05/16 11:37:11 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -102,8 +102,6 @@ distSetEverything(char *str) int distSetSrc(char *str) { - extern DMenu MenuSrcDistributions; - dmenuOpenSimple(&MenuSrcDistributions); if (SrcDists) Dists |= DIST_SRC; @@ -113,9 +111,7 @@ distSetSrc(char *str) static int distSetXF86(char *str) { - extern DMenu MenuXF86; - - dmenuOpenSimple(&MenuXF86); + dmenuOpenSimple(&MenuXF86Select); return 0; } diff --git a/release/sysinstall/dmenu.c b/release/sysinstall/dmenu.c index d10167c..457518e 100644 --- a/release/sysinstall/dmenu.c +++ b/release/sysinstall/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.7 1995/05/11 06:10:50 jkh Exp $ + * $Id: dmenu.c,v 1.8 1995/05/16 02:53:07 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -125,7 +125,10 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max) (unsigned char **)nitems, (unsigned char *)result); } + + /* This seems to be the only technique that works for getting the display to look right */ dialog_clear(); + if (!rval) { if (menu->options & DMENU_MULTIPLE_TYPE) { if (menu->options & DMENU_CALL_FIRST) @@ -156,5 +159,3 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max) } } } - - diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c index 8037234..12e20a3 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.17 1995/05/16 02:53:11 jkh Exp $ + * $Id: install.c,v 1.18 1995/05/16 11:37:14 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -76,20 +76,16 @@ installCommit(char *str) msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu."); return 0; } - if (mediaVerify()) { - msgConfirm("Please correct installation media problems and try again!"); + if (!mediaVerify()) return 0; - } - if (msgYesNo("Last Chance! Are you SURE you want continue the\ninstallation? If you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before doing this.\nWe take no responsibility for lost disk contents!")) + if (msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\nIf you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before proceeding.\nWe take no responsibility for lost disk contents!")) return 0; mbrContents = NULL; if (!msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first.")) mbrContents = bteasy17; - else { - if (!msgYesNo("Would you like to remove an existing boot manager?")) - mbrContents = mbr; - } + else if (!msgYesNo("Would you like to remove an existing boot manager?")) + mbrContents = mbr; devs = deviceFind(NULL, DEVICE_TYPE_DISK); for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; @@ -164,8 +160,22 @@ make_filesystems(void) disk = (Disk *)devs[i]->private; if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); + /* Make the proper device mount points in /mnt/dev */ MakeDevDisk(disk, "/mnt/dev"); + + /* Now make all the other devices the first time around */ + if (i == 0) { + extern int makedevs(void); + + chdir("/mnt"); + if (makedevs()) { + if (msgYesNo("Failed to make some of the devices in /mnt! Continue?")) + return; + } + chdir("/"); + } + for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { diff --git a/release/sysinstall/label.c b/release/sysinstall/label.c index cbbe10e..58feeef 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.1 1995/05/16 02:53:13 jkh Exp $ + * $Id: label.c,v 1.2 1995/05/16 11:37:16 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -409,7 +409,7 @@ print_command_summary() move(0, 0); } -void +int diskLabelEditor(char *str) { int sz, key = 0; @@ -422,6 +422,10 @@ diskLabelEditor(char *str) keypad(stdscr, TRUE); record_label_chunks(); + if (!getenv(DISK_PARTITIONED)) { + msgConfirm("You need to partition your disk(s) before you can assign disk labels."); + return 0; + } while (labeling) { print_label_chunks(); print_command_summary(); @@ -604,6 +608,7 @@ diskLabelEditor(char *str) variable_set2(DISK_LABELLED, "yes"); clear(); refresh(); + return 0; } diff --git a/release/sysinstall/main.c b/release/sysinstall/main.c index c32c6ed..dfcf717 100644 --- a/release/sysinstall/main.c +++ b/release/sysinstall/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.6 1995/05/16 02:53:16 jkh Exp $ + * $Id: main.c,v 1.7 1995/05/16 11:37:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -43,8 +43,6 @@ #include "sysinstall.h" -extern DMenu MenuInitial; - int main(int argc, char **argv) { @@ -64,7 +62,7 @@ main(int argc, char **argv) systemWelcome(); /* Default to English */ - /* lang_set_English(NULL); */ + lang_set_English(NULL); /* Begin user dialog at outer menu */ while (1) { diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c index da2fdd6..1250f52 100644 --- a/release/sysinstall/media.c +++ b/release/sysinstall/media.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: media.c,v 1.4 1995/05/16 02:53:18 jkh Exp $ + * $Id: media.c,v 1.5 1995/05/16 11:37:18 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -51,8 +51,6 @@ int mediaSetCDROM(char *str) { - extern DMenu MenuMediaCDROM; - if (OnCDROM == TRUE) return 1; else { @@ -72,8 +70,6 @@ mediaSetCDROM(char *str) int mediaSetFloppy(char *str) { - extern DMenu MenuMediaFloppy; - dmenuOpenSimple(&MenuMediaFloppy); if (getenv(MEDIA_DEVICE)) { variable_set2(MEDIA_TYPE, "floppy"); @@ -114,8 +110,6 @@ mediaSetTape(char *str) int mediaSetFTP(char *str) { - extern DMenu MenuMediaFTP; - dmenuOpenSimple(&MenuMediaFTP); if (getenv(MEDIA_DEVICE)) { variable_set2(MEDIA_TYPE, "ftp"); @@ -164,7 +158,6 @@ mediaExtractDist(FILE *fp) Boolean mediaGetType(void) { - extern DMenu MenuMedia; char *cp; dmenuOpenSimple(&MenuMedia); @@ -174,77 +167,13 @@ mediaGetType(void) return TRUE; } -/* Various media "strategy" routines */ -Boolean -mediaInitUFS(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetUFS(char *dist) -{ - return TRUE; -} - -/* UFS has no close routine since this is handled at the device level */ - -Boolean -mediaInitCDROM(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetCDROM(char *dist) -{ - return TRUE; -} - -void -mediaCloseCDROM(Device *dev) -{ - return; -} - -Boolean -mediaInitTape(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetTape(char *dist) -{ - return TRUE; -} - -void -mediaCloseTape(Device *dev) -{ - return; -} - -Boolean -mediaInitNetwork(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetNetwork(char *dist) -{ - return TRUE; -} - -void -mediaCloseNetwork(Device *dev) -{ -} - /* Return TRUE if all the media variables are set up correctly */ Boolean mediaVerify(void) { + if (!getenv(MEDIA_TYPE) || !getenv(MEDIA_DEVICE)) { + msgConfirm("Media type or device not set! Please select a media type\nfrom the Installation menu before proceeding."); + return FALSE; + } return TRUE; } diff --git a/release/sysinstall/media_strategy.c b/release/sysinstall/media_strategy.c new file mode 100644 index 0000000..cd1c77e --- /dev/null +++ b/release/sysinstall/media_strategy.c @@ -0,0 +1,133 @@ +/* + * The new sysinstall program. + * + * This is probably the last attempt in the `sysinstall' line, the next + * generation being slated to essentially a complete rewrite. + * + * $Id: media.c,v 1.5 1995/05/16 11:37:18 jkh Exp $ + * + * Copyright (c) 1995 + * Jordan Hubbard. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * verbatim and that no modifications are made prior to this + * point in the file. + * 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 + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL JORDAN HUBBARD OR HIS PETS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, LIFE OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include <stdio.h> +#include "sysinstall.h" + +/* Various media "strategy" routines */ + +Boolean +mediaInitCDROM(Device *dev) +{ + return TRUE; +} + +Boolean +mediaGetCDROM(char *dist) +{ + return TRUE; +} + +void +mediaCloseCDROM(Device *dev) +{ + return; +} + +Boolean +mediaInitFloppy(Device *dev) +{ + return TRUE; +} + +Boolean +mediaGetFloppy(char *dist) +{ + return TRUE; +} + +void +mediaCloseFloppy(Device *dev) +{ + return; +} + +Boolean +mediaInitTape(Device *dev) +{ + return TRUE; +} + +Boolean +mediaGetTape(char *dist) +{ + return TRUE; +} + +void +mediaCloseTape(Device *dev) +{ + return; +} + +Boolean +mediaInitNetwork(Device *dev) +{ + return TRUE; +} + +Boolean +mediaGetNetwork(char *dist) +{ + return TRUE; +} + +void +mediaCloseNetwork(Device *dev) +{ +} + +Boolean +mediaInitUFS(Device *dev) +{ + return TRUE; +} + +Boolean +mediaGetUFS(char *dist) +{ + return TRUE; +} + +/* UFS has no close routine since this is handled at the device level */ + diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c index 1f4f0d0..a856919 100644 --- a/release/sysinstall/menus.c +++ b/release/sysinstall/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.13 1995/05/16 02:53:23 jkh Exp $ + * $Id: menus.c,v 1.14 1995/05/16 11:37:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -50,23 +50,6 @@ * expansion. */ -/* Forward decls for submenus */ -extern DMenu MenuDocumentation; -extern DMenu MenuOptions; -extern DMenu MenuOptionsLanguage; -extern DMenu MenuOptionsFTP; -extern DMenu MenuMedia; -extern DMenu MenuMediaFloppy; -extern DMenu MenuInstall; -extern DMenu MenuInstallType; -extern DMenu MenuInstallOptions; -extern DMenu MenuDistributions; -extern DMenu MenuXF86Select; -extern DMenu MenuXF86SelectCore; -extern DMenu MenuXF86SelectServer; -extern DMenu MenuXF86SelectFonts; -extern DMenu MenuXF86; - /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, @@ -83,7 +66,7 @@ option by pressing enter. If you'd like a shell, press ESC", /* prompt */ DMENU_SUBMENU, (void *)&MenuDocumentation, 0, 0 }, { "Options", "Select various options for this utility.", /* O */ DMENU_SUBMENU, (void *)&MenuOptions, 0, 0 }, - { "Install", "Begin installation", /* I */ + { "Proceed", "Go to the installation menu", /* P */ DMENU_SUBMENU, (void *)&MenuInstall, 0, 0 }, { NULL } }, }; @@ -168,8 +151,8 @@ because you haven't booted directly from the CDROM in DOS/Windows or\n\ your CDROM was not detected. If you feel that you are seeing this dialog\n\ in error, you may wish to reboot FreeBSD with the -c boot flag (see the\n\ hardware guide in the Documentation menu for more info) and check that your\n\ -CDROM controller and the kernel agree on reasonable values. Please also note\n\ -that FreeBSD does NOT currently support IDE CDROM drives!", +CDROM controller and the kernel agree on reasonable values. Please also\n\ +note that FreeBSD does NOT currently support IDE CDROM drives!", "Press F1 for more information on CDROM support", "media_cdrom.hlp", { { "Matsushita", "Panasonic \"Sound Blaster\" CDROM.", /* M */ @@ -208,9 +191,10 @@ DMenu MenuMediaFTP = { "FreeBSD is distributed from a number of sites on the Internet. Please\n\ select the site closest to you or \"other\" if you'd like to specify another\n\ choice. Also note that not all sites carry every possible distribution!\n\ -Distributions other than the basic user set are only guaranteed to be available\n\ -from the Primary site.\n\n\ -If the first site selected doesn't respond, try one of the alternates.", +Distributions other than the basic user set are only guaranteed to be\n\ +available from the Primary site.\n\n\ +If the first site selected doesn't respond, try one of the alternates.\n\ +You may also wish to investigate the Ftp options menu in case of trouble.", "Select a site that's close!", "media_ftp.hlp", { { "Primary", "ftp.freebsd.org", @@ -300,10 +284,10 @@ method.", DMenu MenuInstallType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Type", - "As a convenience, we provide several `canned' installation types.\n\ -These pick what we consider to be the most reasonable defaults for the\n\ + "As a convenience, we provide several \"canned\" installation types.\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'.", +the list of distributions yourself, simply select \"custom\".", "Press F1 for more information on the various distributions", "dist_types.hlp", { { "Developer", "Includes full sources, binaries and doc but no games.", @@ -421,11 +405,12 @@ DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.1.1u1 Distribution", "Please select the components you need from the XFree86 3.1.1u1\n\ -distribution. Select what you need from the basic components set\n\ -and at least one entry from the Server menu and the Font set menu\n", - "Press F1 for a sample sequence", - "XF86Select.hlp", - { { "Core", "Basic component menu (required)", +distribution. We recommend that you select what you need from the basic\n\ +components set and at least one entry from the Server and Font set menus.\n\n\ +When you're finished, select Cancel.", + "Press F1 to read the XFree86 release notes for FreeBSD", + "XF86S.hlp", + { { "Basic", "Basic component menu (required)", DMENU_SUBMENU, &MenuXF86SelectCore, 0, 0 }, { "Server", "X server menu", DMENU_SUBMENU, &MenuXF86SelectServer, 0, 0 }, @@ -537,8 +522,9 @@ DMenu MenuOptions = { DMENU_NORMAL_TYPE, "Choose Installation Options", "This menu controls how the FreeBSD installation will deal with various\n\ -error conditions, should they arise, and the degree to which you, the\n\ -user, will be prompted for options.", +error conditions (should they arise), the default language used for\n\ +documentation, etc.\n\n\ +When you're done setting options, please select Cancel.", NULL, NULL, { { "Ftp Options", "Ftp options menu", @@ -578,12 +564,13 @@ to deal with it? You have one of several choices:", DMenu MenuInstall = { DMENU_NORMAL_TYPE, "Choose Installation Options", /* title */ - "Before installation can continue, you need to specify a few items\n\ -of information regarding the type of distribution you wish to have\n\ -and from where you wish to install it. There are also a number\n\ -of options you can specify in the Options menu which will determine\n\ -how. You may choose install FreeBSD at this time, you may\n\ -select Cancel to leave this menu.", + "Before installation can continue, you need to specify a few\n\ +details on the type of distribution you wish to have, where you wish\n\ +to install it from, and how you wish to allocate disk storage to FreeBSD\n\ +None of the items in this menu will actually modify the contents of\n\ +your disk until you select the \"GO!\" menu item (and even then, only\n\ +after a final confirmation). If you do not wish to install FreeBSD\n\ +at this time then select Cancel to leave this menu.", "Press F1 to read the installation guide", "install.hlp", { { "Distributions", "Choose the type of installation you want", /* T */ @@ -598,7 +585,5 @@ select Cancel to leave this menu.", DMENU_CALL, (void *)tcpOpenDialog, 0, 0 }, { "GO!", "Start the whole show and go out for coffee!", /* P */ DMENU_CALL, (void *)installCommit, 0, 0 }, - { "Options", "Set special installation options", /* O */ - DMENU_SUBMENU, (void *)&MenuOptions, 0, 0}, { NULL } }, }; diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h index 5a86272..e3f00f0 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.16 1995/05/16 02:53:26 jkh Exp $ + * $Id: sysinstall.h,v 1.17 1995/05/16 11:37:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -84,11 +84,10 @@ #define VAR_NAMESERVER "nameserver" #define VAR_GATEWAY "gateway" -/* per-interface flags */ -#define VAR_IFCONFIG_ARGS "if_flags" -#define VAR_NETMASK "netmask" -#define VAR_IPADDR "ip_addr" +#define VAR_IFCONFIG "ifconfig_" +/* The help file for the TCP/IP setup screen */ +#define TCP_HELPFILE "tcp.hlp" /*** Types ***/ typedef unsigned int Boolean; @@ -177,20 +176,41 @@ typedef int (*commandFunc)(char *key, void *data); /*** Externs ***/ -extern int CpioFD; /* The file descriptor for our CPIO floppy */ -extern int DebugFD; /* Where diagnostic output goes */ -extern Boolean OnCDROM; /* Are we running off of a CDROM? */ -extern Boolean OnSerial; /* Are we on a serial console? */ -extern Boolean SystemWasInstalled; /* Did we install it? */ -extern Boolean DialogActive; /* Is the dialog() stuff up? */ -extern Boolean ColorDisplay; /* Are we on a color display? */ -extern Boolean OnVTY; /* On a syscons VTY? */ -extern Variable *VarHead; /* The head of the variable chain */ -extern unsigned int Dists; /* Which distributions we want */ -extern unsigned int SrcDists; /* Which src distributions we want */ -extern unsigned int XF86Dists;/* Which XFree86 dists we want */ -extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ -extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ +extern int CpioFD; /* The file descriptor for our CPIO floppy */ +extern int DebugFD; /* Where diagnostic output goes */ +extern Boolean OnCDROM; /* Are we running off of a CDROM? */ +extern Boolean OnSerial; /* Are we on a serial console? */ +extern Boolean SystemWasInstalled; /* Did we install it? */ +extern Boolean DialogActive; /* Is the dialog() stuff up? */ +extern Boolean ColorDisplay; /* Are we on a color display? */ +extern Boolean OnVTY; /* On a syscons VTY? */ +extern Variable *VarHead; /* The head of the variable chain */ +extern unsigned int Dists; /* Which distributions we want */ +extern unsigned int SrcDists; /* Which src distributions we want */ +extern unsigned int XF86Dists; /* Which XFree86 dists we want */ +extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ +extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ + +extern DMenu MenuInitial; /* Initial installation menu */ +extern DMenu MenuDocumentation; /* Documentation menu */ +extern DMenu MenuOptions; /* Installation options */ +extern DMenu MenuOptionsLanguage; /* Language options menu */ +extern DMenu MenuOptionsFTP; /* FTP options menu */ +extern DMenu MenuMedia; /* Media type menu */ +extern DMenu MenuMediaCDROM; /* CDROM media menu */ +extern DMenu MenuMediaFloppy; /* Floppy media menu */ +extern DMenu MenuMediaFTP; /* FTP media menu */ +extern DMenu MenuInstall; /* Installation menu */ +extern DMenu MenuInstallType; /* Installation type menu */ +extern DMenu MenuDistributions; /* Distribution menu */ +extern DMenu MenuSrcDistributions; /* Source distribution menu */ +extern DMenu MenuXF86; /* XFree86 main menu */ +extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ +extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ +extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ +extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ +extern DMenu MenuDiskDevices; /* Disk devices menu */ + /*** Prototypes ***/ @@ -249,7 +269,7 @@ extern void lang_set_Spanish(char *str); extern void lang_set_Swedish(char *str); /* label.c */ -extern void diskLabelEditor(char *str); +extern int diskLabelEditor(char *str); /* makedevs.c (auto-generated) */ extern const char termcap_vt100[]; @@ -275,9 +295,13 @@ extern FILE *mediaOpen(char *parent, char *me); extern Boolean mediaGetType(void); extern Boolean mediaExtractDist(FILE *fp); extern Boolean mediaVerify(void); + +/* media_strategy.c */ extern Boolean mediaInitUFS(Device *dev); extern Boolean mediaGetUFS(char *dist); extern Boolean mediaInitCDROM(Device *dev); +extern Boolean mediaGetFloppy(char *dist); +extern Boolean mediaInitFloppy(Device *dev); extern Boolean mediaGetCDROM(char *dist); extern Boolean mediaInitTape(Device *dev); extern Boolean mediaGetTape(char *dist); @@ -286,7 +310,7 @@ extern Boolean mediaGetNetwork(char *dist); extern void mediaCloseTape(Device *dev); extern void mediaCloseCDROM(Device *dev); extern void mediaCloseNetwork(Device *dev); - +extern void mediaCloseFloppy(Device *dev); /* misc.c */ extern Boolean file_readable(char *fname); diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c index 017cc2b..34a16d0 100644 --- a/release/sysinstall/tcpip.c +++ b/release/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.3 1995/05/16 20:00:51 gpalmer Exp $ + * $Id: tcpip.c,v 1.4 1995/05/17 12:09:11 gpalmer Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -199,6 +199,7 @@ tcpOpenDialog(char *str) char *tmp; Device **devs; char old_iface[8]; + char help[FILENAME_MAX]; /* We need a curses window */ ds_win = newwin(LINES, COLS, 0, 0); @@ -216,9 +217,11 @@ tcpOpenDialog(char *str) iface_names[n] = (devs[n])->name; ++n; } - n_iface = --n; + n_iface = n; /* Setup a nice screen for us to splat stuff onto */ + systemHelpFile(TCP_HELPFILE, help); + use_helpfile(help); draw_box(ds_win, TCP_DIALOG_Y, TCP_DIALOG_X, TCP_DIALOG_HEIGHT, TCP_DIALOG_WIDTH, dialog_attr, border_attr); @@ -388,7 +391,7 @@ tcpOpenDialog(char *str) the next field, so we special case around getting to that field, rather than moving off the previous one. Hence we are really testing for - (n ==_IFACE) */ + (n == LAYOUT_IFACE) */ if (n == LAYOUT_IPADDR) { n = LAYOUT_OKBUTTON; @@ -517,6 +520,8 @@ tcpOpenDialog(char *str) else n = max; break; + case KEY_F(1): + display_helpfile(); /* They tried some key combination we don't support - tell them! */ default: @@ -534,6 +539,7 @@ tcpOpenDialog(char *str) /* Clear this crap off the screen */ dialog_clear(); refresh(); + use_helpfile(NULL); /* We actually need to inform the rest of sysinstall about this data now - if the user hasn't selected cancel, save the stuff @@ -557,13 +563,10 @@ tcpOpenDialog(char *str) sprintf(temp, "inet %s %s netmask %s", if_list[foo].ipaddr, if_list[foo].extras, if_list[foo].netmask); - sprintf(ifn, "ifconfig_%s", iface_names[foo]); + sprintf(ifn, "%s%s", VAR_IFCONFIG, iface_names[foo]); variable_set2(ifn, temp); } } - - return 1; } - return 0; } diff --git a/release/sysinstall/wizard.c b/release/sysinstall/wizard.c index dda8b57..aa4fc34 100644 --- a/release/sysinstall/wizard.c +++ b/release/sysinstall/wizard.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: wizard.c,v 1.1 1995/05/04 23:36:23 jkh Exp $ + * $Id: wizard.c,v 1.2 1995/05/16 02:53:31 jkh Exp $ * */ @@ -17,7 +17,7 @@ #include <string.h> #include <err.h> #include <sys/types.h> -#include "libdisk.h" +#include "sysinstall.h" u_char mbr[] = { 250,51,192,142,208,188,0,124,139,244,80,7,80,31,251,252,191,0,6,185,0,1, diff --git a/usr.sbin/sade/Makefile b/usr.sbin/sade/Makefile index 4b18445..949b57d 100644 --- a/usr.sbin/sade/Makefile +++ b/usr.sbin/sade/Makefile @@ -9,7 +9,7 @@ SRCS= globals.c main.c dmenu.c menus.c \ termcap.c makedevs.c media.c variable.c \ devices.c dist.c lang.c wizard.c \ disks.c command.c decode.c label.c \ - tcpip.c + tcpip.c media_strategy.c CFLAGS+= -Wall -g -I${.CURDIR}/../libdisk \ -I${.CURDIR}/../../gnu/lib/libdialog @@ -30,13 +30,13 @@ BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot .endif makedevs.c: dev2c.sh Makefile rtermcap -# mkdir -p dev -# cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev -# ( cd dev; sh ./MAKEDEV all ) -# sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp -# rm -rf dev rm -f makedevs.tmp + mkdir -p dev echo '#include <sys/types.h>' > makedevs.tmp + cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev + ( cd dev; sh ./MAKEDEV all ) + sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp + rm -rf dev uudecode < ${.CURDIR}/bteasy17.uu file2c 'const unsigned char boot0[] = {' '};' \ < bteasy17 >> makedevs.tmp diff --git a/usr.sbin/sade/devices.c b/usr.sbin/sade/devices.c index 893b1b1..091bac7 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.15 1995/05/16 02:53:00 jkh Exp $ + * $Id: devices.c,v 1.16 1995/05/16 11:37:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -91,10 +91,11 @@ static struct { { DEVICE_TYPE_TAPE, "wt0", "Wangtek tape drive" }, { DEVICE_TYPE_DISK, "sd", "SCSI disk device" }, { DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" }, + { DEVICE_TYPE_FLOPPY, "fd0a", "Floppy disk drive (unit A)" }, + { DEVICE_TYPE_FLOPPY, "fd1a", "Floppy disk drive (unit B)" }, { DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" }, { DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" }, { DEVICE_TYPE_NETWORK, "ppp", "Point-to-Point Protocol (PPP) interface" }, - { DEVICE_TYPE_NETWORK, "tun", "Tunneling IP driver (not for direct use)" }, { DEVICE_TYPE_NETWORK, "ed", "WD/SMC 80xx; Novell NE1000/2000; 3Com 3C503 cards" }, { DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 interface card" }, { DEVICE_TYPE_NETWORK, "el", "3Com 3C501 interface card" }, @@ -210,13 +211,28 @@ deviceGetAll(void) Devices[numDevs]->get = mediaGetTape; Devices[numDevs]->close = mediaCloseTape; Devices[numDevs]->private = NULL; - msgDebug("Found a device of type TAPE named: %s\n", - device_names[i].name); + msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name); ++numDevs; } break; case DEVICE_TYPE_FLOPPY: + fd = deviceTry(device_names[i].name); + if (fd > 0) { + close(fd); + CHECK_DEVS; + Devices[numDevs] = new_device(device_names[i].name); + Devices[numDevs]->type = DEVICE_TYPE_FLOPPY; + Devices[numDevs]->enabled = TRUE; + Devices[numDevs]->init = mediaInitFloppy; + Devices[numDevs]->get = mediaGetFloppy; + Devices[numDevs]->close = mediaCloseFloppy; + Devices[numDevs]->private = NULL; + msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name); + ++numDevs; + } + break; + default: break; } @@ -241,8 +257,13 @@ deviceGetAll(void) ifflags = ifc.ifc_req->ifr_flags; end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) { + /* If it's not a link entry, forget it */ if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK) continue; + /* Eliminate network devices that don't make sense */ + if (!strncmp(ifptr->ifr_name, "tun", 3) + || !strncmp(ifptr->ifr_name, "lo0", 3)) + continue; CHECK_DEVS; Devices[numDevs] = new_device(ifptr->ifr_name); Devices[numDevs]->type = DEVICE_TYPE_NETWORK; @@ -251,8 +272,7 @@ deviceGetAll(void) Devices[numDevs]->get = mediaGetNetwork; Devices[numDevs]->close = mediaCloseNetwork; Devices[numDevs]->private = NULL; - msgDebug("Found a device of type network named: %s\n", - ifptr->ifr_name); + msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name); ++numDevs; close(s); if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { @@ -278,8 +298,8 @@ deviceFind(char *name, DeviceType class) int i, j; for (i = 0, j = 0; i < numDevs; i++) { - if ((!name || !strcmp(Devices[i]->name, name)) && - (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) + if ((!name || !strcmp(Devices[i]->name, name)) + && (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) found[j++] = Devices[i]; } found[j] = NULL; @@ -304,8 +324,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)()) return NULL; for (numdevs = 0; devs[numdevs]; numdevs++); - tmp = (DMenu *)safe_malloc(sizeof(DMenu) + - (sizeof(DMenuItem) * (numdevs + 1))); + tmp = (DMenu *)safe_malloc(sizeof(DMenu) + (sizeof(DMenuItem) * (numdevs + 1))); bcopy(menu, tmp, sizeof(DMenu)); for (i = 0; devs[i]; i++) { tmp->items[i].title = devs[i]->name; diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index 0f21f60..6dae821 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.18 1995/05/16 02:53:02 jkh Exp $ + * $Id: disks.c,v 1.19 1995/05/16 11:37:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -312,22 +312,20 @@ partitionHook(char *str) return devs ? 1 : 0; } -extern DMenu MenuInstall; - int diskPartitionEditor(char *str) { int scroll, choice, curr, max; - extern DMenu MenuDiskDevices; DMenu *menu; menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook); if (!menu) { msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully."); - return 0; } - choice = scroll = curr = max = 0; - dmenuOpen(menu, &choice, &scroll, &curr, &max); - free(menu); + else { + choice = scroll = curr = max = 0; + dmenuOpen(menu, &choice, &scroll, &curr, &max); + free(menu); + } return 0; } diff --git a/usr.sbin/sade/dmenu.c b/usr.sbin/sade/dmenu.c index d10167c..457518e 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.7 1995/05/11 06:10:50 jkh Exp $ + * $Id: dmenu.c,v 1.8 1995/05/16 02:53:07 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -125,7 +125,10 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max) (unsigned char **)nitems, (unsigned char *)result); } + + /* This seems to be the only technique that works for getting the display to look right */ dialog_clear(); + if (!rval) { if (menu->options & DMENU_MULTIPLE_TYPE) { if (menu->options & DMENU_CALL_FIRST) @@ -156,5 +159,3 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max) } } } - - diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c index 8037234..12e20a3 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.17 1995/05/16 02:53:11 jkh Exp $ + * $Id: install.c,v 1.18 1995/05/16 11:37:14 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -76,20 +76,16 @@ installCommit(char *str) msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu."); return 0; } - if (mediaVerify()) { - msgConfirm("Please correct installation media problems and try again!"); + if (!mediaVerify()) return 0; - } - if (msgYesNo("Last Chance! Are you SURE you want continue the\ninstallation? If you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before doing this.\nWe take no responsibility for lost disk contents!")) + if (msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\nIf you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before proceeding.\nWe take no responsibility for lost disk contents!")) return 0; mbrContents = NULL; if (!msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first.")) mbrContents = bteasy17; - else { - if (!msgYesNo("Would you like to remove an existing boot manager?")) - mbrContents = mbr; - } + else if (!msgYesNo("Would you like to remove an existing boot manager?")) + mbrContents = mbr; devs = deviceFind(NULL, DEVICE_TYPE_DISK); for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; @@ -164,8 +160,22 @@ make_filesystems(void) disk = (Disk *)devs[i]->private; if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); + /* Make the proper device mount points in /mnt/dev */ MakeDevDisk(disk, "/mnt/dev"); + + /* Now make all the other devices the first time around */ + if (i == 0) { + extern int makedevs(void); + + chdir("/mnt"); + if (makedevs()) { + if (msgYesNo("Failed to make some of the devices in /mnt! Continue?")) + return; + } + chdir("/"); + } + for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { diff --git a/usr.sbin/sade/label.c b/usr.sbin/sade/label.c index cbbe10e..58feeef 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.1 1995/05/16 02:53:13 jkh Exp $ + * $Id: label.c,v 1.2 1995/05/16 11:37:16 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -409,7 +409,7 @@ print_command_summary() move(0, 0); } -void +int diskLabelEditor(char *str) { int sz, key = 0; @@ -422,6 +422,10 @@ diskLabelEditor(char *str) keypad(stdscr, TRUE); record_label_chunks(); + if (!getenv(DISK_PARTITIONED)) { + msgConfirm("You need to partition your disk(s) before you can assign disk labels."); + return 0; + } while (labeling) { print_label_chunks(); print_command_summary(); @@ -604,6 +608,7 @@ diskLabelEditor(char *str) variable_set2(DISK_LABELLED, "yes"); clear(); refresh(); + return 0; } diff --git a/usr.sbin/sade/main.c b/usr.sbin/sade/main.c index c32c6ed..dfcf717 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.6 1995/05/16 02:53:16 jkh Exp $ + * $Id: main.c,v 1.7 1995/05/16 11:37:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -43,8 +43,6 @@ #include "sysinstall.h" -extern DMenu MenuInitial; - int main(int argc, char **argv) { @@ -64,7 +62,7 @@ main(int argc, char **argv) systemWelcome(); /* Default to English */ - /* lang_set_English(NULL); */ + lang_set_English(NULL); /* Begin user dialog at outer menu */ while (1) { diff --git a/usr.sbin/sade/menus.c b/usr.sbin/sade/menus.c index 1f4f0d0..a856919 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.13 1995/05/16 02:53:23 jkh Exp $ + * $Id: menus.c,v 1.14 1995/05/16 11:37:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -50,23 +50,6 @@ * expansion. */ -/* Forward decls for submenus */ -extern DMenu MenuDocumentation; -extern DMenu MenuOptions; -extern DMenu MenuOptionsLanguage; -extern DMenu MenuOptionsFTP; -extern DMenu MenuMedia; -extern DMenu MenuMediaFloppy; -extern DMenu MenuInstall; -extern DMenu MenuInstallType; -extern DMenu MenuInstallOptions; -extern DMenu MenuDistributions; -extern DMenu MenuXF86Select; -extern DMenu MenuXF86SelectCore; -extern DMenu MenuXF86SelectServer; -extern DMenu MenuXF86SelectFonts; -extern DMenu MenuXF86; - /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, @@ -83,7 +66,7 @@ option by pressing enter. If you'd like a shell, press ESC", /* prompt */ DMENU_SUBMENU, (void *)&MenuDocumentation, 0, 0 }, { "Options", "Select various options for this utility.", /* O */ DMENU_SUBMENU, (void *)&MenuOptions, 0, 0 }, - { "Install", "Begin installation", /* I */ + { "Proceed", "Go to the installation menu", /* P */ DMENU_SUBMENU, (void *)&MenuInstall, 0, 0 }, { NULL } }, }; @@ -168,8 +151,8 @@ because you haven't booted directly from the CDROM in DOS/Windows or\n\ your CDROM was not detected. If you feel that you are seeing this dialog\n\ in error, you may wish to reboot FreeBSD with the -c boot flag (see the\n\ hardware guide in the Documentation menu for more info) and check that your\n\ -CDROM controller and the kernel agree on reasonable values. Please also note\n\ -that FreeBSD does NOT currently support IDE CDROM drives!", +CDROM controller and the kernel agree on reasonable values. Please also\n\ +note that FreeBSD does NOT currently support IDE CDROM drives!", "Press F1 for more information on CDROM support", "media_cdrom.hlp", { { "Matsushita", "Panasonic \"Sound Blaster\" CDROM.", /* M */ @@ -208,9 +191,10 @@ DMenu MenuMediaFTP = { "FreeBSD is distributed from a number of sites on the Internet. Please\n\ select the site closest to you or \"other\" if you'd like to specify another\n\ choice. Also note that not all sites carry every possible distribution!\n\ -Distributions other than the basic user set are only guaranteed to be available\n\ -from the Primary site.\n\n\ -If the first site selected doesn't respond, try one of the alternates.", +Distributions other than the basic user set are only guaranteed to be\n\ +available from the Primary site.\n\n\ +If the first site selected doesn't respond, try one of the alternates.\n\ +You may also wish to investigate the Ftp options menu in case of trouble.", "Select a site that's close!", "media_ftp.hlp", { { "Primary", "ftp.freebsd.org", @@ -300,10 +284,10 @@ method.", DMenu MenuInstallType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Type", - "As a convenience, we provide several `canned' installation types.\n\ -These pick what we consider to be the most reasonable defaults for the\n\ + "As a convenience, we provide several \"canned\" installation types.\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'.", +the list of distributions yourself, simply select \"custom\".", "Press F1 for more information on the various distributions", "dist_types.hlp", { { "Developer", "Includes full sources, binaries and doc but no games.", @@ -421,11 +405,12 @@ DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.1.1u1 Distribution", "Please select the components you need from the XFree86 3.1.1u1\n\ -distribution. Select what you need from the basic components set\n\ -and at least one entry from the Server menu and the Font set menu\n", - "Press F1 for a sample sequence", - "XF86Select.hlp", - { { "Core", "Basic component menu (required)", +distribution. We recommend that you select what you need from the basic\n\ +components set and at least one entry from the Server and Font set menus.\n\n\ +When you're finished, select Cancel.", + "Press F1 to read the XFree86 release notes for FreeBSD", + "XF86S.hlp", + { { "Basic", "Basic component menu (required)", DMENU_SUBMENU, &MenuXF86SelectCore, 0, 0 }, { "Server", "X server menu", DMENU_SUBMENU, &MenuXF86SelectServer, 0, 0 }, @@ -537,8 +522,9 @@ DMenu MenuOptions = { DMENU_NORMAL_TYPE, "Choose Installation Options", "This menu controls how the FreeBSD installation will deal with various\n\ -error conditions, should they arise, and the degree to which you, the\n\ -user, will be prompted for options.", +error conditions (should they arise), the default language used for\n\ +documentation, etc.\n\n\ +When you're done setting options, please select Cancel.", NULL, NULL, { { "Ftp Options", "Ftp options menu", @@ -578,12 +564,13 @@ to deal with it? You have one of several choices:", DMenu MenuInstall = { DMENU_NORMAL_TYPE, "Choose Installation Options", /* title */ - "Before installation can continue, you need to specify a few items\n\ -of information regarding the type of distribution you wish to have\n\ -and from where you wish to install it. There are also a number\n\ -of options you can specify in the Options menu which will determine\n\ -how. You may choose install FreeBSD at this time, you may\n\ -select Cancel to leave this menu.", + "Before installation can continue, you need to specify a few\n\ +details on the type of distribution you wish to have, where you wish\n\ +to install it from, and how you wish to allocate disk storage to FreeBSD\n\ +None of the items in this menu will actually modify the contents of\n\ +your disk until you select the \"GO!\" menu item (and even then, only\n\ +after a final confirmation). If you do not wish to install FreeBSD\n\ +at this time then select Cancel to leave this menu.", "Press F1 to read the installation guide", "install.hlp", { { "Distributions", "Choose the type of installation you want", /* T */ @@ -598,7 +585,5 @@ select Cancel to leave this menu.", DMENU_CALL, (void *)tcpOpenDialog, 0, 0 }, { "GO!", "Start the whole show and go out for coffee!", /* P */ DMENU_CALL, (void *)installCommit, 0, 0 }, - { "Options", "Set special installation options", /* O */ - DMENU_SUBMENU, (void *)&MenuOptions, 0, 0}, { NULL } }, }; diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h index 5a86272..e3f00f0 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.16 1995/05/16 02:53:26 jkh Exp $ + * $Id: sysinstall.h,v 1.17 1995/05/16 11:37:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -84,11 +84,10 @@ #define VAR_NAMESERVER "nameserver" #define VAR_GATEWAY "gateway" -/* per-interface flags */ -#define VAR_IFCONFIG_ARGS "if_flags" -#define VAR_NETMASK "netmask" -#define VAR_IPADDR "ip_addr" +#define VAR_IFCONFIG "ifconfig_" +/* The help file for the TCP/IP setup screen */ +#define TCP_HELPFILE "tcp.hlp" /*** Types ***/ typedef unsigned int Boolean; @@ -177,20 +176,41 @@ typedef int (*commandFunc)(char *key, void *data); /*** Externs ***/ -extern int CpioFD; /* The file descriptor for our CPIO floppy */ -extern int DebugFD; /* Where diagnostic output goes */ -extern Boolean OnCDROM; /* Are we running off of a CDROM? */ -extern Boolean OnSerial; /* Are we on a serial console? */ -extern Boolean SystemWasInstalled; /* Did we install it? */ -extern Boolean DialogActive; /* Is the dialog() stuff up? */ -extern Boolean ColorDisplay; /* Are we on a color display? */ -extern Boolean OnVTY; /* On a syscons VTY? */ -extern Variable *VarHead; /* The head of the variable chain */ -extern unsigned int Dists; /* Which distributions we want */ -extern unsigned int SrcDists; /* Which src distributions we want */ -extern unsigned int XF86Dists;/* Which XFree86 dists we want */ -extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ -extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ +extern int CpioFD; /* The file descriptor for our CPIO floppy */ +extern int DebugFD; /* Where diagnostic output goes */ +extern Boolean OnCDROM; /* Are we running off of a CDROM? */ +extern Boolean OnSerial; /* Are we on a serial console? */ +extern Boolean SystemWasInstalled; /* Did we install it? */ +extern Boolean DialogActive; /* Is the dialog() stuff up? */ +extern Boolean ColorDisplay; /* Are we on a color display? */ +extern Boolean OnVTY; /* On a syscons VTY? */ +extern Variable *VarHead; /* The head of the variable chain */ +extern unsigned int Dists; /* Which distributions we want */ +extern unsigned int SrcDists; /* Which src distributions we want */ +extern unsigned int XF86Dists; /* Which XFree86 dists we want */ +extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ +extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ + +extern DMenu MenuInitial; /* Initial installation menu */ +extern DMenu MenuDocumentation; /* Documentation menu */ +extern DMenu MenuOptions; /* Installation options */ +extern DMenu MenuOptionsLanguage; /* Language options menu */ +extern DMenu MenuOptionsFTP; /* FTP options menu */ +extern DMenu MenuMedia; /* Media type menu */ +extern DMenu MenuMediaCDROM; /* CDROM media menu */ +extern DMenu MenuMediaFloppy; /* Floppy media menu */ +extern DMenu MenuMediaFTP; /* FTP media menu */ +extern DMenu MenuInstall; /* Installation menu */ +extern DMenu MenuInstallType; /* Installation type menu */ +extern DMenu MenuDistributions; /* Distribution menu */ +extern DMenu MenuSrcDistributions; /* Source distribution menu */ +extern DMenu MenuXF86; /* XFree86 main menu */ +extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ +extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ +extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ +extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ +extern DMenu MenuDiskDevices; /* Disk devices menu */ + /*** Prototypes ***/ @@ -249,7 +269,7 @@ extern void lang_set_Spanish(char *str); extern void lang_set_Swedish(char *str); /* label.c */ -extern void diskLabelEditor(char *str); +extern int diskLabelEditor(char *str); /* makedevs.c (auto-generated) */ extern const char termcap_vt100[]; @@ -275,9 +295,13 @@ extern FILE *mediaOpen(char *parent, char *me); extern Boolean mediaGetType(void); extern Boolean mediaExtractDist(FILE *fp); extern Boolean mediaVerify(void); + +/* media_strategy.c */ extern Boolean mediaInitUFS(Device *dev); extern Boolean mediaGetUFS(char *dist); extern Boolean mediaInitCDROM(Device *dev); +extern Boolean mediaGetFloppy(char *dist); +extern Boolean mediaInitFloppy(Device *dev); extern Boolean mediaGetCDROM(char *dist); extern Boolean mediaInitTape(Device *dev); extern Boolean mediaGetTape(char *dist); @@ -286,7 +310,7 @@ extern Boolean mediaGetNetwork(char *dist); extern void mediaCloseTape(Device *dev); extern void mediaCloseCDROM(Device *dev); extern void mediaCloseNetwork(Device *dev); - +extern void mediaCloseFloppy(Device *dev); /* misc.c */ extern Boolean file_readable(char *fname); diff --git a/usr.sbin/sade/wizard.c b/usr.sbin/sade/wizard.c index dda8b57..aa4fc34 100644 --- a/usr.sbin/sade/wizard.c +++ b/usr.sbin/sade/wizard.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: wizard.c,v 1.1 1995/05/04 23:36:23 jkh Exp $ + * $Id: wizard.c,v 1.2 1995/05/16 02:53:31 jkh Exp $ * */ @@ -17,7 +17,7 @@ #include <string.h> #include <err.h> #include <sys/types.h> -#include "libdisk.h" +#include "sysinstall.h" u_char mbr[] = { 250,51,192,142,208,188,0,124,139,244,80,7,80,31,251,252,191,0,6,185,0,1, diff --git a/usr.sbin/sysinstall/Makefile b/usr.sbin/sysinstall/Makefile index 4b18445..949b57d 100644 --- a/usr.sbin/sysinstall/Makefile +++ b/usr.sbin/sysinstall/Makefile @@ -9,7 +9,7 @@ SRCS= globals.c main.c dmenu.c menus.c \ termcap.c makedevs.c media.c variable.c \ devices.c dist.c lang.c wizard.c \ disks.c command.c decode.c label.c \ - tcpip.c + tcpip.c media_strategy.c CFLAGS+= -Wall -g -I${.CURDIR}/../libdisk \ -I${.CURDIR}/../../gnu/lib/libdialog @@ -30,13 +30,13 @@ BOOTS=${.CURDIR}/../../sys/i386/boot/biosboot .endif makedevs.c: dev2c.sh Makefile rtermcap -# mkdir -p dev -# cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev -# ( cd dev; sh ./MAKEDEV all ) -# sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp -# rm -rf dev rm -f makedevs.tmp + mkdir -p dev echo '#include <sys/types.h>' > makedevs.tmp + cp ${.CURDIR}/../../etc/etc.i386/MAKEDEV dev + ( cd dev; sh ./MAKEDEV all ) + sh ${.CURDIR}/dev2c.sh dev > makedevs.tmp + rm -rf dev uudecode < ${.CURDIR}/bteasy17.uu file2c 'const unsigned char boot0[] = {' '};' \ < bteasy17 >> makedevs.tmp diff --git a/usr.sbin/sysinstall/devices.c b/usr.sbin/sysinstall/devices.c index 893b1b1..091bac7 100644 --- a/usr.sbin/sysinstall/devices.c +++ b/usr.sbin/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.15 1995/05/16 02:53:00 jkh Exp $ + * $Id: devices.c,v 1.16 1995/05/16 11:37:08 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -91,10 +91,11 @@ static struct { { DEVICE_TYPE_TAPE, "wt0", "Wangtek tape drive" }, { DEVICE_TYPE_DISK, "sd", "SCSI disk device" }, { DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" }, + { DEVICE_TYPE_FLOPPY, "fd0a", "Floppy disk drive (unit A)" }, + { DEVICE_TYPE_FLOPPY, "fd1a", "Floppy disk drive (unit B)" }, { DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" }, { DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" }, { DEVICE_TYPE_NETWORK, "ppp", "Point-to-Point Protocol (PPP) interface" }, - { DEVICE_TYPE_NETWORK, "tun", "Tunneling IP driver (not for direct use)" }, { DEVICE_TYPE_NETWORK, "ed", "WD/SMC 80xx; Novell NE1000/2000; 3Com 3C503 cards" }, { DEVICE_TYPE_NETWORK, "ep", "3Com 3C509 interface card" }, { DEVICE_TYPE_NETWORK, "el", "3Com 3C501 interface card" }, @@ -210,13 +211,28 @@ deviceGetAll(void) Devices[numDevs]->get = mediaGetTape; Devices[numDevs]->close = mediaCloseTape; Devices[numDevs]->private = NULL; - msgDebug("Found a device of type TAPE named: %s\n", - device_names[i].name); + msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name); ++numDevs; } break; case DEVICE_TYPE_FLOPPY: + fd = deviceTry(device_names[i].name); + if (fd > 0) { + close(fd); + CHECK_DEVS; + Devices[numDevs] = new_device(device_names[i].name); + Devices[numDevs]->type = DEVICE_TYPE_FLOPPY; + Devices[numDevs]->enabled = TRUE; + Devices[numDevs]->init = mediaInitFloppy; + Devices[numDevs]->get = mediaGetFloppy; + Devices[numDevs]->close = mediaCloseFloppy; + Devices[numDevs]->private = NULL; + msgDebug("Found a device of type TAPE named: %s\n", device_names[i].name); + ++numDevs; + } + break; + default: break; } @@ -241,8 +257,13 @@ deviceGetAll(void) ifflags = ifc.ifc_req->ifr_flags; end = (struct ifreq *) (ifc.ifc_buf + ifc.ifc_len); for (ifptr = ifc.ifc_req; ifptr < end; ifptr++) { + /* If it's not a link entry, forget it */ if (ifptr->ifr_ifru.ifru_addr.sa_family != AF_LINK) continue; + /* Eliminate network devices that don't make sense */ + if (!strncmp(ifptr->ifr_name, "tun", 3) + || !strncmp(ifptr->ifr_name, "lo0", 3)) + continue; CHECK_DEVS; Devices[numDevs] = new_device(ifptr->ifr_name); Devices[numDevs]->type = DEVICE_TYPE_NETWORK; @@ -251,8 +272,7 @@ deviceGetAll(void) Devices[numDevs]->get = mediaGetNetwork; Devices[numDevs]->close = mediaCloseNetwork; Devices[numDevs]->private = NULL; - msgDebug("Found a device of type network named: %s\n", - ifptr->ifr_name); + msgDebug("Found a device of type network named: %s\n", ifptr->ifr_name); ++numDevs; close(s); if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) { @@ -278,8 +298,8 @@ deviceFind(char *name, DeviceType class) int i, j; for (i = 0, j = 0; i < numDevs; i++) { - if ((!name || !strcmp(Devices[i]->name, name)) && - (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) + if ((!name || !strcmp(Devices[i]->name, name)) + && (class == DEVICE_TYPE_ANY || class == Devices[i]->type)) found[j++] = Devices[i]; } found[j] = NULL; @@ -304,8 +324,7 @@ deviceCreateMenu(DMenu *menu, DeviceType type, int (*hook)()) return NULL; for (numdevs = 0; devs[numdevs]; numdevs++); - tmp = (DMenu *)safe_malloc(sizeof(DMenu) + - (sizeof(DMenuItem) * (numdevs + 1))); + tmp = (DMenu *)safe_malloc(sizeof(DMenu) + (sizeof(DMenuItem) * (numdevs + 1))); bcopy(menu, tmp, sizeof(DMenu)); for (i = 0; devs[i]; i++) { tmp->items[i].title = devs[i]->name; diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index 0f21f60..6dae821 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/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.18 1995/05/16 02:53:02 jkh Exp $ + * $Id: disks.c,v 1.19 1995/05/16 11:37:10 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -312,22 +312,20 @@ partitionHook(char *str) return devs ? 1 : 0; } -extern DMenu MenuInstall; - int diskPartitionEditor(char *str) { int scroll, choice, curr, max; - extern DMenu MenuDiskDevices; DMenu *menu; menu = deviceCreateMenu(&MenuDiskDevices, DEVICE_TYPE_DISK, partitionHook); if (!menu) { msgConfirm("No devices suitable for installation found!\n\nPlease verify that your disk controller (and attached drives) were detected properly. This can be done by selecting the ``Bootmsg'' option on the main menu and reviewing the boot messages carefully."); - return 0; } - choice = scroll = curr = max = 0; - dmenuOpen(menu, &choice, &scroll, &curr, &max); - free(menu); + else { + choice = scroll = curr = max = 0; + dmenuOpen(menu, &choice, &scroll, &curr, &max); + free(menu); + } return 0; } diff --git a/usr.sbin/sysinstall/dist.c b/usr.sbin/sysinstall/dist.c index e3951f3..42f7db2 100644 --- a/usr.sbin/sysinstall/dist.c +++ b/usr.sbin/sysinstall/dist.c @@ -4,7 +4,7 @@ * This is probably the last program in the `sysinstall' line - the next * generation being essentially a complete rewrite. * - * $Id: dist.c,v 1.4 1995/05/16 02:53:05 jkh Exp $ + * $Id: dist.c,v 1.5 1995/05/16 11:37:11 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -102,8 +102,6 @@ distSetEverything(char *str) int distSetSrc(char *str) { - extern DMenu MenuSrcDistributions; - dmenuOpenSimple(&MenuSrcDistributions); if (SrcDists) Dists |= DIST_SRC; @@ -113,9 +111,7 @@ distSetSrc(char *str) static int distSetXF86(char *str) { - extern DMenu MenuXF86; - - dmenuOpenSimple(&MenuXF86); + dmenuOpenSimple(&MenuXF86Select); return 0; } diff --git a/usr.sbin/sysinstall/dmenu.c b/usr.sbin/sysinstall/dmenu.c index d10167c..457518e 100644 --- a/usr.sbin/sysinstall/dmenu.c +++ b/usr.sbin/sysinstall/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.7 1995/05/11 06:10:50 jkh Exp $ + * $Id: dmenu.c,v 1.8 1995/05/16 02:53:07 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -125,7 +125,10 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max) (unsigned char **)nitems, (unsigned char *)result); } + + /* This seems to be the only technique that works for getting the display to look right */ dialog_clear(); + if (!rval) { if (menu->options & DMENU_MULTIPLE_TYPE) { if (menu->options & DMENU_CALL_FIRST) @@ -156,5 +159,3 @@ dmenuOpen(DMenu *menu, int *choice, int *scroll, int *curr, int *max) } } } - - diff --git a/usr.sbin/sysinstall/install.c b/usr.sbin/sysinstall/install.c index 8037234..12e20a3 100644 --- a/usr.sbin/sysinstall/install.c +++ b/usr.sbin/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.17 1995/05/16 02:53:11 jkh Exp $ + * $Id: install.c,v 1.18 1995/05/16 11:37:14 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -76,20 +76,16 @@ installCommit(char *str) msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu."); return 0; } - if (mediaVerify()) { - msgConfirm("Please correct installation media problems and try again!"); + if (!mediaVerify()) return 0; - } - if (msgYesNo("Last Chance! Are you SURE you want continue the\ninstallation? If you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before doing this.\nWe take no responsibility for lost disk contents!")) + if (msgYesNo("Last Chance! Are you SURE you want continue the installation?\n\nIf you're running this on an existing system, we STRONGLY\nencourage you to make proper backups before proceeding.\nWe take no responsibility for lost disk contents!")) return 0; mbrContents = NULL; if (!msgYesNo("Would you like to install a boot manager?\n\nThis will allow you to easily select between other operating systems\non the first disk, or boot from a disk other than the first.")) mbrContents = bteasy17; - else { - if (!msgYesNo("Would you like to remove an existing boot manager?")) - mbrContents = mbr; - } + else if (!msgYesNo("Would you like to remove an existing boot manager?")) + mbrContents = mbr; devs = deviceFind(NULL, DEVICE_TYPE_DISK); for (i = 0; devs[i]; i++) { Disk *d = (Disk *)devs[i]->private; @@ -164,8 +160,22 @@ make_filesystems(void) disk = (Disk *)devs[i]->private; if (!disk->chunks) msgFatal("No chunk list found for %s!", disk->name); + /* Make the proper device mount points in /mnt/dev */ MakeDevDisk(disk, "/mnt/dev"); + + /* Now make all the other devices the first time around */ + if (i == 0) { + extern int makedevs(void); + + chdir("/mnt"); + if (makedevs()) { + if (msgYesNo("Failed to make some of the devices in /mnt! Continue?")) + return; + } + chdir("/"); + } + for (c1 = disk->chunks->part; c1; c1 = c1->next) { if (c1->type == freebsd) { for (c2 = c1->part; c2; c2 = c2->next) { diff --git a/usr.sbin/sysinstall/label.c b/usr.sbin/sysinstall/label.c index cbbe10e..58feeef 100644 --- a/usr.sbin/sysinstall/label.c +++ b/usr.sbin/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.1 1995/05/16 02:53:13 jkh Exp $ + * $Id: label.c,v 1.2 1995/05/16 11:37:16 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -409,7 +409,7 @@ print_command_summary() move(0, 0); } -void +int diskLabelEditor(char *str) { int sz, key = 0; @@ -422,6 +422,10 @@ diskLabelEditor(char *str) keypad(stdscr, TRUE); record_label_chunks(); + if (!getenv(DISK_PARTITIONED)) { + msgConfirm("You need to partition your disk(s) before you can assign disk labels."); + return 0; + } while (labeling) { print_label_chunks(); print_command_summary(); @@ -604,6 +608,7 @@ diskLabelEditor(char *str) variable_set2(DISK_LABELLED, "yes"); clear(); refresh(); + return 0; } diff --git a/usr.sbin/sysinstall/main.c b/usr.sbin/sysinstall/main.c index c32c6ed..dfcf717 100644 --- a/usr.sbin/sysinstall/main.c +++ b/usr.sbin/sysinstall/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.6 1995/05/16 02:53:16 jkh Exp $ + * $Id: main.c,v 1.7 1995/05/16 11:37:17 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -43,8 +43,6 @@ #include "sysinstall.h" -extern DMenu MenuInitial; - int main(int argc, char **argv) { @@ -64,7 +62,7 @@ main(int argc, char **argv) systemWelcome(); /* Default to English */ - /* lang_set_English(NULL); */ + lang_set_English(NULL); /* Begin user dialog at outer menu */ while (1) { diff --git a/usr.sbin/sysinstall/media.c b/usr.sbin/sysinstall/media.c index da2fdd6..1250f52 100644 --- a/usr.sbin/sysinstall/media.c +++ b/usr.sbin/sysinstall/media.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: media.c,v 1.4 1995/05/16 02:53:18 jkh Exp $ + * $Id: media.c,v 1.5 1995/05/16 11:37:18 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -51,8 +51,6 @@ int mediaSetCDROM(char *str) { - extern DMenu MenuMediaCDROM; - if (OnCDROM == TRUE) return 1; else { @@ -72,8 +70,6 @@ mediaSetCDROM(char *str) int mediaSetFloppy(char *str) { - extern DMenu MenuMediaFloppy; - dmenuOpenSimple(&MenuMediaFloppy); if (getenv(MEDIA_DEVICE)) { variable_set2(MEDIA_TYPE, "floppy"); @@ -114,8 +110,6 @@ mediaSetTape(char *str) int mediaSetFTP(char *str) { - extern DMenu MenuMediaFTP; - dmenuOpenSimple(&MenuMediaFTP); if (getenv(MEDIA_DEVICE)) { variable_set2(MEDIA_TYPE, "ftp"); @@ -164,7 +158,6 @@ mediaExtractDist(FILE *fp) Boolean mediaGetType(void) { - extern DMenu MenuMedia; char *cp; dmenuOpenSimple(&MenuMedia); @@ -174,77 +167,13 @@ mediaGetType(void) return TRUE; } -/* Various media "strategy" routines */ -Boolean -mediaInitUFS(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetUFS(char *dist) -{ - return TRUE; -} - -/* UFS has no close routine since this is handled at the device level */ - -Boolean -mediaInitCDROM(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetCDROM(char *dist) -{ - return TRUE; -} - -void -mediaCloseCDROM(Device *dev) -{ - return; -} - -Boolean -mediaInitTape(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetTape(char *dist) -{ - return TRUE; -} - -void -mediaCloseTape(Device *dev) -{ - return; -} - -Boolean -mediaInitNetwork(Device *dev) -{ - return TRUE; -} - -Boolean -mediaGetNetwork(char *dist) -{ - return TRUE; -} - -void -mediaCloseNetwork(Device *dev) -{ -} - /* Return TRUE if all the media variables are set up correctly */ Boolean mediaVerify(void) { + if (!getenv(MEDIA_TYPE) || !getenv(MEDIA_DEVICE)) { + msgConfirm("Media type or device not set! Please select a media type\nfrom the Installation menu before proceeding."); + return FALSE; + } return TRUE; } diff --git a/usr.sbin/sysinstall/menus.c b/usr.sbin/sysinstall/menus.c index 1f4f0d0..a856919 100644 --- a/usr.sbin/sysinstall/menus.c +++ b/usr.sbin/sysinstall/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.13 1995/05/16 02:53:23 jkh Exp $ + * $Id: menus.c,v 1.14 1995/05/16 11:37:20 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -50,23 +50,6 @@ * expansion. */ -/* Forward decls for submenus */ -extern DMenu MenuDocumentation; -extern DMenu MenuOptions; -extern DMenu MenuOptionsLanguage; -extern DMenu MenuOptionsFTP; -extern DMenu MenuMedia; -extern DMenu MenuMediaFloppy; -extern DMenu MenuInstall; -extern DMenu MenuInstallType; -extern DMenu MenuInstallOptions; -extern DMenu MenuDistributions; -extern DMenu MenuXF86Select; -extern DMenu MenuXF86SelectCore; -extern DMenu MenuXF86SelectServer; -extern DMenu MenuXF86SelectFonts; -extern DMenu MenuXF86; - /* The initial installation menu */ DMenu MenuInitial = { DMENU_NORMAL_TYPE, @@ -83,7 +66,7 @@ option by pressing enter. If you'd like a shell, press ESC", /* prompt */ DMENU_SUBMENU, (void *)&MenuDocumentation, 0, 0 }, { "Options", "Select various options for this utility.", /* O */ DMENU_SUBMENU, (void *)&MenuOptions, 0, 0 }, - { "Install", "Begin installation", /* I */ + { "Proceed", "Go to the installation menu", /* P */ DMENU_SUBMENU, (void *)&MenuInstall, 0, 0 }, { NULL } }, }; @@ -168,8 +151,8 @@ because you haven't booted directly from the CDROM in DOS/Windows or\n\ your CDROM was not detected. If you feel that you are seeing this dialog\n\ in error, you may wish to reboot FreeBSD with the -c boot flag (see the\n\ hardware guide in the Documentation menu for more info) and check that your\n\ -CDROM controller and the kernel agree on reasonable values. Please also note\n\ -that FreeBSD does NOT currently support IDE CDROM drives!", +CDROM controller and the kernel agree on reasonable values. Please also\n\ +note that FreeBSD does NOT currently support IDE CDROM drives!", "Press F1 for more information on CDROM support", "media_cdrom.hlp", { { "Matsushita", "Panasonic \"Sound Blaster\" CDROM.", /* M */ @@ -208,9 +191,10 @@ DMenu MenuMediaFTP = { "FreeBSD is distributed from a number of sites on the Internet. Please\n\ select the site closest to you or \"other\" if you'd like to specify another\n\ choice. Also note that not all sites carry every possible distribution!\n\ -Distributions other than the basic user set are only guaranteed to be available\n\ -from the Primary site.\n\n\ -If the first site selected doesn't respond, try one of the alternates.", +Distributions other than the basic user set are only guaranteed to be\n\ +available from the Primary site.\n\n\ +If the first site selected doesn't respond, try one of the alternates.\n\ +You may also wish to investigate the Ftp options menu in case of trouble.", "Select a site that's close!", "media_ftp.hlp", { { "Primary", "ftp.freebsd.org", @@ -300,10 +284,10 @@ method.", DMenu MenuInstallType = { DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS, "Choose Installation Type", - "As a convenience, we provide several `canned' installation types.\n\ -These pick what we consider to be the most reasonable defaults for the\n\ + "As a convenience, we provide several \"canned\" installation types.\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'.", +the list of distributions yourself, simply select \"custom\".", "Press F1 for more information on the various distributions", "dist_types.hlp", { { "Developer", "Includes full sources, binaries and doc but no games.", @@ -421,11 +405,12 @@ DMenu MenuXF86Select = { DMENU_NORMAL_TYPE, "XFree86 3.1.1u1 Distribution", "Please select the components you need from the XFree86 3.1.1u1\n\ -distribution. Select what you need from the basic components set\n\ -and at least one entry from the Server menu and the Font set menu\n", - "Press F1 for a sample sequence", - "XF86Select.hlp", - { { "Core", "Basic component menu (required)", +distribution. We recommend that you select what you need from the basic\n\ +components set and at least one entry from the Server and Font set menus.\n\n\ +When you're finished, select Cancel.", + "Press F1 to read the XFree86 release notes for FreeBSD", + "XF86S.hlp", + { { "Basic", "Basic component menu (required)", DMENU_SUBMENU, &MenuXF86SelectCore, 0, 0 }, { "Server", "X server menu", DMENU_SUBMENU, &MenuXF86SelectServer, 0, 0 }, @@ -537,8 +522,9 @@ DMenu MenuOptions = { DMENU_NORMAL_TYPE, "Choose Installation Options", "This menu controls how the FreeBSD installation will deal with various\n\ -error conditions, should they arise, and the degree to which you, the\n\ -user, will be prompted for options.", +error conditions (should they arise), the default language used for\n\ +documentation, etc.\n\n\ +When you're done setting options, please select Cancel.", NULL, NULL, { { "Ftp Options", "Ftp options menu", @@ -578,12 +564,13 @@ to deal with it? You have one of several choices:", DMenu MenuInstall = { DMENU_NORMAL_TYPE, "Choose Installation Options", /* title */ - "Before installation can continue, you need to specify a few items\n\ -of information regarding the type of distribution you wish to have\n\ -and from where you wish to install it. There are also a number\n\ -of options you can specify in the Options menu which will determine\n\ -how. You may choose install FreeBSD at this time, you may\n\ -select Cancel to leave this menu.", + "Before installation can continue, you need to specify a few\n\ +details on the type of distribution you wish to have, where you wish\n\ +to install it from, and how you wish to allocate disk storage to FreeBSD\n\ +None of the items in this menu will actually modify the contents of\n\ +your disk until you select the \"GO!\" menu item (and even then, only\n\ +after a final confirmation). If you do not wish to install FreeBSD\n\ +at this time then select Cancel to leave this menu.", "Press F1 to read the installation guide", "install.hlp", { { "Distributions", "Choose the type of installation you want", /* T */ @@ -598,7 +585,5 @@ select Cancel to leave this menu.", DMENU_CALL, (void *)tcpOpenDialog, 0, 0 }, { "GO!", "Start the whole show and go out for coffee!", /* P */ DMENU_CALL, (void *)installCommit, 0, 0 }, - { "Options", "Set special installation options", /* O */ - DMENU_SUBMENU, (void *)&MenuOptions, 0, 0}, { NULL } }, }; diff --git a/usr.sbin/sysinstall/sysinstall.h b/usr.sbin/sysinstall/sysinstall.h index 5a86272..e3f00f0 100644 --- a/usr.sbin/sysinstall/sysinstall.h +++ b/usr.sbin/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.16 1995/05/16 02:53:26 jkh Exp $ + * $Id: sysinstall.h,v 1.17 1995/05/16 11:37:25 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -84,11 +84,10 @@ #define VAR_NAMESERVER "nameserver" #define VAR_GATEWAY "gateway" -/* per-interface flags */ -#define VAR_IFCONFIG_ARGS "if_flags" -#define VAR_NETMASK "netmask" -#define VAR_IPADDR "ip_addr" +#define VAR_IFCONFIG "ifconfig_" +/* The help file for the TCP/IP setup screen */ +#define TCP_HELPFILE "tcp.hlp" /*** Types ***/ typedef unsigned int Boolean; @@ -177,20 +176,41 @@ typedef int (*commandFunc)(char *key, void *data); /*** Externs ***/ -extern int CpioFD; /* The file descriptor for our CPIO floppy */ -extern int DebugFD; /* Where diagnostic output goes */ -extern Boolean OnCDROM; /* Are we running off of a CDROM? */ -extern Boolean OnSerial; /* Are we on a serial console? */ -extern Boolean SystemWasInstalled; /* Did we install it? */ -extern Boolean DialogActive; /* Is the dialog() stuff up? */ -extern Boolean ColorDisplay; /* Are we on a color display? */ -extern Boolean OnVTY; /* On a syscons VTY? */ -extern Variable *VarHead; /* The head of the variable chain */ -extern unsigned int Dists; /* Which distributions we want */ -extern unsigned int SrcDists; /* Which src distributions we want */ -extern unsigned int XF86Dists;/* Which XFree86 dists we want */ -extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ -extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ +extern int CpioFD; /* The file descriptor for our CPIO floppy */ +extern int DebugFD; /* Where diagnostic output goes */ +extern Boolean OnCDROM; /* Are we running off of a CDROM? */ +extern Boolean OnSerial; /* Are we on a serial console? */ +extern Boolean SystemWasInstalled; /* Did we install it? */ +extern Boolean DialogActive; /* Is the dialog() stuff up? */ +extern Boolean ColorDisplay; /* Are we on a color display? */ +extern Boolean OnVTY; /* On a syscons VTY? */ +extern Variable *VarHead; /* The head of the variable chain */ +extern unsigned int Dists; /* Which distributions we want */ +extern unsigned int SrcDists; /* Which src distributions we want */ +extern unsigned int XF86Dists; /* Which XFree86 dists we want */ +extern unsigned int XF86ServerDists; /* The XFree86 servers we want */ +extern unsigned int XF86FontDists; /* The XFree86 fonts we want */ + +extern DMenu MenuInitial; /* Initial installation menu */ +extern DMenu MenuDocumentation; /* Documentation menu */ +extern DMenu MenuOptions; /* Installation options */ +extern DMenu MenuOptionsLanguage; /* Language options menu */ +extern DMenu MenuOptionsFTP; /* FTP options menu */ +extern DMenu MenuMedia; /* Media type menu */ +extern DMenu MenuMediaCDROM; /* CDROM media menu */ +extern DMenu MenuMediaFloppy; /* Floppy media menu */ +extern DMenu MenuMediaFTP; /* FTP media menu */ +extern DMenu MenuInstall; /* Installation menu */ +extern DMenu MenuInstallType; /* Installation type menu */ +extern DMenu MenuDistributions; /* Distribution menu */ +extern DMenu MenuSrcDistributions; /* Source distribution menu */ +extern DMenu MenuXF86; /* XFree86 main menu */ +extern DMenu MenuXF86Select; /* XFree86 distribution selection menu */ +extern DMenu MenuXF86SelectCore; /* XFree86 core distribution menu */ +extern DMenu MenuXF86SelectServer; /* XFree86 server distribution menu */ +extern DMenu MenuXF86SelectFonts; /* XFree86 font selection menu */ +extern DMenu MenuDiskDevices; /* Disk devices menu */ + /*** Prototypes ***/ @@ -249,7 +269,7 @@ extern void lang_set_Spanish(char *str); extern void lang_set_Swedish(char *str); /* label.c */ -extern void diskLabelEditor(char *str); +extern int diskLabelEditor(char *str); /* makedevs.c (auto-generated) */ extern const char termcap_vt100[]; @@ -275,9 +295,13 @@ extern FILE *mediaOpen(char *parent, char *me); extern Boolean mediaGetType(void); extern Boolean mediaExtractDist(FILE *fp); extern Boolean mediaVerify(void); + +/* media_strategy.c */ extern Boolean mediaInitUFS(Device *dev); extern Boolean mediaGetUFS(char *dist); extern Boolean mediaInitCDROM(Device *dev); +extern Boolean mediaGetFloppy(char *dist); +extern Boolean mediaInitFloppy(Device *dev); extern Boolean mediaGetCDROM(char *dist); extern Boolean mediaInitTape(Device *dev); extern Boolean mediaGetTape(char *dist); @@ -286,7 +310,7 @@ extern Boolean mediaGetNetwork(char *dist); extern void mediaCloseTape(Device *dev); extern void mediaCloseCDROM(Device *dev); extern void mediaCloseNetwork(Device *dev); - +extern void mediaCloseFloppy(Device *dev); /* misc.c */ extern Boolean file_readable(char *fname); diff --git a/usr.sbin/sysinstall/tcpip.c b/usr.sbin/sysinstall/tcpip.c index 017cc2b..34a16d0 100644 --- a/usr.sbin/sysinstall/tcpip.c +++ b/usr.sbin/sysinstall/tcpip.c @@ -1,5 +1,5 @@ /* - * $Id: tcpip.c,v 1.3 1995/05/16 20:00:51 gpalmer Exp $ + * $Id: tcpip.c,v 1.4 1995/05/17 12:09:11 gpalmer Exp $ * * Copyright (c) 1995 * Gary J Palmer. All rights reserved. @@ -199,6 +199,7 @@ tcpOpenDialog(char *str) char *tmp; Device **devs; char old_iface[8]; + char help[FILENAME_MAX]; /* We need a curses window */ ds_win = newwin(LINES, COLS, 0, 0); @@ -216,9 +217,11 @@ tcpOpenDialog(char *str) iface_names[n] = (devs[n])->name; ++n; } - n_iface = --n; + n_iface = n; /* Setup a nice screen for us to splat stuff onto */ + systemHelpFile(TCP_HELPFILE, help); + use_helpfile(help); draw_box(ds_win, TCP_DIALOG_Y, TCP_DIALOG_X, TCP_DIALOG_HEIGHT, TCP_DIALOG_WIDTH, dialog_attr, border_attr); @@ -388,7 +391,7 @@ tcpOpenDialog(char *str) the next field, so we special case around getting to that field, rather than moving off the previous one. Hence we are really testing for - (n ==_IFACE) */ + (n == LAYOUT_IFACE) */ if (n == LAYOUT_IPADDR) { n = LAYOUT_OKBUTTON; @@ -517,6 +520,8 @@ tcpOpenDialog(char *str) else n = max; break; + case KEY_F(1): + display_helpfile(); /* They tried some key combination we don't support - tell them! */ default: @@ -534,6 +539,7 @@ tcpOpenDialog(char *str) /* Clear this crap off the screen */ dialog_clear(); refresh(); + use_helpfile(NULL); /* We actually need to inform the rest of sysinstall about this data now - if the user hasn't selected cancel, save the stuff @@ -557,13 +563,10 @@ tcpOpenDialog(char *str) sprintf(temp, "inet %s %s netmask %s", if_list[foo].ipaddr, if_list[foo].extras, if_list[foo].netmask); - sprintf(ifn, "ifconfig_%s", iface_names[foo]); + sprintf(ifn, "%s%s", VAR_IFCONFIG, iface_names[foo]); variable_set2(ifn, temp); } } - - return 1; } - return 0; } diff --git a/usr.sbin/sysinstall/wizard.c b/usr.sbin/sysinstall/wizard.c index dda8b57..aa4fc34 100644 --- a/usr.sbin/sysinstall/wizard.c +++ b/usr.sbin/sysinstall/wizard.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: wizard.c,v 1.1 1995/05/04 23:36:23 jkh Exp $ + * $Id: wizard.c,v 1.2 1995/05/16 02:53:31 jkh Exp $ * */ @@ -17,7 +17,7 @@ #include <string.h> #include <err.h> #include <sys/types.h> -#include "libdisk.h" +#include "sysinstall.h" u_char mbr[] = { 250,51,192,142,208,188,0,124,139,244,80,7,80,31,251,252,191,0,6,185,0,1, |