Sync up with Poul.

This commit is contained in:
Jordan K. Hubbard 1995-05-28 09:31:44 +00:00
parent 903d1c40e3
commit 87b9e01a01
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8810
25 changed files with 852 additions and 353 deletions

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.9 1995/05/26 20:45:17 jkh Exp $
* $Id: config.c,v 1.10 1995/05/26 20:55:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -172,7 +172,7 @@ configFstab(void)
}
/* Go for the burn */
msgNotify("Generating /etc/fstab file");
msgDebug("Generating /etc/fstab file");
for (i = 0; i < nchunks; i++) {
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
@ -291,12 +291,8 @@ configSaverTimeout(char *str)
void
configResolv(void)
{
static Boolean alreadyDone = FALSE;
FILE *fp;
if (alreadyDone)
return;
if (!getenv(VAR_DOMAINNAME) || !getenv(VAR_NAMESERVER)) {
msgConfirm("Warning: You haven't set a domain name or nameserver. You will need\nto configure your /etc/resolv.conf file manually to fully use network services.");
return;
@ -309,9 +305,7 @@ configResolv(void)
}
fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
fprintf(fp, "nameserver\t%s\n", getenv(VAR_NAMESERVER));
msgNotify("Wrote /etc/resolv.conf");
fclose(fp);
alreadyDone = TRUE;
}
int

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.31 1995/05/26 08:41:37 jkh Exp $
* $Id: devices.c,v 1.32 1995/05/27 23:52:55 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -90,8 +90,8 @@ static struct {
{ DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" },
{ DEVICE_TYPE_FLOPPY, "rfd0", "floppy drive unit A" },
{ DEVICE_TYPE_FLOPPY, "rfd1", "floppy drive unit B" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP device" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "lp0", "Parallel Port IP (PLIP) using laplink cable" },
{ DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" },
{ DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" },

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.61 1995/05/27 10:47:32 jkh Exp $
* $Id: install.c,v 1.62 1995/05/27 23:39:30 phk Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -197,8 +197,8 @@ installInitial(void)
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
/* stick a helpful shell over on the 4th VTY */
if (!fork()) {
int i, fd;
for (i = 0; i < 64; i++)
@ -210,37 +210,15 @@ installInitial(void)
execlp("sh", "-sh", 0);
exit(1);
}
root_extract();
/* Copy the /etc files into their rightful place */
vsystem("(cd /stand; find etc | cpio -o) | (cd /; cpio -idmv)");
root_extract();
alreadyDone = TRUE;
return TRUE;
}
static void
installFinal(void)
{
static Boolean alreadyDone = FALSE;
FILE *fp;
if (alreadyDone)
return;
configFstab();
configSysconfig();
configResolv();
/* Tack ourselves at the end of /etc/hosts */
if (getenv(VAR_IPADDR)) {
fp = fopen("/etc/hosts", "a");
fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
fclose(fp);
}
alreadyDone = TRUE;
msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
SystemWasInstalled = TRUE;
}
/*
* What happens when we select "GO". This is broken into a 3 stage installation so that
* What happens when we select "Install". This is broken into a 3 stage installation so that
* the user can do a full installation but come back here again to load more distributions,
* perhaps from a different media type. This would allow, for example, the user to load the
* majority of the system from CDROM and then use ftp to load just the DES dist.
@ -248,6 +226,9 @@ installFinal(void)
int
installCommit(char *str)
{
FILE *fp;
static Boolean hostsModified = FALSE;
if (!Dists) {
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
return 0;
@ -255,10 +236,23 @@ installCommit(char *str)
if (!mediaVerify())
return 0;
if (!installInitial())
return 0;
if (RunningAsInit) {
if (!installInitial())
return 0;
configFstab();
configResolv();
}
distExtractAll();
installFinal();
/* Tack ourselves at the end of /etc/hosts */
if (RunningAsInit && getenv(VAR_IPADDR) && !hostsModified) {
fp = fopen("/etc/hosts", "a");
fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
fclose(fp);
hostsModified = TRUE;
}
msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
SystemWasInstalled = TRUE;
return 0;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.25 1995/05/25 18:48:26 jkh Exp $
* $Id: label.c,v 1.26 1995/05/26 11:21:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -199,8 +199,11 @@ get_mountpoint(struct chunk *old)
char *val;
PartInfo *tmp;
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (old && old->private)
tmp = old->private;
else
tmp = NULL;
val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition");
if (!val || !*val) {
if (!old)
return NULL;
@ -212,23 +215,30 @@ get_mountpoint(struct chunk *old)
}
/* Is it just the same value? */
if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
if (tmp && !strcmp(tmp->mountpoint, val))
return NULL;
/* Did we use it already? */
if (check_conflict(val)) {
msgConfirm("You already have a mount point for %s assigned!", val);
return NULL;
}
/* Is it bogus? */
if (*val != '/') {
msgConfirm("Mount point must start with a / character");
return NULL;
}
/* Is it going to be mounted on root? */
if (!strcmp(val, "/")) {
if (old)
old->flags |= CHUNK_IS_ROOT;
} else if (old) {
}
else if (old)
old->flags &= ~CHUNK_IS_ROOT;
}
safe_free(old ? old->private : NULL);
safe_free(tmp);
tmp = new_part(val, TRUE, 0);
if (old) {
old->private = tmp;
@ -586,8 +596,8 @@ diskLabelEditor(char *str)
msgConfirm("%s is an invalid mount point for a DOS partition!", p->mountpoint);
strcpy(p->mountpoint, "/bogus");
}
record_label_chunks();
}
record_label_chunks();
break;
default:

View File

@ -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.9 1995/05/24 09:00:36 jkh Exp $
* $Id: main.c,v 1.10 1995/05/24 17:49:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -74,6 +74,10 @@ main(int argc, char **argv)
if (getpid() != 1 || !msgYesNo("Are you sure you wish to exit? System will reboot."))
break;
}
/* Write out any changes to /etc/sysconfig */
configSysconfig();
/* Say goodnight, Gracie */
systemShutdown();

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.33 1995/05/26 19:28:03 jkh Exp $
* $Id: menus.c,v 1.34 1995/05/27 10:47:38 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -643,8 +643,10 @@ When you're done, select Cancel",
"configure.hlp",
{ { "Add User", "Add users to the system",
DMENU_SYSTEM_COMMAND, "adduser", 0, 0 },
{ "Networking", "Configure additional network devices",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Console", "Customize system console behavior",
DMENU_SUBMENU, &MenuSyscons, 0, 0 },
{ "Networking", "Configure additional network services",
DMENU_SUBMENU, &MenuNetworking, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },
{ "Packages", "Install extra FreeBSD packaged software",
@ -653,15 +655,86 @@ When you're done, select Cancel",
DMENU_CALL, configPorts, 0, 1 },
{ "Root Password", "Set the system manager's password",
DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 },
{ "Screen", "Customize system console behavior",
DMENU_SUBMENU, &MenuSyscons, 0, 0 },
{ "Sysconfig", "Edit the system configuration file (with vi)",
DMENU_SYSTEM_COMMAND, "vi /etc/sysconfig", 0, 0 },
{ "XFree86", "Configure XFree86 (if installed)",
DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", 0, 0 },
{ NULL } },
};
DMenu MenuNetworking = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Network Services Menu",
"You may have already configured one network device (and the\n\
other various hostname/gateway/name server parameters) in the process\n\
of installing FreeBSD. This menu allows you to configure other\n\
aspects of your system's network configuration.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",
DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0 },
{ "NFS server", "This machine will be an NFS server",
DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0 },
{ "gated", "This machine wants to run gated",
DMENU_SET_VARIABLE, "gated=YES", 0, 0 },
{ "interfaces", "Configure additional interfaces",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "ntpdate", "Select a clock-syncronization server",
DMENU_SUBMENU, &MenuNTP, 0, 0 },
{ "routed", "Set flags for routed (default: -q)",
DMENU_CALL, configRoutedFlags, 0, 0 },
{ "rwhod", "This machine wants to run the rwho daemon",
DMENU_SET_VARIABLE, "rwhod=YES", 0, 0 },
{ NULL } },
};
DMenu MenuNTP = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"NTPDATE Server Selection",
"There are a number of time syncronization servers available\n\
for public use around the Internet. Please select one reasonably\n\
close to you to have your system time syncronized accordingly.",
"These are the primary open-access NTP servers",
NULL,
{ { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
DMENU_SET_VARIABLE, "ntpdate=ntp.syd.dms.csiro.au", 0, 0 },
{ "Canada", "tick.usask.ca (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=tick.usask.ca", 0, 0 },
{ "France", "canon.inria.fr (TDF clock)",
DMENU_SET_VARIABLE, "ntpdate=canon.inria.fr", 0, 0 },
{ "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.uni-erlangen.de", 0, 0 },
{ "Germany", "ntps1-0.cs.tu-berlin.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.cs.tu-berlin.de", 0, 0 },
{ "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.nc.fukuoka-u.ac.jp", 0, 0},
{ "Japan", "clock.tl.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.tl.fukuoka-u.ac.jp", 0, 0},
{ "Netherlands", "ntp0.nl.net (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=ntp0.nl.net", 0, 0 },
{ "Norway", "timer.unik.no (NTP clock)",
DMENU_SET_VARIABLE, "ntpdate=timer.unik.no", 0, 0 },
{ "Sweden", "Time1.Stupi.SE (Cesium/GPS)",
DMENU_SET_VARIABLE, "ntpdate=Time1.Stupi.SE", 0, 0 },
{ "Switzerland", "swisstime.ethz.ch (DCF77 clock)",
DMENU_SET_VARIABLE, "ntpdate=swisstime.ethz.ch", 0, 0 },
{ "U.S. East Coast", "bitsy.mit.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=bitsy.mit.edu", 0, 0 },
{ "U.S. East Coast", "otc1.psu.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=otc1.psu.edu", 0, 0 },
{ "U.S. West Coast", "apple.com (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=apple.com", 0, 0 },
{ "U.S. West Coast", "clepsydra.dec.com (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 },
{ "U.S. West Coast", "clock.llnl.gov (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 },
{ "U.S. Midwest", "ncar.ucar.edu (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=ncar.ucar.edu", 0, 0 },
{ "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)",
DMENU_SET_VARIABLE, "ntpdate=chantry.hawaii.net", 0, 0 },
{ "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=shorty.chpc.utexas.edu", 0, 0 },
{ NULL } },
};
DMenu MenuSyscons = {
DMENU_NORMAL_TYPE,
"System Console Configuration",
@ -671,15 +744,89 @@ your preference. When you are done setting configuration options,\n\
select Cancel.",
"Configure your screen saver settings",
NULL,
{ { "blank", "Screen-blanking saver",
{ { "Keymap", "Choose an alternate keyboard map",
DMENU_SUBMENU, &MenuSysconsKeymap, 0, 0 },
{ "Repeat", "Set the rate at which keys repeat",
DMENU_SUBMENU, &MenuSysconsKeyrate, 0, 0 },
{ "Saver", "Select a screen saver",
DMENU_SUBMENU, &MenuSysconsSaver, 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeymap = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"System Console Keymap",
"The default system console driver for FreeBSD (syscons) defaults\n\
to a standard \"American\" keyboard map. Users in other countries\n\
(or with different keyboard preferences) may wish to choose one of\n\
the other keymaps below.",
"Choose a keyboard map",
NULL,
{ { "Danish CP865", "Danish Code Page 865 keymap",
DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0 },
{ "Danish ISO", "Danish ISO keymap",
DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0 },
{ "French ISO", "French ISO keymap",
DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0 },
{ "German CP850", "German Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0 },
{ "German ISO", "German ISO keymap",
DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0 },
{ "Russian CP866", "Russian Code Page 866 keymap",
DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0 },
{ "Russian KOI8", "Russian koi8 keymap",
DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0 },
{ "Russian s-KOI8", "Russian shifted koi8 keymap",
DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0 },
{ "Swedish CP850", "Swedish Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0 },
{ "Swedish ISO", "Swedish ISO keymap",
DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0 },
{ "U.K. CP850", "United Kingdom Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=uk.cp850.iso", 0, 0 },
{ "U.K. ISO", "United Kingdom ISO keymap",
DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0 },
{ "U.S. ISO", "United States ISO keymap",
DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeyrate = {
DMENU_NORMAL_TYPE,
"System Console Keyboard Repeat Rate",
"This menu allows you to set the speed at which keys repeat\n\
when held down.",
"Choose a keyboard repeat rate",
NULL,
{ { "Slow", "Slow keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=slow", 0, 0 },
{ "Normal", "\"normal\" keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=normal", 0, 0 },
{ "Fast", "fast keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=fast", 0, 0 },
{ "Default", "Use default keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=NO", 0, 0 },
{ NULL } },
};
DMenu MenuSysconsSaver = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"System Console Screen Saver",
"By default, the console driver will not attempt to do anything\n\
special with your screen when it's idle. If you expect to leave your\n\
monitor switched on and idle for long periods of time then you should\n\
probably enable one of these screen savers to prevent phosphor burn-in.",
"Choose a nifty-looking screen saver",
NULL,
{ { "blank", "Simply blank the screen",
DMENU_SET_VARIABLE, "saver=star", 0, 0 },
{ "Green", "\"green\" power saver (if supported by monitor)",
{ "Green", "\"green\" power saving mode (if supported by monitor)",
DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
{ "Snake", "\"snake\" screen saver",
{ "Snake", "Draw a FreeBSD \"snake\" on your screen",
DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
{ "Star", "\"twinkling stars\" screen saver",
{ "Star", "\"twinkling stars\" effect",
DMENU_SET_VARIABLE, "saver=star", 0, 0 },
{ "Timeout", "Set screen saver timeout interval",
{ "Timeout", "Set the screen saver timeout interval",
DMENU_CALL, configSaverTimeout, 0, 0 },
{ NULL } },
};

View File

@ -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: network.c,v 1.1 1995/05/27 10:38:58 jkh Exp $
* $Id: network.c,v 1.2 1995/05/28 03:05:00 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -46,8 +46,10 @@
/* These routines deal with getting things off of network media */
#include "sysinstall.h"
#include <sys/fcntl.h>
static Boolean networkInitialized;
static Boolean startPPP(Device *devp);
Boolean
mediaInitNetwork(Device *dev)
@ -60,10 +62,14 @@ mediaInitNetwork(Device *dev)
configResolv();
if (!strncmp("cuaa", dev->name, 4)) {
if (!tcpStartPPP(dev)) {
msgConfirm("Unable to start PPP! This installation method\ncannot be used.");
return FALSE;
if (!msgYesNo("You have selected a serial-line network interface.\nDo you want to use PPP with it?")) {
if (!startPPP(dev)) {
msgConfirm("Unable to start PPP! This installation method\ncannot be used.");
return FALSE;
}
}
else
msgConfirm("Warning: SLIP is rather poorly supported in this revision\nof the installation due to the lack of a dialing utility.\nIf you can use PPP for this instead then you're much better\noff doing so, otherwise SLIP works fairly well for *hardwired*\nlinks. Use the shell on the 4TH screen (ALT-F4) to run slattach\nand otherwise set the link up, then hit return here to continue.");
}
else {
char *cp, ifconfig[64];
@ -99,11 +105,8 @@ mediaShutdownNetwork(Device *dev)
if (!networkInitialized)
return;
if (!strncmp("cuaa", dev->name, 4)) {
msgConfirm("You may now go to the 3rd screen (ALT-F3) and shut down\nyour PPP connection. It shouldn't be needed any longer\n(unless you wish to create a shell by typing ESC and\nexperiment with it further, in which case go right ahead!)");
return;
}
else {
/* If we're running PPP or SLIP, it's too much trouble to shut down so forget it */
if (strncmp("cuaa", dev->name, 4)) {
int i;
char ifconfig[64];
@ -114,10 +117,73 @@ mediaShutdownNetwork(Device *dev)
i = vsystem("ifconfig %s down", dev->name);
if (i)
msgConfirm("Warning: Unable to down the %s interface properly", dev->name);
cp = getenv(VAR_GATEWAY);
if (cp)
vsystem("route delete default");
networkInitialized = FALSE;
}
cp = getenv(VAR_GATEWAY);
if (cp)
vsystem("route delete default");
networkInitialized = FALSE;
}
int
configRoutedFlags(char *str)
{
char *val;
val = msgGetInput("-q", "Specify the flags for routed; -q is the default, -s is\na good choice for gateway machines.");
if (val)
variable_set2("routedflags", val);
return 0;
}
/* Start PPP on the 3rd screen */
static Boolean
startPPP(Device *devp)
{
int fd;
FILE *fp;
char *val;
char myaddr[16], provider[16];
fd = open("/dev/ttyv2", O_RDWR);
if (fd == -1)
return FALSE;
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
Mkdir("/etc/ppp", NULL);
vsystem("touch /etc/ppp/ppp.linkup; chmod +x /etc/ppp/ppp.linkup");
vsystem("touch /etc/ppp/ppp.secret; chmod +x /etc/ppp/ppp.secret");
fp = fopen("/etc/ppp/ppp.conf", "w");
if (!fp) {
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
return FALSE;
}
fprintf(fp, "default:\n");
fprintf(fp, " set device %s\n", devp->devname);
val = msgGetInput("115200",
"Enter the baud rate for your modem - this can be higher than the actual\nmaximum data rate since most modems can talk at one speed to the\ncomputer and at another speed to the remote end.\n\nIf you're not sure what to put here, just select the default.");
if (!val)
val = "115200";
fprintf(fp, " set speed %s\n", val);
if (getenv(VAR_GATEWAY))
strcpy(provider, getenv(VAR_GATEWAY));
else
strcpy(provider, "0");
val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\ndon't know it and would prefer to negotiate it dynamically.");
if (!val)
val = "0";
if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
strcpy(myaddr, ((DevInfo *)devp->private)->ipaddr);
else
strcpy(myaddr, "0");
fprintf(fp, " set ifaddr %s %s\n", myaddr, val);
fclose(fp);
if (!fork()) {
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
execl("/stand/ppp", "/stand/ppp", (char *)NULL);
exit(1);
}
msgConfirm("The PPP command is now started on screen 3 (type ALT-F3 to\ninteract with it, ALT-F1 to switch back here). The only command\nyou'll probably want or need to use is the \"term\" command\nwhich starts a terminal emulator you can use to talk to your\nmodem and dial the service provider. Once you're connected,\ncome back to this screen and press return. DO NOT PRESS RETURN\nHERE UNTIL THE CONNECTION IS FULLY ESTABLISHED!");
return TRUE;
}

View File

@ -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.37 1995/05/27 23:39:32 phk Exp $
* $Id: sysinstall.h,v 1.38 1995/05/28 03:05:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -197,6 +197,17 @@ typedef struct _part_info {
typedef int (*commandFunc)(char *key, void *data);
#define HOSTNAME_FIELD_LEN 256
#define IPADDR_FIELD_LEN 16
#define EXTRAS_FIELD_LEN 256
/* This is the structure that Network devices carry around in their private, erm, structures */
typedef struct _devPriv {
char ipaddr[IPADDR_FIELD_LEN];
char netmask[IPADDR_FIELD_LEN];
char extras[EXTRAS_FIELD_LEN];
} DevInfo;
/*** Externs ***/
extern int DebugFD; /* Where diagnostic output goes */
@ -229,7 +240,12 @@ extern DMenu MenuMediaFloppy; /* Floppy media menu */
extern DMenu MenuMediaFTP; /* FTP media menu */
extern DMenu MenuMediaTape; /* Tape media menu */
extern DMenu MenuNetworkDevice; /* Network device menu */
extern DMenu MenuNTP; /* NTP time server menu */
extern DMenu MenuSyscons; /* System console configuration menu */
extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */
extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */
extern DMenu MenuSysconsSaver; /* System console saver configuration menu */
extern DMenu MenuNetworking; /* Network configuration menu */
extern DMenu MenuInstall; /* Installation menu */
extern DMenu MenuInstallType; /* Installation type menu */
extern DMenu MenuDistributions; /* Distribution menu */
@ -402,6 +418,7 @@ extern char *msgGetInput(char *buf, char *fmt, ...);
/* network.c */
extern Boolean mediaInitNetwork(Device *dev);
extern void mediaShutdownNetwork(Device *dev);
extern int configRoutedFlags(char *str);
/* system.c */
extern void systemInitialize(int argc, char **argv);
@ -426,7 +443,6 @@ extern void mediaShutdownTape(Device *dev);
/* tcpip.c */
extern int tcpOpenDialog(Device *dev);
extern int tcpDeviceSelect(char *str);
extern Boolean tcpStartPPP(Device *dev);
/* termcap.c */
extern int set_termcap(void);

View File

@ -1,5 +1,5 @@
/*
* $Id: tcpip.c,v 1.23 1995/05/27 23:52:55 jkh Exp $
* $Id: tcpip.c,v 1.24 1995/05/28 03:05:06 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@ -55,10 +55,6 @@
#include "rc.h"
#include "sysinstall.h"
#define HOSTNAME_FIELD_LEN 256
#define IPADDR_FIELD_LEN 16
#define EXTRAS_FIELD_LEN 256
/* These are nasty, but they make the layout structure a lot easier ... */
static char hostname[HOSTNAME_FIELD_LEN], domainname[HOSTNAME_FIELD_LEN],
@ -72,13 +68,6 @@ static char ipaddr[IPADDR_FIELD_LEN], netmask[IPADDR_FIELD_LEN], extras[EXTRAS_
#define TCP_DIALOG_WIDTH COLS - 16
#define TCP_DIALOG_HEIGHT LINES - 2
/* This is the structure that Network devices carry around in their private, erm, structures */
typedef struct _devPriv {
char ipaddr[IPADDR_FIELD_LEN];
char netmask[IPADDR_FIELD_LEN];
char extras[EXTRAS_FIELD_LEN];
} DevInfo;
/* The screen layout structure */
typedef struct _layout {
int y; /* x & Y co-ordinates */
@ -461,56 +450,3 @@ tcpDeviceSelect(char *str)
free(menu);
return 0;
}
/* Start PPP on the 3rd screen */
Boolean
tcpStartPPP(Device *devp)
{
int fd;
FILE *fp;
char *val;
char myaddr[16], provider[16];
fd = open("/dev/ttyv2", O_RDWR);
if (fd == -1)
return FALSE;
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
Mkdir("/etc/ppp", NULL);
vsystem("touch /etc/ppp/ppp.linkup; chmod +x /etc/ppp/ppp.linkup");
vsystem("touch /etc/ppp/ppp.secret; chmod +x /etc/ppp/ppp.secret");
fp = fopen("/etc/ppp/ppp.conf", "w");
if (!fp) {
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
return FALSE;
}
fprintf(fp, "default:\n");
fprintf(fp, " set device %s\n", devp->devname);
val = msgGetInput("115200",
"Enter baud rate for your modem - this can be higher than the actual\nmaximum data rate since most modems can talk at one speed to the\ncomputer and at another speed to the remote end.\n\nIf you're not sure what to put here, just select the default.");
if (!val)
val = "115200";
fprintf(fp, " set speed %s\n", val);
if (getenv(VAR_GATEWAY))
strcpy(provider, getenv(VAR_GATEWAY));
else
strcpy(provider, "0");
val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\ndon't know it and would prefer to negotiate it dynamically.");
if (!val)
val = "0";
if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
strcpy(myaddr, ((DevInfo *)devp->private)->ipaddr);
else
strcpy(myaddr, "0");
fprintf(fp, " set ifaddr %s %s\n", myaddr, val);
fclose(fp);
if (!fork()) {
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
execl("/stand/ppp", "/stand/ppp", (char *)NULL);
exit(1);
}
msgConfirm("The PPP command is now started on screen 3 (type ALT-F3 to\ninteract with it, ALT-F1 to switch back here). The only command\nyou'll probably want or need to use is the \"term\" command\nwhich starts a terminal emulator you can use to talk to your\nmodem and dial the service provider. Once you're connected,\ncome back to this screen and hit return. DO NOT PRESS RETURN\nHERE UNTIL THE CONNECTION IS FULLY ESTABLISHED!");
return TRUE;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.9 1995/05/26 20:45:17 jkh Exp $
* $Id: config.c,v 1.10 1995/05/26 20:55:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -172,7 +172,7 @@ configFstab(void)
}
/* Go for the burn */
msgNotify("Generating /etc/fstab file");
msgDebug("Generating /etc/fstab file");
for (i = 0; i < nchunks; i++) {
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
@ -291,12 +291,8 @@ configSaverTimeout(char *str)
void
configResolv(void)
{
static Boolean alreadyDone = FALSE;
FILE *fp;
if (alreadyDone)
return;
if (!getenv(VAR_DOMAINNAME) || !getenv(VAR_NAMESERVER)) {
msgConfirm("Warning: You haven't set a domain name or nameserver. You will need\nto configure your /etc/resolv.conf file manually to fully use network services.");
return;
@ -309,9 +305,7 @@ configResolv(void)
}
fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
fprintf(fp, "nameserver\t%s\n", getenv(VAR_NAMESERVER));
msgNotify("Wrote /etc/resolv.conf");
fclose(fp);
alreadyDone = TRUE;
}
int

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.31 1995/05/26 08:41:37 jkh Exp $
* $Id: devices.c,v 1.32 1995/05/27 23:52:55 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -90,8 +90,8 @@ static struct {
{ DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" },
{ DEVICE_TYPE_FLOPPY, "rfd0", "floppy drive unit A" },
{ DEVICE_TYPE_FLOPPY, "rfd1", "floppy drive unit B" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP device" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "lp0", "Parallel Port IP (PLIP) using laplink cable" },
{ DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" },
{ DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" },

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.61 1995/05/27 10:47:32 jkh Exp $
* $Id: install.c,v 1.62 1995/05/27 23:39:30 phk Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -197,8 +197,8 @@ installInitial(void)
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
/* stick a helpful shell over on the 4th VTY */
if (!fork()) {
int i, fd;
for (i = 0; i < 64; i++)
@ -210,37 +210,15 @@ installInitial(void)
execlp("sh", "-sh", 0);
exit(1);
}
root_extract();
/* Copy the /etc files into their rightful place */
vsystem("(cd /stand; find etc | cpio -o) | (cd /; cpio -idmv)");
root_extract();
alreadyDone = TRUE;
return TRUE;
}
static void
installFinal(void)
{
static Boolean alreadyDone = FALSE;
FILE *fp;
if (alreadyDone)
return;
configFstab();
configSysconfig();
configResolv();
/* Tack ourselves at the end of /etc/hosts */
if (getenv(VAR_IPADDR)) {
fp = fopen("/etc/hosts", "a");
fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
fclose(fp);
}
alreadyDone = TRUE;
msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
SystemWasInstalled = TRUE;
}
/*
* What happens when we select "GO". This is broken into a 3 stage installation so that
* What happens when we select "Install". This is broken into a 3 stage installation so that
* the user can do a full installation but come back here again to load more distributions,
* perhaps from a different media type. This would allow, for example, the user to load the
* majority of the system from CDROM and then use ftp to load just the DES dist.
@ -248,6 +226,9 @@ installFinal(void)
int
installCommit(char *str)
{
FILE *fp;
static Boolean hostsModified = FALSE;
if (!Dists) {
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
return 0;
@ -255,10 +236,23 @@ installCommit(char *str)
if (!mediaVerify())
return 0;
if (!installInitial())
return 0;
if (RunningAsInit) {
if (!installInitial())
return 0;
configFstab();
configResolv();
}
distExtractAll();
installFinal();
/* Tack ourselves at the end of /etc/hosts */
if (RunningAsInit && getenv(VAR_IPADDR) && !hostsModified) {
fp = fopen("/etc/hosts", "a");
fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
fclose(fp);
hostsModified = TRUE;
}
msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
SystemWasInstalled = TRUE;
return 0;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.25 1995/05/25 18:48:26 jkh Exp $
* $Id: label.c,v 1.26 1995/05/26 11:21:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -199,8 +199,11 @@ get_mountpoint(struct chunk *old)
char *val;
PartInfo *tmp;
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (old && old->private)
tmp = old->private;
else
tmp = NULL;
val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition");
if (!val || !*val) {
if (!old)
return NULL;
@ -212,23 +215,30 @@ get_mountpoint(struct chunk *old)
}
/* Is it just the same value? */
if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
if (tmp && !strcmp(tmp->mountpoint, val))
return NULL;
/* Did we use it already? */
if (check_conflict(val)) {
msgConfirm("You already have a mount point for %s assigned!", val);
return NULL;
}
/* Is it bogus? */
if (*val != '/') {
msgConfirm("Mount point must start with a / character");
return NULL;
}
/* Is it going to be mounted on root? */
if (!strcmp(val, "/")) {
if (old)
old->flags |= CHUNK_IS_ROOT;
} else if (old) {
}
else if (old)
old->flags &= ~CHUNK_IS_ROOT;
}
safe_free(old ? old->private : NULL);
safe_free(tmp);
tmp = new_part(val, TRUE, 0);
if (old) {
old->private = tmp;
@ -586,8 +596,8 @@ diskLabelEditor(char *str)
msgConfirm("%s is an invalid mount point for a DOS partition!", p->mountpoint);
strcpy(p->mountpoint, "/bogus");
}
record_label_chunks();
}
record_label_chunks();
break;
default:

View File

@ -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.9 1995/05/24 09:00:36 jkh Exp $
* $Id: main.c,v 1.10 1995/05/24 17:49:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -74,6 +74,10 @@ main(int argc, char **argv)
if (getpid() != 1 || !msgYesNo("Are you sure you wish to exit? System will reboot."))
break;
}
/* Write out any changes to /etc/sysconfig */
configSysconfig();
/* Say goodnight, Gracie */
systemShutdown();

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.33 1995/05/26 19:28:03 jkh Exp $
* $Id: menus.c,v 1.34 1995/05/27 10:47:38 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -643,8 +643,10 @@ When you're done, select Cancel",
"configure.hlp",
{ { "Add User", "Add users to the system",
DMENU_SYSTEM_COMMAND, "adduser", 0, 0 },
{ "Networking", "Configure additional network devices",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Console", "Customize system console behavior",
DMENU_SUBMENU, &MenuSyscons, 0, 0 },
{ "Networking", "Configure additional network services",
DMENU_SUBMENU, &MenuNetworking, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },
{ "Packages", "Install extra FreeBSD packaged software",
@ -653,15 +655,86 @@ When you're done, select Cancel",
DMENU_CALL, configPorts, 0, 1 },
{ "Root Password", "Set the system manager's password",
DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 },
{ "Screen", "Customize system console behavior",
DMENU_SUBMENU, &MenuSyscons, 0, 0 },
{ "Sysconfig", "Edit the system configuration file (with vi)",
DMENU_SYSTEM_COMMAND, "vi /etc/sysconfig", 0, 0 },
{ "XFree86", "Configure XFree86 (if installed)",
DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", 0, 0 },
{ NULL } },
};
DMenu MenuNetworking = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Network Services Menu",
"You may have already configured one network device (and the\n\
other various hostname/gateway/name server parameters) in the process\n\
of installing FreeBSD. This menu allows you to configure other\n\
aspects of your system's network configuration.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",
DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0 },
{ "NFS server", "This machine will be an NFS server",
DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0 },
{ "gated", "This machine wants to run gated",
DMENU_SET_VARIABLE, "gated=YES", 0, 0 },
{ "interfaces", "Configure additional interfaces",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "ntpdate", "Select a clock-syncronization server",
DMENU_SUBMENU, &MenuNTP, 0, 0 },
{ "routed", "Set flags for routed (default: -q)",
DMENU_CALL, configRoutedFlags, 0, 0 },
{ "rwhod", "This machine wants to run the rwho daemon",
DMENU_SET_VARIABLE, "rwhod=YES", 0, 0 },
{ NULL } },
};
DMenu MenuNTP = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"NTPDATE Server Selection",
"There are a number of time syncronization servers available\n\
for public use around the Internet. Please select one reasonably\n\
close to you to have your system time syncronized accordingly.",
"These are the primary open-access NTP servers",
NULL,
{ { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
DMENU_SET_VARIABLE, "ntpdate=ntp.syd.dms.csiro.au", 0, 0 },
{ "Canada", "tick.usask.ca (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=tick.usask.ca", 0, 0 },
{ "France", "canon.inria.fr (TDF clock)",
DMENU_SET_VARIABLE, "ntpdate=canon.inria.fr", 0, 0 },
{ "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.uni-erlangen.de", 0, 0 },
{ "Germany", "ntps1-0.cs.tu-berlin.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.cs.tu-berlin.de", 0, 0 },
{ "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.nc.fukuoka-u.ac.jp", 0, 0},
{ "Japan", "clock.tl.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.tl.fukuoka-u.ac.jp", 0, 0},
{ "Netherlands", "ntp0.nl.net (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=ntp0.nl.net", 0, 0 },
{ "Norway", "timer.unik.no (NTP clock)",
DMENU_SET_VARIABLE, "ntpdate=timer.unik.no", 0, 0 },
{ "Sweden", "Time1.Stupi.SE (Cesium/GPS)",
DMENU_SET_VARIABLE, "ntpdate=Time1.Stupi.SE", 0, 0 },
{ "Switzerland", "swisstime.ethz.ch (DCF77 clock)",
DMENU_SET_VARIABLE, "ntpdate=swisstime.ethz.ch", 0, 0 },
{ "U.S. East Coast", "bitsy.mit.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=bitsy.mit.edu", 0, 0 },
{ "U.S. East Coast", "otc1.psu.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=otc1.psu.edu", 0, 0 },
{ "U.S. West Coast", "apple.com (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=apple.com", 0, 0 },
{ "U.S. West Coast", "clepsydra.dec.com (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 },
{ "U.S. West Coast", "clock.llnl.gov (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 },
{ "U.S. Midwest", "ncar.ucar.edu (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=ncar.ucar.edu", 0, 0 },
{ "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)",
DMENU_SET_VARIABLE, "ntpdate=chantry.hawaii.net", 0, 0 },
{ "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=shorty.chpc.utexas.edu", 0, 0 },
{ NULL } },
};
DMenu MenuSyscons = {
DMENU_NORMAL_TYPE,
"System Console Configuration",
@ -671,15 +744,89 @@ your preference. When you are done setting configuration options,\n\
select Cancel.",
"Configure your screen saver settings",
NULL,
{ { "blank", "Screen-blanking saver",
{ { "Keymap", "Choose an alternate keyboard map",
DMENU_SUBMENU, &MenuSysconsKeymap, 0, 0 },
{ "Repeat", "Set the rate at which keys repeat",
DMENU_SUBMENU, &MenuSysconsKeyrate, 0, 0 },
{ "Saver", "Select a screen saver",
DMENU_SUBMENU, &MenuSysconsSaver, 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeymap = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"System Console Keymap",
"The default system console driver for FreeBSD (syscons) defaults\n\
to a standard \"American\" keyboard map. Users in other countries\n\
(or with different keyboard preferences) may wish to choose one of\n\
the other keymaps below.",
"Choose a keyboard map",
NULL,
{ { "Danish CP865", "Danish Code Page 865 keymap",
DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0 },
{ "Danish ISO", "Danish ISO keymap",
DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0 },
{ "French ISO", "French ISO keymap",
DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0 },
{ "German CP850", "German Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0 },
{ "German ISO", "German ISO keymap",
DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0 },
{ "Russian CP866", "Russian Code Page 866 keymap",
DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0 },
{ "Russian KOI8", "Russian koi8 keymap",
DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0 },
{ "Russian s-KOI8", "Russian shifted koi8 keymap",
DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0 },
{ "Swedish CP850", "Swedish Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0 },
{ "Swedish ISO", "Swedish ISO keymap",
DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0 },
{ "U.K. CP850", "United Kingdom Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=uk.cp850.iso", 0, 0 },
{ "U.K. ISO", "United Kingdom ISO keymap",
DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0 },
{ "U.S. ISO", "United States ISO keymap",
DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeyrate = {
DMENU_NORMAL_TYPE,
"System Console Keyboard Repeat Rate",
"This menu allows you to set the speed at which keys repeat\n\
when held down.",
"Choose a keyboard repeat rate",
NULL,
{ { "Slow", "Slow keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=slow", 0, 0 },
{ "Normal", "\"normal\" keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=normal", 0, 0 },
{ "Fast", "fast keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=fast", 0, 0 },
{ "Default", "Use default keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=NO", 0, 0 },
{ NULL } },
};
DMenu MenuSysconsSaver = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"System Console Screen Saver",
"By default, the console driver will not attempt to do anything\n\
special with your screen when it's idle. If you expect to leave your\n\
monitor switched on and idle for long periods of time then you should\n\
probably enable one of these screen savers to prevent phosphor burn-in.",
"Choose a nifty-looking screen saver",
NULL,
{ { "blank", "Simply blank the screen",
DMENU_SET_VARIABLE, "saver=star", 0, 0 },
{ "Green", "\"green\" power saver (if supported by monitor)",
{ "Green", "\"green\" power saving mode (if supported by monitor)",
DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
{ "Snake", "\"snake\" screen saver",
{ "Snake", "Draw a FreeBSD \"snake\" on your screen",
DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
{ "Star", "\"twinkling stars\" screen saver",
{ "Star", "\"twinkling stars\" effect",
DMENU_SET_VARIABLE, "saver=star", 0, 0 },
{ "Timeout", "Set screen saver timeout interval",
{ "Timeout", "Set the screen saver timeout interval",
DMENU_CALL, configSaverTimeout, 0, 0 },
{ NULL } },
};

View File

@ -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.37 1995/05/27 23:39:32 phk Exp $
* $Id: sysinstall.h,v 1.38 1995/05/28 03:05:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -197,6 +197,17 @@ typedef struct _part_info {
typedef int (*commandFunc)(char *key, void *data);
#define HOSTNAME_FIELD_LEN 256
#define IPADDR_FIELD_LEN 16
#define EXTRAS_FIELD_LEN 256
/* This is the structure that Network devices carry around in their private, erm, structures */
typedef struct _devPriv {
char ipaddr[IPADDR_FIELD_LEN];
char netmask[IPADDR_FIELD_LEN];
char extras[EXTRAS_FIELD_LEN];
} DevInfo;
/*** Externs ***/
extern int DebugFD; /* Where diagnostic output goes */
@ -229,7 +240,12 @@ extern DMenu MenuMediaFloppy; /* Floppy media menu */
extern DMenu MenuMediaFTP; /* FTP media menu */
extern DMenu MenuMediaTape; /* Tape media menu */
extern DMenu MenuNetworkDevice; /* Network device menu */
extern DMenu MenuNTP; /* NTP time server menu */
extern DMenu MenuSyscons; /* System console configuration menu */
extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */
extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */
extern DMenu MenuSysconsSaver; /* System console saver configuration menu */
extern DMenu MenuNetworking; /* Network configuration menu */
extern DMenu MenuInstall; /* Installation menu */
extern DMenu MenuInstallType; /* Installation type menu */
extern DMenu MenuDistributions; /* Distribution menu */
@ -402,6 +418,7 @@ extern char *msgGetInput(char *buf, char *fmt, ...);
/* network.c */
extern Boolean mediaInitNetwork(Device *dev);
extern void mediaShutdownNetwork(Device *dev);
extern int configRoutedFlags(char *str);
/* system.c */
extern void systemInitialize(int argc, char **argv);
@ -426,7 +443,6 @@ extern void mediaShutdownTape(Device *dev);
/* tcpip.c */
extern int tcpOpenDialog(Device *dev);
extern int tcpDeviceSelect(char *str);
extern Boolean tcpStartPPP(Device *dev);
/* termcap.c */
extern int set_termcap(void);

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: config.c,v 1.9 1995/05/26 20:45:17 jkh Exp $
* $Id: config.c,v 1.10 1995/05/26 20:55:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -172,7 +172,7 @@ configFstab(void)
}
/* Go for the burn */
msgNotify("Generating /etc/fstab file");
msgDebug("Generating /etc/fstab file");
for (i = 0; i < nchunks; i++) {
fprintf(fstab, "/dev/%s\t\t\t%s\t\t%s %s %d %d\n", nameof(chunk_list[i]), mount_point(chunk_list[i]),
fstype(chunk_list[i]), fstype_short(chunk_list[i]), seq_num(chunk_list[i]),
@ -291,12 +291,8 @@ configSaverTimeout(char *str)
void
configResolv(void)
{
static Boolean alreadyDone = FALSE;
FILE *fp;
if (alreadyDone)
return;
if (!getenv(VAR_DOMAINNAME) || !getenv(VAR_NAMESERVER)) {
msgConfirm("Warning: You haven't set a domain name or nameserver. You will need\nto configure your /etc/resolv.conf file manually to fully use network services.");
return;
@ -309,9 +305,7 @@ configResolv(void)
}
fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
fprintf(fp, "nameserver\t%s\n", getenv(VAR_NAMESERVER));
msgNotify("Wrote /etc/resolv.conf");
fclose(fp);
alreadyDone = TRUE;
}
int

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: devices.c,v 1.31 1995/05/26 08:41:37 jkh Exp $
* $Id: devices.c,v 1.32 1995/05/27 23:52:55 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -90,8 +90,8 @@ static struct {
{ DEVICE_TYPE_DISK, "wd", "IDE/ESDI/MFM/ST506 disk device" },
{ DEVICE_TYPE_FLOPPY, "rfd0", "floppy drive unit A" },
{ DEVICE_TYPE_FLOPPY, "rfd1", "floppy drive unit B" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP device" },
{ DEVICE_TYPE_NETWORK, "cuaa0", "Serial port (COM1) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "cuaa1", "Serial port (COM2) - possible PPP/SLIP device" },
{ DEVICE_TYPE_NETWORK, "lp0", "Parallel Port IP (PLIP) using laplink cable" },
{ DEVICE_TYPE_NETWORK, "lo", "Loop-back (local) network interface" },
{ DEVICE_TYPE_NETWORK, "sl", "Serial-line IP (SLIP) interface" },

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: install.c,v 1.61 1995/05/27 10:47:32 jkh Exp $
* $Id: install.c,v 1.62 1995/05/27 23:39:30 phk Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -197,8 +197,8 @@ installInitial(void)
chroot("/mnt");
chdir("/");
variable_set2(RUNNING_ON_ROOT, "yes");
/* If we're running as init, stick a shell over on the 4th VTY */
if (RunningAsInit && !fork()) {
/* stick a helpful shell over on the 4th VTY */
if (!fork()) {
int i, fd;
for (i = 0; i < 64; i++)
@ -210,37 +210,15 @@ installInitial(void)
execlp("sh", "-sh", 0);
exit(1);
}
root_extract();
/* Copy the /etc files into their rightful place */
vsystem("(cd /stand; find etc | cpio -o) | (cd /; cpio -idmv)");
root_extract();
alreadyDone = TRUE;
return TRUE;
}
static void
installFinal(void)
{
static Boolean alreadyDone = FALSE;
FILE *fp;
if (alreadyDone)
return;
configFstab();
configSysconfig();
configResolv();
/* Tack ourselves at the end of /etc/hosts */
if (getenv(VAR_IPADDR)) {
fp = fopen("/etc/hosts", "a");
fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
fclose(fp);
}
alreadyDone = TRUE;
msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
SystemWasInstalled = TRUE;
}
/*
* What happens when we select "GO". This is broken into a 3 stage installation so that
* What happens when we select "Install". This is broken into a 3 stage installation so that
* the user can do a full installation but come back here again to load more distributions,
* perhaps from a different media type. This would allow, for example, the user to load the
* majority of the system from CDROM and then use ftp to load just the DES dist.
@ -248,6 +226,9 @@ installFinal(void)
int
installCommit(char *str)
{
FILE *fp;
static Boolean hostsModified = FALSE;
if (!Dists) {
msgConfirm("You haven't told me what distributions to load yet!\nPlease select a distribution from the Distributions menu.");
return 0;
@ -255,10 +236,23 @@ installCommit(char *str)
if (!mediaVerify())
return 0;
if (!installInitial())
return 0;
if (RunningAsInit) {
if (!installInitial())
return 0;
configFstab();
configResolv();
}
distExtractAll();
installFinal();
/* Tack ourselves at the end of /etc/hosts */
if (RunningAsInit && getenv(VAR_IPADDR) && !hostsModified) {
fp = fopen("/etc/hosts", "a");
fprintf(fp, "%s\t\t%s\n", getenv(VAR_IPADDR), getenv(VAR_HOSTNAME));
fclose(fp);
hostsModified = TRUE;
}
msgConfirm("Installation completed successfully.\nHit return now to go back to the main menu.");
SystemWasInstalled = TRUE;
return 0;
}

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: label.c,v 1.25 1995/05/25 18:48:26 jkh Exp $
* $Id: label.c,v 1.26 1995/05/26 11:21:46 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -199,8 +199,11 @@ get_mountpoint(struct chunk *old)
char *val;
PartInfo *tmp;
val = msgGetInput(old && old->private ? ((PartInfo *)old->private)->mountpoint : NULL,
"Please specify a mount point for the partition");
if (old && old->private)
tmp = old->private;
else
tmp = NULL;
val = msgGetInput(tmp ? tmp->mountpoint : NULL, "Please specify a mount point for the partition");
if (!val || !*val) {
if (!old)
return NULL;
@ -212,23 +215,30 @@ get_mountpoint(struct chunk *old)
}
/* Is it just the same value? */
if (old && old->private && !strcmp(((PartInfo *)old->private)->mountpoint, val))
if (tmp && !strcmp(tmp->mountpoint, val))
return NULL;
/* Did we use it already? */
if (check_conflict(val)) {
msgConfirm("You already have a mount point for %s assigned!", val);
return NULL;
}
/* Is it bogus? */
if (*val != '/') {
msgConfirm("Mount point must start with a / character");
return NULL;
}
/* Is it going to be mounted on root? */
if (!strcmp(val, "/")) {
if (old)
old->flags |= CHUNK_IS_ROOT;
} else if (old) {
}
else if (old)
old->flags &= ~CHUNK_IS_ROOT;
}
safe_free(old ? old->private : NULL);
safe_free(tmp);
tmp = new_part(val, TRUE, 0);
if (old) {
old->private = tmp;
@ -586,8 +596,8 @@ diskLabelEditor(char *str)
msgConfirm("%s is an invalid mount point for a DOS partition!", p->mountpoint);
strcpy(p->mountpoint, "/bogus");
}
record_label_chunks();
}
record_label_chunks();
break;
default:

View File

@ -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.9 1995/05/24 09:00:36 jkh Exp $
* $Id: main.c,v 1.10 1995/05/24 17:49:17 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -74,6 +74,10 @@ main(int argc, char **argv)
if (getpid() != 1 || !msgYesNo("Are you sure you wish to exit? System will reboot."))
break;
}
/* Write out any changes to /etc/sysconfig */
configSysconfig();
/* Say goodnight, Gracie */
systemShutdown();

View File

@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
* $Id: menus.c,v 1.33 1995/05/26 19:28:03 jkh Exp $
* $Id: menus.c,v 1.34 1995/05/27 10:47:38 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -643,8 +643,10 @@ When you're done, select Cancel",
"configure.hlp",
{ { "Add User", "Add users to the system",
DMENU_SYSTEM_COMMAND, "adduser", 0, 0 },
{ "Networking", "Configure additional network devices",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "Console", "Customize system console behavior",
DMENU_SUBMENU, &MenuSyscons, 0, 0 },
{ "Networking", "Configure additional network services",
DMENU_SUBMENU, &MenuNetworking, 0, 0 },
{ "Time Zone", "Set which time zone you're in",
DMENU_SYSTEM_COMMAND, "tzsetup", 0, 0 },
{ "Packages", "Install extra FreeBSD packaged software",
@ -653,15 +655,86 @@ When you're done, select Cancel",
DMENU_CALL, configPorts, 0, 1 },
{ "Root Password", "Set the system manager's password",
DMENU_SYSTEM_COMMAND, "passwd root", 0, 0 },
{ "Screen", "Customize system console behavior",
DMENU_SUBMENU, &MenuSyscons, 0, 0 },
{ "Sysconfig", "Edit the system configuration file (with vi)",
DMENU_SYSTEM_COMMAND, "vi /etc/sysconfig", 0, 0 },
{ "XFree86", "Configure XFree86 (if installed)",
DMENU_SYSTEM_COMMAND, "PATH=/usr/bin:/bin:/usr/X11R6/bin xf86config", 0, 0 },
{ NULL } },
};
DMenu MenuNetworking = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Network Services Menu",
"You may have already configured one network device (and the\n\
other various hostname/gateway/name server parameters) in the process\n\
of installing FreeBSD. This menu allows you to configure other\n\
aspects of your system's network configuration.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",
DMENU_SET_VARIABLE, "nfs_client=YES", 0, 0 },
{ "NFS server", "This machine will be an NFS server",
DMENU_SET_VARIABLE, "nfs_server=YES", 0, 0 },
{ "gated", "This machine wants to run gated",
DMENU_SET_VARIABLE, "gated=YES", 0, 0 },
{ "interfaces", "Configure additional interfaces",
DMENU_CALL, tcpDeviceSelect, 0, 0 },
{ "ntpdate", "Select a clock-syncronization server",
DMENU_SUBMENU, &MenuNTP, 0, 0 },
{ "routed", "Set flags for routed (default: -q)",
DMENU_CALL, configRoutedFlags, 0, 0 },
{ "rwhod", "This machine wants to run the rwho daemon",
DMENU_SET_VARIABLE, "rwhod=YES", 0, 0 },
{ NULL } },
};
DMenu MenuNTP = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"NTPDATE Server Selection",
"There are a number of time syncronization servers available\n\
for public use around the Internet. Please select one reasonably\n\
close to you to have your system time syncronized accordingly.",
"These are the primary open-access NTP servers",
NULL,
{ { "Australia", "ntp.syd.dms.csiro.au (HP 5061 Cesium Beam)",
DMENU_SET_VARIABLE, "ntpdate=ntp.syd.dms.csiro.au", 0, 0 },
{ "Canada", "tick.usask.ca (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=tick.usask.ca", 0, 0 },
{ "France", "canon.inria.fr (TDF clock)",
DMENU_SET_VARIABLE, "ntpdate=canon.inria.fr", 0, 0 },
{ "Germany", "ntps1-{0,1,2}.uni-erlangen.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.uni-erlangen.de", 0, 0 },
{ "Germany", "ntps1-0.cs.tu-berlin.de (GPS)",
DMENU_SET_VARIABLE, "ntpdate=ntps1-0.cs.tu-berlin.de", 0, 0 },
{ "Japan", "clock.nc.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.nc.fukuoka-u.ac.jp", 0, 0},
{ "Japan", "clock.tl.fukuoka-u.ac.jp (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=clock.tl.fukuoka-u.ac.jp", 0, 0},
{ "Netherlands", "ntp0.nl.net (GPS clock)",
DMENU_SET_VARIABLE, "ntpdate=ntp0.nl.net", 0, 0 },
{ "Norway", "timer.unik.no (NTP clock)",
DMENU_SET_VARIABLE, "ntpdate=timer.unik.no", 0, 0 },
{ "Sweden", "Time1.Stupi.SE (Cesium/GPS)",
DMENU_SET_VARIABLE, "ntpdate=Time1.Stupi.SE", 0, 0 },
{ "Switzerland", "swisstime.ethz.ch (DCF77 clock)",
DMENU_SET_VARIABLE, "ntpdate=swisstime.ethz.ch", 0, 0 },
{ "U.S. East Coast", "bitsy.mit.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=bitsy.mit.edu", 0, 0 },
{ "U.S. East Coast", "otc1.psu.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=otc1.psu.edu", 0, 0 },
{ "U.S. West Coast", "apple.com (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=apple.com", 0, 0 },
{ "U.S. West Coast", "clepsydra.dec.com (GOES clock)",
DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 },
{ "U.S. West Coast", "clock.llnl.gov (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=clepsydra.dec.com", 0, 0 },
{ "U.S. Midwest", "ncar.ucar.edu (WWVB clock)",
DMENU_SET_VARIABLE, "ntpdate=ncar.ucar.edu", 0, 0 },
{ "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)",
DMENU_SET_VARIABLE, "ntpdate=chantry.hawaii.net", 0, 0 },
{ "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)",
DMENU_SET_VARIABLE, "ntpdate=shorty.chpc.utexas.edu", 0, 0 },
{ NULL } },
};
DMenu MenuSyscons = {
DMENU_NORMAL_TYPE,
"System Console Configuration",
@ -671,15 +744,89 @@ your preference. When you are done setting configuration options,\n\
select Cancel.",
"Configure your screen saver settings",
NULL,
{ { "blank", "Screen-blanking saver",
{ { "Keymap", "Choose an alternate keyboard map",
DMENU_SUBMENU, &MenuSysconsKeymap, 0, 0 },
{ "Repeat", "Set the rate at which keys repeat",
DMENU_SUBMENU, &MenuSysconsKeyrate, 0, 0 },
{ "Saver", "Select a screen saver",
DMENU_SUBMENU, &MenuSysconsSaver, 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeymap = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"System Console Keymap",
"The default system console driver for FreeBSD (syscons) defaults\n\
to a standard \"American\" keyboard map. Users in other countries\n\
(or with different keyboard preferences) may wish to choose one of\n\
the other keymaps below.",
"Choose a keyboard map",
NULL,
{ { "Danish CP865", "Danish Code Page 865 keymap",
DMENU_SET_VARIABLE, "keymap=danish.cp865", 0, 0 },
{ "Danish ISO", "Danish ISO keymap",
DMENU_SET_VARIABLE, "keymap=danish.iso", 0, 0 },
{ "French ISO", "French ISO keymap",
DMENU_SET_VARIABLE, "keymap=fr.iso", 0, 0 },
{ "German CP850", "German Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=german.cp850", 0, 0 },
{ "German ISO", "German ISO keymap",
DMENU_SET_VARIABLE, "keymap=german.iso", 0, 0 },
{ "Russian CP866", "Russian Code Page 866 keymap",
DMENU_SET_VARIABLE, "keymap=ru.cp866", 0, 0 },
{ "Russian KOI8", "Russian koi8 keymap",
DMENU_SET_VARIABLE, "keymap=ru.koi8-r", 0, 0 },
{ "Russian s-KOI8", "Russian shifted koi8 keymap",
DMENU_SET_VARIABLE, "keymap=ru.koi8-r.shift", 0, 0 },
{ "Swedish CP850", "Swedish Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=swedish.cp850", 0, 0 },
{ "Swedish ISO", "Swedish ISO keymap",
DMENU_SET_VARIABLE, "keymap=swedish.iso", 0, 0 },
{ "U.K. CP850", "United Kingdom Code Page 850 keymap",
DMENU_SET_VARIABLE, "keymap=uk.cp850.iso", 0, 0 },
{ "U.K. ISO", "United Kingdom ISO keymap",
DMENU_SET_VARIABLE, "keymap=uk.iso", 0, 0 },
{ "U.S. ISO", "United States ISO keymap",
DMENU_SET_VARIABLE, "keymap=us.iso", 0, 0 },
{ NULL } },
};
DMenu MenuSysconsKeyrate = {
DMENU_NORMAL_TYPE,
"System Console Keyboard Repeat Rate",
"This menu allows you to set the speed at which keys repeat\n\
when held down.",
"Choose a keyboard repeat rate",
NULL,
{ { "Slow", "Slow keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=slow", 0, 0 },
{ "Normal", "\"normal\" keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=normal", 0, 0 },
{ "Fast", "fast keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=fast", 0, 0 },
{ "Default", "Use default keyboard repeat rate",
DMENU_SET_VARIABLE, "keyrate=NO", 0, 0 },
{ NULL } },
};
DMenu MenuSysconsSaver = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"System Console Screen Saver",
"By default, the console driver will not attempt to do anything\n\
special with your screen when it's idle. If you expect to leave your\n\
monitor switched on and idle for long periods of time then you should\n\
probably enable one of these screen savers to prevent phosphor burn-in.",
"Choose a nifty-looking screen saver",
NULL,
{ { "blank", "Simply blank the screen",
DMENU_SET_VARIABLE, "saver=star", 0, 0 },
{ "Green", "\"green\" power saver (if supported by monitor)",
{ "Green", "\"green\" power saving mode (if supported by monitor)",
DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
{ "Snake", "\"snake\" screen saver",
{ "Snake", "Draw a FreeBSD \"snake\" on your screen",
DMENU_SET_VARIABLE, "saver=snake", 0, 0 },
{ "Star", "\"twinkling stars\" screen saver",
{ "Star", "\"twinkling stars\" effect",
DMENU_SET_VARIABLE, "saver=star", 0, 0 },
{ "Timeout", "Set screen saver timeout interval",
{ "Timeout", "Set the screen saver timeout interval",
DMENU_CALL, configSaverTimeout, 0, 0 },
{ NULL } },
};

View File

@ -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: network.c,v 1.1 1995/05/27 10:38:58 jkh Exp $
* $Id: network.c,v 1.2 1995/05/28 03:05:00 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -46,8 +46,10 @@
/* These routines deal with getting things off of network media */
#include "sysinstall.h"
#include <sys/fcntl.h>
static Boolean networkInitialized;
static Boolean startPPP(Device *devp);
Boolean
mediaInitNetwork(Device *dev)
@ -60,10 +62,14 @@ mediaInitNetwork(Device *dev)
configResolv();
if (!strncmp("cuaa", dev->name, 4)) {
if (!tcpStartPPP(dev)) {
msgConfirm("Unable to start PPP! This installation method\ncannot be used.");
return FALSE;
if (!msgYesNo("You have selected a serial-line network interface.\nDo you want to use PPP with it?")) {
if (!startPPP(dev)) {
msgConfirm("Unable to start PPP! This installation method\ncannot be used.");
return FALSE;
}
}
else
msgConfirm("Warning: SLIP is rather poorly supported in this revision\nof the installation due to the lack of a dialing utility.\nIf you can use PPP for this instead then you're much better\noff doing so, otherwise SLIP works fairly well for *hardwired*\nlinks. Use the shell on the 4TH screen (ALT-F4) to run slattach\nand otherwise set the link up, then hit return here to continue.");
}
else {
char *cp, ifconfig[64];
@ -99,11 +105,8 @@ mediaShutdownNetwork(Device *dev)
if (!networkInitialized)
return;
if (!strncmp("cuaa", dev->name, 4)) {
msgConfirm("You may now go to the 3rd screen (ALT-F3) and shut down\nyour PPP connection. It shouldn't be needed any longer\n(unless you wish to create a shell by typing ESC and\nexperiment with it further, in which case go right ahead!)");
return;
}
else {
/* If we're running PPP or SLIP, it's too much trouble to shut down so forget it */
if (strncmp("cuaa", dev->name, 4)) {
int i;
char ifconfig[64];
@ -114,10 +117,73 @@ mediaShutdownNetwork(Device *dev)
i = vsystem("ifconfig %s down", dev->name);
if (i)
msgConfirm("Warning: Unable to down the %s interface properly", dev->name);
cp = getenv(VAR_GATEWAY);
if (cp)
vsystem("route delete default");
networkInitialized = FALSE;
}
cp = getenv(VAR_GATEWAY);
if (cp)
vsystem("route delete default");
networkInitialized = FALSE;
}
int
configRoutedFlags(char *str)
{
char *val;
val = msgGetInput("-q", "Specify the flags for routed; -q is the default, -s is\na good choice for gateway machines.");
if (val)
variable_set2("routedflags", val);
return 0;
}
/* Start PPP on the 3rd screen */
static Boolean
startPPP(Device *devp)
{
int fd;
FILE *fp;
char *val;
char myaddr[16], provider[16];
fd = open("/dev/ttyv2", O_RDWR);
if (fd == -1)
return FALSE;
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
Mkdir("/etc/ppp", NULL);
vsystem("touch /etc/ppp/ppp.linkup; chmod +x /etc/ppp/ppp.linkup");
vsystem("touch /etc/ppp/ppp.secret; chmod +x /etc/ppp/ppp.secret");
fp = fopen("/etc/ppp/ppp.conf", "w");
if (!fp) {
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
return FALSE;
}
fprintf(fp, "default:\n");
fprintf(fp, " set device %s\n", devp->devname);
val = msgGetInput("115200",
"Enter the baud rate for your modem - this can be higher than the actual\nmaximum data rate since most modems can talk at one speed to the\ncomputer and at another speed to the remote end.\n\nIf you're not sure what to put here, just select the default.");
if (!val)
val = "115200";
fprintf(fp, " set speed %s\n", val);
if (getenv(VAR_GATEWAY))
strcpy(provider, getenv(VAR_GATEWAY));
else
strcpy(provider, "0");
val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\ndon't know it and would prefer to negotiate it dynamically.");
if (!val)
val = "0";
if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
strcpy(myaddr, ((DevInfo *)devp->private)->ipaddr);
else
strcpy(myaddr, "0");
fprintf(fp, " set ifaddr %s %s\n", myaddr, val);
fclose(fp);
if (!fork()) {
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
execl("/stand/ppp", "/stand/ppp", (char *)NULL);
exit(1);
}
msgConfirm("The PPP command is now started on screen 3 (type ALT-F3 to\ninteract with it, ALT-F1 to switch back here). The only command\nyou'll probably want or need to use is the \"term\" command\nwhich starts a terminal emulator you can use to talk to your\nmodem and dial the service provider. Once you're connected,\ncome back to this screen and press return. DO NOT PRESS RETURN\nHERE UNTIL THE CONNECTION IS FULLY ESTABLISHED!");
return TRUE;
}

View File

@ -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.37 1995/05/27 23:39:32 phk Exp $
* $Id: sysinstall.h,v 1.38 1995/05/28 03:05:03 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -197,6 +197,17 @@ typedef struct _part_info {
typedef int (*commandFunc)(char *key, void *data);
#define HOSTNAME_FIELD_LEN 256
#define IPADDR_FIELD_LEN 16
#define EXTRAS_FIELD_LEN 256
/* This is the structure that Network devices carry around in their private, erm, structures */
typedef struct _devPriv {
char ipaddr[IPADDR_FIELD_LEN];
char netmask[IPADDR_FIELD_LEN];
char extras[EXTRAS_FIELD_LEN];
} DevInfo;
/*** Externs ***/
extern int DebugFD; /* Where diagnostic output goes */
@ -229,7 +240,12 @@ extern DMenu MenuMediaFloppy; /* Floppy media menu */
extern DMenu MenuMediaFTP; /* FTP media menu */
extern DMenu MenuMediaTape; /* Tape media menu */
extern DMenu MenuNetworkDevice; /* Network device menu */
extern DMenu MenuNTP; /* NTP time server menu */
extern DMenu MenuSyscons; /* System console configuration menu */
extern DMenu MenuSysconsKeymap; /* System console keymap configuration menu */
extern DMenu MenuSysconsKeyrate; /* System console keyrate configuration menu */
extern DMenu MenuSysconsSaver; /* System console saver configuration menu */
extern DMenu MenuNetworking; /* Network configuration menu */
extern DMenu MenuInstall; /* Installation menu */
extern DMenu MenuInstallType; /* Installation type menu */
extern DMenu MenuDistributions; /* Distribution menu */
@ -402,6 +418,7 @@ extern char *msgGetInput(char *buf, char *fmt, ...);
/* network.c */
extern Boolean mediaInitNetwork(Device *dev);
extern void mediaShutdownNetwork(Device *dev);
extern int configRoutedFlags(char *str);
/* system.c */
extern void systemInitialize(int argc, char **argv);
@ -426,7 +443,6 @@ extern void mediaShutdownTape(Device *dev);
/* tcpip.c */
extern int tcpOpenDialog(Device *dev);
extern int tcpDeviceSelect(char *str);
extern Boolean tcpStartPPP(Device *dev);
/* termcap.c */
extern int set_termcap(void);

View File

@ -1,5 +1,5 @@
/*
* $Id: tcpip.c,v 1.23 1995/05/27 23:52:55 jkh Exp $
* $Id: tcpip.c,v 1.24 1995/05/28 03:05:06 jkh Exp $
*
* Copyright (c) 1995
* Gary J Palmer. All rights reserved.
@ -55,10 +55,6 @@
#include "rc.h"
#include "sysinstall.h"
#define HOSTNAME_FIELD_LEN 256
#define IPADDR_FIELD_LEN 16
#define EXTRAS_FIELD_LEN 256
/* These are nasty, but they make the layout structure a lot easier ... */
static char hostname[HOSTNAME_FIELD_LEN], domainname[HOSTNAME_FIELD_LEN],
@ -72,13 +68,6 @@ static char ipaddr[IPADDR_FIELD_LEN], netmask[IPADDR_FIELD_LEN], extras[EXTRAS_
#define TCP_DIALOG_WIDTH COLS - 16
#define TCP_DIALOG_HEIGHT LINES - 2
/* This is the structure that Network devices carry around in their private, erm, structures */
typedef struct _devPriv {
char ipaddr[IPADDR_FIELD_LEN];
char netmask[IPADDR_FIELD_LEN];
char extras[EXTRAS_FIELD_LEN];
} DevInfo;
/* The screen layout structure */
typedef struct _layout {
int y; /* x & Y co-ordinates */
@ -461,56 +450,3 @@ tcpDeviceSelect(char *str)
free(menu);
return 0;
}
/* Start PPP on the 3rd screen */
Boolean
tcpStartPPP(Device *devp)
{
int fd;
FILE *fp;
char *val;
char myaddr[16], provider[16];
fd = open("/dev/ttyv2", O_RDWR);
if (fd == -1)
return FALSE;
Mkdir("/var/log", NULL);
Mkdir("/var/spool/lock", NULL);
Mkdir("/etc/ppp", NULL);
vsystem("touch /etc/ppp/ppp.linkup; chmod +x /etc/ppp/ppp.linkup");
vsystem("touch /etc/ppp/ppp.secret; chmod +x /etc/ppp/ppp.secret");
fp = fopen("/etc/ppp/ppp.conf", "w");
if (!fp) {
msgConfirm("Couldn't open /etc/ppp/ppp.conf file! This isn't going to work");
return FALSE;
}
fprintf(fp, "default:\n");
fprintf(fp, " set device %s\n", devp->devname);
val = msgGetInput("115200",
"Enter baud rate for your modem - this can be higher than the actual\nmaximum data rate since most modems can talk at one speed to the\ncomputer and at another speed to the remote end.\n\nIf you're not sure what to put here, just select the default.");
if (!val)
val = "115200";
fprintf(fp, " set speed %s\n", val);
if (getenv(VAR_GATEWAY))
strcpy(provider, getenv(VAR_GATEWAY));
else
strcpy(provider, "0");
val = msgGetInput(provider, "Enter the IP address of your service provider or 0 if you\ndon't know it and would prefer to negotiate it dynamically.");
if (!val)
val = "0";
if (devp->private && ((DevInfo *)devp->private)->ipaddr[0])
strcpy(myaddr, ((DevInfo *)devp->private)->ipaddr);
else
strcpy(myaddr, "0");
fprintf(fp, " set ifaddr %s %s\n", myaddr, val);
fclose(fp);
if (!fork()) {
dup2(fd, 0);
dup2(fd, 1);
dup2(fd, 2);
execl("/stand/ppp", "/stand/ppp", (char *)NULL);
exit(1);
}
msgConfirm("The PPP command is now started on screen 3 (type ALT-F3 to\ninteract with it, ALT-F1 to switch back here). The only command\nyou'll probably want or need to use is the \"term\" command\nwhich starts a terminal emulator you can use to talk to your\nmodem and dial the service provider. Once you're connected,\ncome back to this screen and hit return. DO NOT PRESS RETURN\nHERE UNTIL THE CONNECTION IS FULLY ESTABLISHED!");
return TRUE;
}