summaryrefslogtreecommitdiffstats
path: root/release
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1999-09-02 00:51:16 +0000
committerjkh <jkh@FreeBSD.org>1999-09-02 00:51:16 +0000
commit2b983202e6de74a0ad0fc2765f080543e3895b9f (patch)
tree056879bb90e16442c3b7d9bc3de1330e328d93b9 /release
parent3e73f6e0b13a943ed99fc8f5f463a7a251c2e797 (diff)
downloadFreeBSD-src-2b983202e6de74a0ad0fc2765f080543e3895b9f.zip
FreeBSD-src-2b983202e6de74a0ad0fc2765f080543e3895b9f.tar.gz
Oh crud, did I ever screw the pooch! Rather than sync this with -stable,
I backed-out the changes in -current and didn't touch stable at all (I thought I had my patch order reversed, not what actually happened). AIEEE! I can't even blame the crack for this one since I broke my crack pipe a few weeks ago. I think sleep deprivation gets the blame for this one. Medal for noticing this one goes to: Jim Bloom <bloom@acm.org>
Diffstat (limited to 'release')
-rw-r--r--release/sysinstall/Makefile3
-rw-r--r--release/sysinstall/config.c2
-rw-r--r--release/sysinstall/devices.c15
-rw-r--r--release/sysinstall/disks.c16
-rw-r--r--release/sysinstall/dist.c14
-rw-r--r--release/sysinstall/dist.h9
-rw-r--r--release/sysinstall/index.c4
-rw-r--r--release/sysinstall/install.c8
-rw-r--r--release/sysinstall/kget.c11
-rw-r--r--release/sysinstall/media.c9
-rw-r--r--release/sysinstall/menus.c39
-rw-r--r--release/sysinstall/network.c11
-rw-r--r--release/sysinstall/options.c14
-rw-r--r--release/sysinstall/package.c7
-rw-r--r--release/sysinstall/sysinstall.8123
-rw-r--r--release/sysinstall/sysinstall.h6
-rw-r--r--release/sysinstall/system.c10
-rw-r--r--release/sysinstall/tcpip.c138
-rw-r--r--release/sysinstall/variable.c5
19 files changed, 334 insertions, 110 deletions
diff --git a/release/sysinstall/Makefile b/release/sysinstall/Makefile
index 6e53c1f..609ef7b 100644
--- a/release/sysinstall/Makefile
+++ b/release/sysinstall/Makefile
@@ -9,7 +9,7 @@ CLEANFILES+= keymap.tmp keymap.h pccard_conf.h
.PATH: ${.CURDIR}/../disklabel ${.CURDIR}/../../usr.bin/cksum
-SRCS= anonFTP.c cdrom.c command.c config.c devices.c kget.c \
+SRCS= anonFTP.c cdrom.c command.c config.c devices.c dhcp.c kget.c \
disks.c dispatch.c dist.c dmenu.c doc.c dos.c floppy.c \
ftp.c globals.c index.c install.c installUpgrade.c keymap.c \
label.c lndir.c main.c makedevs.c media.c menus.c misc.c mouse.c \
@@ -19,7 +19,6 @@ SRCS= anonFTP.c cdrom.c command.c config.c devices.c kget.c \
CFLAGS+= -Wall -I${.CURDIR}/../../gnu/lib/libdialog -I${.OBJDIR}
CFLAGS+= -I${.CURDIR}/../../sys
-CFLAGS+= -DUC_PRIVATE -DKERN_NO_SYMBOLS
PCCARD?= NO
diff --git a/release/sysinstall/config.c b/release/sysinstall/config.c
index f9b6200..9eaa21d 100644
--- a/release/sysinstall/config.c
+++ b/release/sysinstall/config.c
@@ -453,7 +453,7 @@ configLinux(dialogMenuItem *self)
{
variable_set2(VAR_LINUX_ENABLE, "YES", 1);
msgNotify("Installing Linux compatibility library...");
- return package_add("linux_lib");
+ return package_add("linux_base");
}
static void
diff --git a/release/sysinstall/devices.c b/release/sysinstall/devices.c
index 86072e1..f0df3a2 100644
--- a/release/sysinstall/devices.c
+++ b/release/sysinstall/devices.c
@@ -99,15 +99,16 @@ static struct _devname {
{ DEVICE_TYPE_NETWORK, "ix", "Intel Etherexpress ethernet card" },
{ DEVICE_TYPE_NETWORK, "le", "DEC EtherWorks 2 or 3 ethernet card" },
{ DEVICE_TYPE_NETWORK, "lnc", "Lance/PCnet (Isolan/Novell NE2100/NE32-VL) ethernet" },
- { DEVICE_TYPE_NETWORK, "mx", "Macronix 98713/98715/98725 PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "pn", "Lite-On 82168/82169 PNIC PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "rl", "RealTek 8129/8139 PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "sf", "Adaptec AIC-6915 PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "sk", "SysKonnect PCI gigabit ethernet card" },
+ { DEVICE_TYPE_NETWORK, "mx", "Macronix 98713/98715/98725 PCI ethernet card" },
+ { DEVICE_TYPE_NETWORK, "pn", "Lite-On 82168/82169 PNIC PCI ethernet card" },
+ { DEVICE_TYPE_NETWORK, "rl", "RealTek 8129/8139 PCI ethernet card" },
+ { DEVICE_TYPE_NETWORK, "sf", "Adaptec AIC-6915 PCI ethernet card" },
+ { DEVICE_TYPE_NETWORK, "ste", "Sundance ST201 PCI ethernet card" },
+ { DEVICE_TYPE_NETWORK, "sk", "SysKonnect PCI gigabit ethernet card" },
{ DEVICE_TYPE_NETWORK, "tx", "SMC 9432TX ethernet card" },
- { DEVICE_TYPE_NETWORK, "ti", "Alteon Networks PCI gigabit ethernet card" },
+ { DEVICE_TYPE_NETWORK, "ti", "Alteon Networks PCI gigabit ethernet card" },
{ DEVICE_TYPE_NETWORK, "tl", "Texas Instruments ThunderLAN PCI ethernet card" },
- { DEVICE_TYPE_NETWORK, "vr", "VIA VT3043/VT86C100A Rhine PCI ethernet card" },
+ { DEVICE_TYPE_NETWORK, "vr", "VIA VT3043/VT86C100A Rhine PCI ethernet card" },
{ DEVICE_TYPE_NETWORK, "vx", "3COM 3c590 / 3c595 ethernet card" },
{ DEVICE_TYPE_NETWORK, "wb", "Winbond W89C840F PCI ethernet card" },
{ DEVICE_TYPE_NETWORK, "xl", "3COM 3c90x / 3c90xB PCI ethernet card" },
diff --git a/release/sysinstall/disks.c b/release/sysinstall/disks.c
index f820976..fe4ee82 100644
--- a/release/sysinstall/disks.c
+++ b/release/sysinstall/disks.c
@@ -455,20 +455,16 @@ diskPartition(Device *dev)
* disk (i.e., the disklabel starts at sector 0), even in cases where the user has requested
* booteasy or a "standard" MBR -- both would be fatal in this case.
*/
-#if 0
- if ((d->chunks->part->flags & CHUNK_FORCE_ALL) != CHUNK_FORCE_ALL
- && (mbrContents = getBootMgr(d->name)) != NULL)
- Set_Boot_Mgr(d, mbrContents);
-#else
/*
* Don't offer to update the MBR on this disk if the first "real" chunk looks like
* a FreeBSD "all disk" partition, or the disk is entirely FreeBSD.
*/
- if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)) &&
- (mbrContents = getBootMgr(d->name)) != NULL)
- Set_Boot_Mgr(d, mbrContents);
-#endif
-
+ if (((d->chunks->part->type != freebsd) || (d->chunks->part->offset > 1)))
+ mbrContents = getBootMgr(d->name);
+ else
+ mbrContents = NULL;
+ Set_Boot_Mgr(d, mbrContents);
+
if (DITEM_STATUS(diskPartitionWrite(NULL)) != DITEM_SUCCESS)
msgConfirm("Disk partition write returned an error status!");
else
diff --git a/release/sysinstall/dist.c b/release/sysinstall/dist.c
index a26d107..b39b209 100644
--- a/release/sysinstall/dist.c
+++ b/release/sysinstall/dist.c
@@ -73,6 +73,7 @@ static Distribution DistTable[] = {
{ "info", "/", &Dists, DIST_INFO, NULL },
{ "src", "/", &Dists, DIST_SRC, SrcDistTable },
{ "des", "/", &Dists, DIST_DES, DESDistTable },
+#ifdef __i386__
{ "compat1x", "/", &Dists, DIST_COMPAT1X, NULL },
{ "compat20", "/", &Dists, DIST_COMPAT20, NULL },
{ "compat21", "/", &Dists, DIST_COMPAT21, NULL },
@@ -80,7 +81,9 @@ static Distribution DistTable[] = {
#if __FreeBSD__ > 3
{ "compat3x", "/", &Dists, DIST_COMPAT3X, NULL },
#endif
+#endif
{ "ports", "/usr", &Dists, DIST_PORTS, NULL },
+{ "local", "/", &Dists, DIST_LOCAL, NULL },
{ "XF86334", "/usr", &Dists, DIST_XF86, XF86DistTable },
{ NULL },
};
@@ -138,6 +141,7 @@ static Distribution XF86DistTable[] = {
/* The XFree86 server distribution */
static Distribution XF86ServerDistTable[] = {
+#ifdef __i386__
{ "PC98-Servers/X9480", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_9480, NULL },
{ "PC98-Servers/X9EGC", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_9EGC, NULL },
{ "PC98-Servers/X9GA9", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_9GA9, NULL },
@@ -152,6 +156,7 @@ static Distribution XF86ServerDistTable[] = {
{ "PC98-Servers/X9WEP", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_9WEP, NULL },
{ "PC98-Servers/X9WS", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_9WS, NULL },
{ "PC98-Servers/X9WSN", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_9WSN, NULL },
+#endif
{ "Servers/X3DL", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_3DL, NULL },
{ "Servers/X8514", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_8514, NULL },
{ "Servers/XAGX", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_AGX, NULL },
@@ -166,6 +171,9 @@ static Distribution XF86ServerDistTable[] = {
{ "Servers/XSVGA", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_SVGA, NULL },
{ "Servers/XVG16", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_VGA16, NULL },
{ "Servers/XW32", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_W32, NULL },
+#ifdef __alpha__
+{ "Servers/XTGA", "/usr/X11R6", &XF86ServerDists, DIST_XF86_SERVER_TGA, NULL },
+#endif
{ NULL },
};
@@ -200,8 +208,12 @@ distVerifyFlags(void)
XF86Dists |= DIST_XF86_SERVER;
if (XF86FontDists)
XF86Dists |= DIST_XF86_FONTS;
- if (XF86Dists || XF86ServerDists || XF86FontDists)
+ if (XF86Dists || XF86ServerDists || XF86FontDists) {
Dists |= DIST_XF86;
+#ifdef __i386__
+ Dists |= DIST_COMPAT22; /* For certain old X applications */
+#endif
+ }
if (isDebug())
msgDebug("Dist Masks: Dists: %0x, DES: %0x, Srcs: %0x\nXServer: %0x, XFonts: %0x, XDists: %0x\n",
Dists, DESDists, SrcDists, XF86ServerDists, XF86FontDists, XF86Dists);
diff --git a/release/sysinstall/dist.h b/release/sysinstall/dist.h
index dea8f44..74f248f 100644
--- a/release/sysinstall/dist.h
+++ b/release/sysinstall/dist.h
@@ -12,16 +12,19 @@
#define DIST_SRC 0x00020
#define DIST_DOC 0x00040
#define DIST_INFO 0x00080
+#ifdef __i386__ /* only applicable on x86 */
#define DIST_COMPAT1X 0x00100
#define DIST_COMPAT20 0x00200
#define DIST_COMPAT21 0x00400
#define DIST_COMPAT22 0x00800
#define DIST_COMPAT3X 0x01000
+#endif
#define DIST_XF86 0x02000
#define DIST_DES 0x04000
#define DIST_CATPAGES 0x08000
#define DIST_PORTS 0x10000
-#define DIST_ALL 0x1FFFF
+#define DIST_LOCAL 0x20000
+#define DIST_ALL 0x3FFFF
/* Canned distribution sets */
#define _DIST_DEVELOPER \
@@ -73,6 +76,7 @@
#define DIST_XF86_CSRC 0x2000
#define DIST_XF86_MISC_ALL 0x3FFF
#define DIST_XF86_SERVER 0x8000
+#ifdef __i386__
#define DIST_XF86_SERVER_9MGA 0x0000001
#define DIST_XF86_SERVER_9480 0x0000002
#define DIST_XF86_SERVER_9EGC 0x0000004
@@ -87,6 +91,9 @@
#define DIST_XF86_SERVER_9WEP 0x0000800
#define DIST_XF86_SERVER_9WS 0x0001000
#define DIST_XF86_SERVER_9WSN 0x0002000
+#elif __alpha__
+#define DIST_XF86_SERVER_TGA 0x0000001
+#endif
#define DIST_XF86_SERVER_8514 0x0004000
#define DIST_XF86_SERVER_AGX 0x0008000
#define DIST_XF86_SERVER_I128 0x0010000
diff --git a/release/sysinstall/index.c b/release/sysinstall/index.c
index 23e49da..947385a 100644
--- a/release/sysinstall/index.c
+++ b/release/sysinstall/index.c
@@ -102,7 +102,9 @@ static char *descrs[] = {
"german", "Ported software for Germanic countries.",
"graphics", "Graphics libraries and utilities.",
"gnome", "Components of the Gnome Desktop environment.",
+ "irc", "Internet Relay Chat utilities.",
"japanese", "Ported software for the Japanese market.",
+ "java", "Java language support.",
"kde", "Software for the K Desktop Environment.",
"korean", "Ported software for the Korean market.",
"lang", "Computer languages.",
@@ -146,6 +148,7 @@ static char *descrs[] = {
"x11-clocks", "X Window System based clocks.",
"x11-fm", "X Window System based file managers.",
"x11-fonts", "X Window System fonts and font utilities.",
+ "x11-servers", "X Window System servers.",
"x11-toolkits", "X Window System based development toolkits.",
"x11-wm", "X Window System window managers.",
NULL, NULL,
@@ -417,7 +420,6 @@ index_search(PkgNodePtr top, char *str, PkgNodePtr *tp)
*tp = top;
return p;
}
-
}
else if (p->kids) {
/* The usual recursion-out-of-laziness ploy */
diff --git a/release/sysinstall/install.c b/release/sysinstall/install.c
index c4873ca..841dd1a 100644
--- a/release/sysinstall/install.c
+++ b/release/sysinstall/install.c
@@ -533,7 +533,7 @@ nodisks:
dialog_clear_norefresh();
tmp = tcpDeviceSelect();
dialog_clear_norefresh();
- if (tmp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
+ if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
if (!tmp->init(tmp))
msgConfirm("Initialization of %s device failed.", tmp->name);
}
@@ -754,6 +754,8 @@ installFixupBin(dialogMenuItem *self)
if ((fp = fopen("/boot/loader.conf", "a")) != NULL) {
fprintf(fp, "# -- sysinstall generated deltas -- #\n");
fprintf(fp, "userconfig_script_load=\"YES\"\n");
+ if (!OnVTY)
+ fprintf(fp, "console=\"serial\"\n");
fclose(fp);
}
}
@@ -1031,6 +1033,7 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_TAPE_BLOCKSIZE, DEFAULT_TAPE_BLOCKSIZE, 0);
variable_set2(VAR_INSTALL_ROOT, "/", 0);
variable_set2(VAR_INSTALL_CFG, "install.cfg", 0);
+ variable_set2(VAR_TRY_DHCP, "NO", 0); /* For now */
cp = getenv("EDITOR");
if (!cp)
cp = "/usr/bin/ee";
@@ -1039,13 +1042,14 @@ installVarDefaults(dialogMenuItem *self)
variable_set2(VAR_BROWSER_PACKAGE, "lynx", 0);
variable_set2(VAR_BROWSER_BINARY, "/usr/local/bin/lynx", 0);
variable_set2(VAR_FTP_STATE, "passive", 0);
- variable_set2(VAR_NFS_SECURE, "YES", 0);
+ variable_set2(VAR_NFS_SECURE, "NO", -1);
variable_set2(VAR_PKG_TMPDIR, "/usr/tmp", 0);
variable_set2(VAR_MEDIA_TIMEOUT, itoa(MEDIA_TIMEOUT), 0);
if (getpid() != 1)
variable_set2(SYSTEM_STATE, "update", 0);
else
variable_set2(SYSTEM_STATE, "init", 0);
+ variable_set2(VAR_NEWFS_ARGS, "-b 8192 -f 1024", 0);
return DITEM_SUCCESS;
}
diff --git a/release/sysinstall/kget.c b/release/sysinstall/kget.c
index f6ddd572..7748b2c 100644
--- a/release/sysinstall/kget.c
+++ b/release/sysinstall/kget.c
@@ -26,6 +26,15 @@
* $FreeBSD$
*/
+#ifdef __alpha__
+int
+kget(char *out)
+{
+ return -1;
+}
+
+#else
+
#include "sysinstall.h"
#include <sys/sysctl.h>
#include <i386/isa/isa_device.h>
@@ -166,3 +175,5 @@ bail:
fclose(fout);
return 0;
}
+
+#endif /* !alpha */
diff --git a/release/sysinstall/media.c b/release/sysinstall/media.c
index 59274e9..380b704 100644
--- a/release/sysinstall/media.c
+++ b/release/sysinstall/media.c
@@ -409,7 +409,8 @@ mediaSetFTP(dialogMenuItem *self)
return DITEM_FAILURE | what;
}
}
- msgDebug("Found DNS entry for %s successfully..\n", hostname);
+ if (isDebug())
+ msgDebug("Found DNS entry for %s successfully..\n", hostname);
}
variable_set2(VAR_FTP_HOST, hostname, 0);
variable_set2(VAR_FTP_DIR, dir ? dir : "/", 0);
@@ -510,8 +511,10 @@ mediaSetNFS(dialogMenuItem *self)
variable_unset(VAR_NFS_PATH);
return DITEM_FAILURE;
}
- else
- msgDebug("Found DNS entry for %s successfully..", hostname);
+ else {
+ if (isDebug())
+ msgDebug("Found DNS entry for %s successfully..", hostname);
+ }
}
variable_set2(VAR_NFS_HOST, hostname, 0);
nfsDevice.type = DEVICE_TYPE_NFS;
diff --git a/release/sysinstall/menus.c b/release/sysinstall/menus.c
index bfe6cb9..c626af8 100644
--- a/release/sysinstall/menus.c
+++ b/release/sysinstall/menus.c
@@ -254,7 +254,9 @@ DMenu MenuIndex = {
{ "Doc, HTML", "The HTML documentation menu.", NULL, docBrowser },
{ "Dump Vars", "(debugging) dump out internal variables.", NULL, dump_variables },
{ "Emergency shell", "Start an Emergency Holographic shell.", NULL, installFixitHoloShell },
+#ifdef __i386__
{ "Fdisk", "The disk Partition Editor", NULL, diskPartitionEditor },
+#endif
{ "Fixit", "Repair mode with CDROM or fixit floppy.", NULL, dmenuSubmenu, NULL, &MenuFixit },
{ "FTP sites", "The FTP mirror site listing.", NULL, dmenuSubmenu, NULL, &MenuMediaFTP },
{ "Gateway", "Set flag to route packets between interfaces.", dmenuVarCheck, dmenuToggleVariable, NULL, "gateway=YES" },
@@ -295,7 +297,9 @@ DMenu MenuIndex = {
{ "User Management", "Add user and group information.", NULL, dmenuSubmenu, NULL, &MenuUsermgmt },
{ "XFree86, Fonts", "XFree86 Font selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectFonts },
{ "XFree86, Server", "XFree86 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectServer },
+#ifdef __i386__
{ "XFree86, PC98 Server", "XFree86 PC98 Server selection menu.", NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server },
+#endif
{ NULL } },
};
@@ -428,6 +432,10 @@ DMenu MenuMouse = {
DMenu MenuXF86Config = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
"Please select the XFree86 configuration tool you want to use.",
+#ifdef __alpha__
+ "Due to problems with the VGA16 server right now, only the\n"
+ "text-mode configuration tool (xf86config) is currently supported.",
+#else
"The first tool, XF86Setup, is fully graphical and requires the\n"
"VGA16 server in order to work (should have been selected by\n"
"default, but if you de-selected it then you won't be able to\n"
@@ -435,14 +443,20 @@ DMenu MenuXF86Config = {
"a more simplistic shell-script based tool and less friendly to\n"
"new users, but it may work in situations where the fancier one\n"
"does not.",
+#endif
NULL,
NULL,
+#ifdef __alpha__
+ { { "xf86config", "Shell-script based XFree86 configuration tool.",
+ NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" },
+#else
{ { "XF86Setup", "Fully graphical XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF86Setup" },
{ "xf86config", "Shell-script based XFree86 configuration tool.",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=xf86config" },
{ "XF98Setup", "Fully graphical XFree86 configuration tool (PC98).",
NULL, dmenuSetVariable, NULL, VAR_XF86_CONFIG "=XF98Setup" },
+#endif
{ "XDesktop", "X already set up, just do desktop configuration.",
NULL, dmenuSubmenu, NULL, &MenuXDesktops },
{ NULL } },
@@ -636,6 +650,8 @@ DMenu MenuMediaFTP = {
VAR_FTP_PATH _AP("=ftp://ftp3.ru.freebsd.org") },
{ "Russia #4", "ftp4.ru.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH _AP("=ftp://ftp4.ru.freebsd.org") },
+ { "Slovak Republic", "ftp.sk.freebsd.org", NULL, dmenuSetVariable, NULL,
+ VAR_FTP_PATH _AP("=ftp://ftp.sk.freebsd.org") },
{ "South Africa", "ftp.za.freebsd.org", NULL, dmenuSetVariable, NULL,
VAR_FTP_PATH _AP("=ftp://ftp.za.freebsd.org") },
{ "South Africa #2", "ftp2.za.freebsd.org", NULL, dmenuSetVariable, NULL,
@@ -788,6 +804,7 @@ DMenu MenuSubDistributions = {
NULL,
{ { "bin", "Binary base distribution (required)",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_BIN },
+#ifdef __i386__
{ "compat1x", "FreeBSD 1.x binary compatibility",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT1X },
{ "compat20", "FreeBSD 2.0 binary compatibility",
@@ -800,6 +817,7 @@ DMenu MenuSubDistributions = {
{ "compat3x", "FreeBSD 3.x binary compatibility",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_COMPAT3X },
#endif
+#endif
{ "DES", "DES encryption code - NOT FOR EXPORT!",
DESFlagCheck, distSetDES },
{ "dict", "Spelling checker dictionary files",
@@ -820,6 +838,8 @@ DMenu MenuSubDistributions = {
srcFlagCheck, distSetSrc },
{ "ports", "The FreeBSD Ports collection",
dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_PORTS },
+ { "local", "Local additions collection",
+ dmenuFlagCheck, dmenuSetFlag, NULL, &Dists, '[', 'X', ']', DIST_LOCAL},
{ "XFree86", "The XFree86 3.3.4 distribution",
x11FlagCheck, distSetXF86 },
{ "All", "All sources, binaries and X Window System binaries",
@@ -934,8 +954,10 @@ DMenu MenuXF86SelectCore = {
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_HTML },
{ "lib", "Data files needed at runtime",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LIB },
+#ifdef __i386__
{ "lk98", "Server link kit for PC98 machines",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT98 },
+#endif
{ "lkit", "Server link kit for all other machines",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_LKIT },
{ "man", "Manual pages",
@@ -944,8 +966,10 @@ DMenu MenuXF86SelectCore = {
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_PROG },
{ "set", "XFree86 Setup Utility",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SET },
+#ifdef __i386__
{ "9set", "XFree86 Setup Utility for PC98 machines",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_9SET },
+#endif
{ "sources", "XFree86 3.3.4 standard sources",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86Dists, '[', 'X', ']', DIST_XF86_SRC },
{ "csources", "XFree86 3.3.4 contrib sources",
@@ -1026,8 +1050,13 @@ DMenu MenuXF86SelectServer = {
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_S3V },
{ "W32", "8-bit ET4000/W32, /W32i and /W32p cards",
dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_W32 },
+#ifdef __i386__
{ "PC98", "Select an X server for a NEC PC98 [Submenu]",
NULL, dmenuSubmenu, NULL, &MenuXF86SelectPC98Server, '>', ' ', '>', 0 },
+#elif __alpha__
+ { "TGA", "TGA cards (alpha architecture only)",
+ dmenuFlagCheck, dmenuSetFlag, NULL, &XF86ServerDists, '[', 'X', ']', DIST_XF86_SERVER_TGA },
+#endif
{ "All", "Select all of the above",
NULL, setX11Servers, NULL, NULL, ' ', ' ', ' ' },
{ "Clear", "Reset all of the above",
@@ -1037,6 +1066,7 @@ DMenu MenuXF86SelectServer = {
{ NULL } },
};
+#ifdef __i386__
DMenu MenuXF86SelectPC98Server = {
DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS,
"PC98 X Server selection.",
@@ -1078,6 +1108,7 @@ Mono servers are particularly well-suited to most LCD displays).",
checkTrue, dmenuExit, NULL, NULL, '<', '<', '<' },
{ NULL } }
};
+#endif
DMenu MenuDiskDevices = {
DMENU_CHECKLIST_TYPE | DMENU_SELECTION_RETURNS,
@@ -1177,8 +1208,10 @@ DMenu MenuConfigure = {
NULL, dmenuSystemCommand, NULL, "passwd root" },
{ "L Label", "The disk Label editor",
NULL, diskLabelEditor },
+#ifdef __i386__
{ "F Fdisk", "The disk Slice (PC-style partition) Editor",
NULL, diskPartitionEditor },
+#endif
{ "1 User Management", "Add user and group information",
NULL, dmenuSubmenu, NULL, &MenuUsermgmt },
{ "2 Console", "Customize system console behavior",
@@ -1350,12 +1383,6 @@ DMenu MenuNTP = {
{ "U.S. Midwest", "ncar.ucar.edu (WWVB clock)",
dmenuVarsCheck, dmenuSetVariables, NULL,
"ntpdate_enable=YES,ntpdate_flags=ncar.ucar.edu" },
- { "U.S. Pacific", "chantry.hawaii.net (WWV/H clock)",
- dmenuVarsCheck, dmenuSetVariables, NULL,
- "ntpdate_enable=YES,ntpdate_flags=chantry.hawaii.net" },
- { "U.S. Southwest", "shorty.chpc.utexas.edu (WWV clock)",
- dmenuVarsCheck, dmenuSetVariables, NULL,
- "ntpdate_enable=YES,ntpdate_flags=shorty.chpc.utexas.edu" },
{ NULL } },
};
diff --git a/release/sysinstall/network.c b/release/sysinstall/network.c
index d8835d8..9d70278 100644
--- a/release/sysinstall/network.c
+++ b/release/sysinstall/network.c
@@ -123,6 +123,8 @@ mediaInitNetwork(Device *dev)
"in the Networking configuration menu before proceeding.", dev->name);
return FALSE;
}
+ else if (!strcmp(cp, "DHCP"))
+ goto bail;
msgNotify("ifconfig %s %s", dev->name, cp);
i = vsystem("ifconfig %s %s", dev->name, cp);
if (i) {
@@ -140,6 +142,7 @@ mediaInitNetwork(Device *dev)
msgNotify("Adding default route to %s.", rp);
vsystem("route -n add default %s", rp);
}
+bail:
if (isDebug())
msgDebug("Network initialized successfully.\n");
networkInitialized = TRUE;
@@ -325,11 +328,11 @@ startPPP(Device *devp)
}
else {
dialog_clear_norefresh();
- msgConfirm("NOTICE: The PPP command is now started on VTY2 (type ALT-F3 to\n"
+ msgConfirm("NOTICE: The PPP command is now started on VTY3 (type ALT-F3 to\n"
"interact with it, ALT-F1 to switch back here). If you are using\n"
- "a PAP or CHAP login simply enter \"dial\" otherwise you'll need\n"
- "need to use is the \"term\" command which starts a terminal\n"
- "emulator you can use to talk to your modem and dial the service\n"
+ "a PAP or CHAP login simply enter \"dial\", otherwise you'll need\n"
+ "to use the \"term\" command which starts a terminal emulator\n"
+ "which you can use to talk to your modem and dial the service\n"
"provider. Once you're connected, come back to this screen and\n"
"press return.\n\n"
"DO NOT PRESS [ENTER] HERE UNTIL THE CONNECTION IS FULLY\n"
diff --git a/release/sysinstall/options.c b/release/sysinstall/options.c
index df20988..469841d 100644
--- a/release/sysinstall/options.c
+++ b/release/sysinstall/options.c
@@ -114,6 +114,8 @@ static Option Options[] = {
OPT_IS_VAR, NULL, VAR_NO_WARN, varCheck },
{ "Yes to All", "Assume \"Yes\" answers to all non-critical dialogs",
OPT_IS_VAR, NULL, VAR_NO_CONFIRM, varCheck },
+{ "DHCP", "Attempt automatic DHCP configuration of interfaces",
+ OPT_IS_VAR, NULL, VAR_TRY_DHCP, varCheck },
{ "FTP username", "Username and password to use instead of anonymous",
OPT_IS_FUNC, mediaSetFTPUserPass, VAR_FTP_USER, varCheck },
{ "Editor", "Which text editor to use during installation",
@@ -190,13 +192,17 @@ fire(Option opt)
}
else if (opt.type == OPT_IS_VAR) {
if (opt.data) {
- (void)variable_get_value(opt.aux, opt.data, 1);
+ (void)variable_get_value(opt.aux, opt.data, -1);
status = 1;
}
- else if (variable_get(opt.aux))
- variable_unset(opt.aux);
+ else if (variable_get(opt.aux)) {
+ if (!variable_cmp(opt.aux, "YES"))
+ variable_set2(opt.aux, "NO", -1);
+ else
+ variable_set2(opt.aux, "YES", -1);
+ }
else
- variable_set2(opt.aux, "YES", 1);
+ variable_set2(opt.aux, "YES", 0);
}
if (opt.check)
opt.check(opt);
diff --git a/release/sysinstall/package.c b/release/sysinstall/package.c
index caefc82..185956f 100644
--- a/release/sysinstall/package.c
+++ b/release/sysinstall/package.c
@@ -41,7 +41,7 @@
#include <sys/mount.h>
#include <sys/stat.h>
-static Boolean sigpipe_caught = FALSE;
+static Boolean sigpipe_caught;
static void
catch_pipe(int sig)
@@ -60,9 +60,14 @@ package_add(char *name)
if (!mediaVerify())
return DITEM_FAILURE;
+
+ if (!mediaDevice->init(mediaDevice))
+ return DITEM_FAILURE;
+
i = index_initialize("packages/INDEX");
if (DITEM_STATUS(i) != DITEM_SUCCESS)
return i;
+
tmp3 = strpbrk(name, "-") ? NULL : &tmp2;
tmp = index_search(&Top, name, tmp3);
if (tmp)
diff --git a/release/sysinstall/sysinstall.8 b/release/sysinstall/sysinstall.8
index 5186312..19ed764 100644
--- a/release/sysinstall/sysinstall.8
+++ b/release/sysinstall/sysinstall.8
@@ -1,5 +1,5 @@
.\" Copyright (c) 1997
-.\" Jordan Hubbard <jkh@freebsd.org>. All rights reserved.
+.\" Jordan Hubbard <jkh@FreeBSD.org>. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -37,11 +37,17 @@
.Op Ar ...
.Sh DESCRIPTION
.Nm
-is a utility for installing and configuring FreeBSD systems.
-It is the first utility invoked by the FreeBSD installation boot
+is a utility for installing and configuring
+.Fx
+systems.
+It is the first utility invoked by the
+.Fx
+installation boot
floppy and is also copied into
.Pa /stand/sysinstall
-on newly installed FreeBSD systems for use in later configuring the system.
+on newly installed
+.Fx
+systems for use in later configuring the system.
.Pp
The
.Nm
@@ -63,10 +69,14 @@ the ability to write MBRs and disk labels (through the services
of the
.Xr libdisk 3
library) and install distributions or packages onto new and
-existing FreeBSD systems. It also contains some extra intelligence
+existing
+.Fx
+systems. It also contains some extra intelligence
for running as a replacement for
.Xr init 8
-when it's invoked by the FreeBSD installation boot procedure. It
+when it's invoked by the
+.Fx
+installation boot procedure. It
assumes very little in the way of additional utility support and
performs most file system operations by calling the relevant syscalls
(such as
@@ -79,11 +89,12 @@ currently uses the
library to do user interaction with simple ANSI line graphics, color
support for which is enabled by either running on a syscons VTY or some
other color-capable terminal emulator (newer versions of xterm will support
-color when using the ``xterm-color'' termcap entry).
+color when using the
+.Dq xterm-color
+termcap entry).
.Pp
This product is currently at the end of its life cycle and will
eventually be replaced.
-utility.
.Sh RUNNING SCRIPTS
.Nm
may be either driven interactively through its various internal menus
@@ -124,7 +135,7 @@ directive), upon reaching the end of the argument list or on error.
For example:
.nf
-/stand/sysinstall _ftpPath=ftp:/ziggy/pub/ mediaSetFTP configPackages
+/stand/sysinstall _ftpPath=ftp://ziggy/pub/ mediaSetFTP configPackages
.fi
Would initialize
@@ -178,7 +189,11 @@ loading any required 3rd-party routing daemons as necessary.
.Bl -tag -width indent
.It router
can be set to the name of the desired routing daemon,
-e.g. ``routed'' or ``gated'', otherwise it is prompted for.
+e.g.
+.Dq routed
+or
+.Dq gated ,
+otherwise it is prompted for.
.El
.It configNFSServer
Configure host as an NFS server.
@@ -226,18 +241,27 @@ change to geometry.
.It partition
Set to disk partitioning type or size, its value being
.Ar free
-in order to use only remaining free space for FreeBSD,
+in order to use only remaining free space for
+.Fx ,
.Ar all
-to use the entire disk for FreeBSD but maintain a proper partition
+to use the entire disk for
+.Fx
+but maintain a proper partition
table,
.Ar existing
-to use an existing FreeBSD partition (first found),
+to use an existing
+.Fx
+partition (first found),
.Ar exclusive
-to use the disk in ``dangerously dedicated'' mode or, finally,
+to use the disk in
+.Dq dangerously dedicated
+mode or, finally,
.Ar somenumber
to allocate
.Ar somenumber
-blocks of available free space to a new FreeBSD partition.
+blocks of available free space to a new
+.Fx
+partition.
Default: Interactive mode.
.It bootManager
is set to one of
@@ -262,7 +286,8 @@ function) to be written out.
\fBVariables:\fR None
.It diskLabelEditor
Invokes the disk label editor. This is a bit trickier from a script
-since you need to essentially label everything inside each FreeBSD
+since you need to essentially label everything inside each
+.Fx
(type 0xA5) partition created by the
.Ar diskPartitionEditor
function, and that requires knowing a few rules about how things are
@@ -273,15 +298,20 @@ what the slice names will be, then and only then hardwiring them into
the script.
.Pp
For example, let's say you have a SCSI disk on which you've created a new
-FreeBSD partition in slice 2 (your DOS partition residing in slice 1).
+.Fx
+partition in slice 2 (your DOS partition residing in slice 1).
The slice name would be
.Ar da0s2
-for the whole FreeBSD partition (
-.Ar da0s1
+for the whole
+.Fx
+partition
+.Ar ( da0s1
being your DOS primary
partition). Now let's further assume that you have 500MB in this
partition and you want to sub-partition that space into root, swap,
-var and usr file systems for FreeBSD. Your invocation of the
+var and usr file systems for
+.Fx .
+Your invocation of the
.Ar diskLabelEditor
function might involve setting the following variables:
.Bl -tag -width findx
@@ -336,11 +366,12 @@ Resets all selected distributions to the empty set (no distributions selected).
.It distSetCustom
Allows the selection of a custom distribution set (e.g. not just on of the
existing "canned" sets) with no user interaction.
+
\fBVariables:\fR
.Bl -tag -width indent
.It dists
List of distributions to load. Possible distribution values are:
-.Bl -tag -width indent
+.Bl -tag -width indentxx
.It Li bin
The base binary distribution.
.It Li doc
@@ -360,19 +391,31 @@ GNU info files and other extra docs.
.It Li des
DES encryption binaries and libraries.
.It Li compat1x
-Compatibility with FreeBSD 1.x
+Compatibility with
+.It Li 1.x
.It Li compat20
-Compatibility with FreeBSD 2.0
+Compatibility with
+.Fx 2.0
.It Li compat21
-Compatibility with FreeBSD 2.1
+Compatibility with
+.Fx 2.1
+.It Li compat22
+.Fx 2.2
+and
+.Fx 3.0
+a.out binary compatibility
+.It Li compat3x
+Compatibility with
+.It Li 3.x
+(available for
+.Fx 4.0
+systems only)
.It Li ports
The ports collection.
.It Li krb
Kerberos binaries.
.It Li ssecure
/usr/src/secure
-.It Li sebones
-/usr/src/eBones
.It Li sbase
/usr/src/[top level files]
.It Li scontrib
@@ -481,6 +524,8 @@ XFree86 3.3.4 SVGA server.
XFree86 3.3.4 VGA16 server.
.It Li XW32
XFree86 3.3.4 ET4000/W32, /W32i and /W32p server.
+.It Li XTGA
+Server for TGA cards (alpha architecture only).
.It Li Xnest
XFree86 3.3.4 nested X server.
.It Li Xvfb
@@ -562,6 +607,7 @@ variable). Defaults to lynx.
Commit any and all pending changes to disk. This function
is essentially shorthand for a number of more granular "commit"
functions.
+.Pp
\fBVariables:\fR None
.It installExpress
Start an "express" installation, asking few questions of
@@ -611,7 +657,9 @@ configuration file from another.
The fully pathname of the file to load.
.El
.It mediaSetCDROM
-Select a FreeBSD CDROM as the installation media.
+Select a
+.Fx
+CDROM as the installation media.
.Pp
\fBVariables:\fR None
.It mediaSetFloppy
@@ -639,8 +687,8 @@ The domain name of the host being installed (optional).
.It defaultrouter
The default router for this host (non-optional).
.It netDev
-Which host interface to use (
-.Ar ed0
+Which host interface to use
+.Ar ( ed0
or
.Ar ep0 ,
for example. Non-optional).
@@ -652,9 +700,10 @@ The IP address for the selected host interface (non-optional).
.It netmask
The netmask for the selected host interface (non-optional).
.It _ftpPath
-The fully qualified URL of the FTP site containing the FreeBSD
+The fully qualified URL of the FTP site containing the
+.Fx
distribution you're interested in, e.g.
-.Ar ftp://ftp.freebsd.org/pub/FreeBSD/ .
+.Ar ftp://ftp.FreeBSD.org/pub/FreeBSD/ .
.El
.It mediaSetFTPActive
Alias for
@@ -677,7 +726,9 @@ the installation media.
\fBVariables:\fR
.Bl -tag -width indent
.It ufs
-full /path to directory containing the FreeBSD distribution you're
+full /path to directory containing the
+.Fx
+distribution you're
interested in.
.El
.It mediaSetNFS
@@ -691,8 +742,8 @@ The domain name of the host being installed (optional).
.It defaultrouter
The default router for this host (non-optional).
.It netDev
-Which host interface to use (
-.Ar ed0
+Which host interface to use
+.Ar ( ed0
or
.Ar ep0 ,
for example. Non-optional).
@@ -705,7 +756,9 @@ The IP address for the selected host interface (non-optional).
The netmask for the selected host interface (non-optional).
.It nfs
full hostname:/path specification for directory containing
-the FreeBSD distribution you're interested in.
+the
+.Fx
+distribution you're interested in.
.El
.It mediaSetFTPUserPass
.Pp
diff --git a/release/sysinstall/sysinstall.h b/release/sysinstall/sysinstall.h
index edf12ab..7db1baa 100644
--- a/release/sysinstall/sysinstall.h
+++ b/release/sysinstall/sysinstall.h
@@ -160,6 +160,7 @@
#define VAR_SLOW_ETHER "slowEthernetCard"
#define VAR_SWAP_SIZE "swapSize"
#define VAR_TAPE_BLOCKSIZE "tapeBlocksize"
+#define VAR_TRY_DHCP "tryDHCP"
#define VAR_UFS_PATH "ufs"
#define VAR_USR_SIZE "usrSize"
#define VAR_VAR_SIZE "varSize"
@@ -318,6 +319,7 @@ typedef int (*commandFunc)(char *key, void *data);
/* This is the structure that Network devices carry around in their private, erm, structures */
typedef struct _devPriv {
+ int use_dhcp;
char ipaddr[IPADDR_FIELD_LEN];
char netmask[IPADDR_FIELD_LEN];
char extras[EXTRAS_FIELD_LEN];
@@ -451,6 +453,10 @@ extern Boolean dummyInit(Device *dev);
extern FILE *dummyGet(Device *dev, char *dist, Boolean probe);
extern void dummyShutdown(Device *dev);
+/* dhcp.c */
+extern int dhcpParseLeases(char *file, char *hostname, char *domain, char *nameserver,
+ char *ipaddr, char *gateway, char *netmask);
+
/* disks.c */
extern int diskPartitionEditor(dialogMenuItem *self);
extern int diskPartitionWrite(dialogMenuItem *self);
diff --git a/release/sysinstall/system.c b/release/sysinstall/system.c
index d46ff5d..fc57fe3 100644
--- a/release/sysinstall/system.c
+++ b/release/sysinstall/system.c
@@ -71,7 +71,9 @@ expand(char *fname)
void
systemInitialize(int argc, char **argv)
{
+#ifdef __alpha__
int i;
+#endif
signal(SIGINT, SIG_IGN);
globalsInit();
@@ -109,11 +111,15 @@ systemInitialize(int argc, char **argv)
close(1); dup(0);
close(2); dup(0);
printf("%s running as init on %s\n", argv[0], OnVTY ? "vty0" : "serial console");
- i = ioctl(0, TIOCSCTTY, (char *)NULL);
+ ioctl(0, TIOCSCTTY, (char *)NULL);
setlogin("root");
setenv("PATH", "/stand:/bin:/sbin:/usr/sbin:/usr/bin:/mnt/bin:/mnt/sbin:/mnt/usr/sbin:/mnt/usr/bin:/usr/X11R6/bin", 1);
setbuf(stdin, 0);
setbuf(stderr, 0);
+#ifdef __alpha__
+ i = 0;
+ sysctlbyname("machdep.unaligned_print", NULL, 0, &i, sizeof(i));
+#endif
}
else {
char hname[256];
@@ -347,7 +353,7 @@ systemCreateHoloshell(void)
if (kill(ehs_pid, 0) == 0) {
if (msgYesNo("There seems to be an emergency holographic shell\n"
- "already running on VTY 4.\n"
+ "already running on VTY 4.\n\n"
"Kill it and start a new one?"))
return;
diff --git a/release/sysinstall/tcpip.c b/release/sysinstall/tcpip.c
index 0393cfe..105ed2c 100644
--- a/release/sysinstall/tcpip.c
+++ b/release/sysinstall/tcpip.c
@@ -39,6 +39,7 @@
#include "sysinstall.h"
#include <sys/param.h>
+#include <netdb.h>
/* The help file for the TCP/IP setup screen */
#define TCP_HELPFILE "tcp"
@@ -145,6 +146,53 @@ verifySettings(void)
return 0;
}
+static void
+dhcpGetInfo(Device *devp)
+{
+ /* If it fails, do it the old-fashioned way */
+ if (dhcpParseLeases("/var/db/dhclient.leases", hostname, domainname,
+ nameserver, ipaddr, gateway, netmask) == -1) {
+ FILE *ifp;
+ char *cp, cmd[256], data[2048];
+ int i, j;
+
+ /* Bah, now we have to kludge getting the information from ifconfig */
+ snprintf(cmd, sizeof cmd, "ifconfig %s", devp->name);
+ ifp = popen(cmd, "r");
+ if (ifp) {
+ j = fread(data, 1, sizeof(data), ifp);
+ fclose(ifp);
+ if (j < 0) /* paranoia */
+ j = 0;
+ data[j] = '\0';
+ if (isDebug())
+ msgDebug("DHCP configured interface returns %s\n", data);
+ /* XXX This is gross as it assumes a certain ordering to
+ ifconfig's output! XXX */
+ if ((cp = strstr(data, "inet")) != NULL) {
+ i = 0;
+ cp += 5; /* move over keyword */
+ while (*cp != ' ')
+ ipaddr[i++] = *(cp++);
+ ipaddr[i] = '\0';
+ if (!strncmp(++cp, "netmask", 7)) {
+ i = 0;
+ cp += 8;
+ while (*cp != ' ')
+ netmask[i++] = *(cp++);
+ netmask[i] = '\0';
+ }
+ }
+ }
+ }
+
+ /* If we didn't get a name server value, hunt for it in resolv.conf */
+ if (!nameserver[0] && file_readable("/etc/resolv.conf"))
+ configEnvironmentResolv("/etc/resolv.conf");
+ if (hostname[0])
+ variable_set2(VAR_HOSTNAME, hostname, 0);
+}
+
/* This is it - how to get TCP setup values */
int
tcpOpenDialog(Device *devp)
@@ -153,6 +201,7 @@ tcpOpenDialog(Device *devp)
ComposeObj *obj = NULL;
int n = 0, filled = 0, cancel = FALSE;
int max, ret = DITEM_SUCCESS;
+ int use_dhcp = FALSE;
char *tmp;
char title[80];
@@ -163,22 +212,46 @@ tcpOpenDialog(Device *devp)
SAFE_STRCPY(ipaddr, di->ipaddr);
SAFE_STRCPY(netmask, di->netmask);
SAFE_STRCPY(extras, di->extras);
+ use_dhcp = di->use_dhcp;
}
else { /* See if there are any defaults */
char *cp;
+ /* First try a DHCP scan if such behavior is desired */
+ if (!variable_cmp(VAR_TRY_DHCP, "YES") || !msgYesNo("Do you want to try DHCP configuration of the interface?")) {
+ int k;
+
+ Mkdir("/var/db");
+ Mkdir("/var/run");
+ Mkdir("/tmp");
+ msgNotify("Scanning for DHCP servers...");
+ for (k = 1; k < 4; k++) {
+ if (0 == vsystem("dhclient -1 %s", devp->name)) {
+ dhcpGetInfo(devp);
+ use_dhcp = TRUE;
+ break;
+ }
+ msgNotify("Scanning for DHCP servers... Retry: %d", k);
+ }
+ }
+
+ /* Get old IP address from variable space, if available */
if (!ipaddr[0]) {
if ((cp = variable_get(VAR_IPADDR)) != NULL)
SAFE_STRCPY(ipaddr, cp);
else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_IPADDR))) != NULL)
SAFE_STRCPY(ipaddr, cp);
}
+
+ /* Get old netmask from variable space, if available */
if (!netmask[0]) {
if ((cp = variable_get(VAR_NETMASK)) != NULL)
SAFE_STRCPY(netmask, cp);
else if ((cp = variable_get(string_concat3(devp->name, "_", VAR_NETMASK))) != NULL)
SAFE_STRCPY(netmask, cp);
}
+
+ /* Get old extras string from variable space, if available */
if (!extras[0]) {
if ((cp = variable_get(VAR_EXTRAS)) != NULL)
SAFE_STRCPY(extras, cp);
@@ -188,26 +261,26 @@ tcpOpenDialog(Device *devp)
}
/* Look up values already recorded with the system, or blank the string variables ready to accept some new data */
- tmp = variable_get(VAR_HOSTNAME);
- if (tmp)
- SAFE_STRCPY(hostname, tmp);
- else
- bzero(hostname, sizeof(hostname));
- tmp = variable_get(VAR_DOMAINNAME);
- if (tmp)
- SAFE_STRCPY(domainname, tmp);
- else
- bzero(domainname, sizeof(domainname));
- tmp = variable_get(VAR_GATEWAY);
- if (tmp)
- SAFE_STRCPY(gateway, tmp);
- else
- bzero(gateway, sizeof(gateway));
- tmp = variable_get(VAR_NAMESERVER);
- if (tmp)
- SAFE_STRCPY(nameserver, tmp);
- else
- bzero(nameserver, sizeof(nameserver));
+ if (!hostname[0]) {
+ tmp = variable_get(VAR_HOSTNAME);
+ if (tmp)
+ SAFE_STRCPY(hostname, tmp);
+ }
+ if (!domainname[0]) {
+ tmp = variable_get(VAR_DOMAINNAME);
+ if (tmp)
+ SAFE_STRCPY(domainname, tmp);
+ }
+ if (!gateway[0]) {
+ tmp = variable_get(VAR_GATEWAY);
+ if (tmp)
+ SAFE_STRCPY(gateway, tmp);
+ }
+ if (!nameserver[0]) {
+ tmp = variable_get(VAR_NAMESERVER);
+ if (tmp)
+ SAFE_STRCPY(nameserver, tmp);
+ }
save = savescr();
/* If non-interactive, jump straight over the dialog crap and into config section */
@@ -252,7 +325,7 @@ reenter:
* the most appropriate one (entire class C, or subnetted
* class A/B network).
*/
- if (netmask[0] == '\0') {
+ if (!netmask[0]) {
strcpy(netmask, "255.255.255.0");
RefreshStringObj(layout[LAYOUT_NETMASK].obj);
++filled;
@@ -288,14 +361,18 @@ netconfig:
char temp[512], ifn[255];
char *ifaces;
- variable_set2(VAR_HOSTNAME, hostname, 1);
- sethostname(hostname, strlen(hostname));
+ if (hostname[0]) {
+ variable_set2(VAR_HOSTNAME, hostname, use_dhcp ? 0 : 1);
+ sethostname(hostname, strlen(hostname));
+ }
if (domainname[0])
variable_set2(VAR_DOMAINNAME, domainname, 0);
if (gateway[0])
- variable_set2(VAR_GATEWAY, gateway, 1);
+ variable_set2(VAR_GATEWAY, gateway, use_dhcp ? 0 : 1);
if (nameserver[0])
variable_set2(VAR_NAMESERVER, nameserver, 0);
+ if (ipaddr[0])
+ variable_set2(VAR_IPADDR, ipaddr, 0);
if (!devp->private)
devp->private = (DevInfo *)safe_malloc(sizeof(DevInfo));
@@ -303,9 +380,13 @@ netconfig:
SAFE_STRCPY(di->ipaddr, ipaddr);
SAFE_STRCPY(di->netmask, netmask);
SAFE_STRCPY(di->extras, extras);
+ di->use_dhcp = use_dhcp;
- sprintf(temp, "inet %s %s netmask %s", ipaddr, extras, netmask);
sprintf(ifn, "%s%s", VAR_IFCONFIG, devp->name);
+ if (use_dhcp)
+ sprintf(temp, "DHCP");
+ else
+ sprintf(temp, "inet %s %s netmask %s", ipaddr, extras, netmask);
variable_set2(ifn, temp, 1);
ifaces = variable_get(VAR_INTERFACES);
if (!ifaces)
@@ -315,9 +396,8 @@ netconfig:
sprintf(ifn, "%s %s", devp->name, ifaces);
variable_set2(VAR_INTERFACES, ifn, 1);
}
- if (ipaddr[0])
- variable_set2(VAR_IPADDR, ipaddr, 0);
- configResolv(NULL); /* XXX this will do it on the MFS copy XXX */
+ if (!use_dhcp)
+ configResolv(NULL); /* XXX this will do it on the MFS copy XXX */
ret = DITEM_SUCCESS;
}
else
@@ -396,7 +476,7 @@ tcpMenuSelect(dialogMenuItem *self)
Device *tmp;
tmp = tcpDeviceSelect();
- if (tmp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
+ if (tmp && !((DevInfo *)tmp->private)->use_dhcp && !msgYesNo("Would you like to bring the %s interface up right now?", tmp->name))
if (!tmp->init(tmp))
msgConfirm("Initialization of %s device failed.", tmp->name);
return DITEM_SUCCESS | DITEM_RESTORE;
diff --git a/release/sysinstall/variable.c b/release/sysinstall/variable.c
index 40f2284..1e2bf9a 100644
--- a/release/sysinstall/variable.c
+++ b/release/sysinstall/variable.c
@@ -58,7 +58,8 @@ make_variable(char *var, char *value, int dirty)
setenv(var, value, 1);
free(vp->value);
vp->value = strdup(value);
- vp->dirty = dirty;
+ if (dirty != -1)
+ vp->dirty = dirty;
return;
}
}
@@ -68,6 +69,8 @@ make_variable(char *var, char *value, int dirty)
vp = (Variable *)safe_malloc(sizeof(Variable));
vp->name = strdup(var);
vp->value = strdup(value);
+ if (dirty == -1)
+ dirty = 0;
vp->dirty = dirty;
vp->next = VarHead;
VarHead = vp;
OpenPOWER on IntegriCloud