summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-05-23 18:06:16 +0000
committerjkh <jkh@FreeBSD.org>1995-05-23 18:06:16 +0000
commit1503917ec9b489a39b5b6852d0dd4da1e98df07a (patch)
tree8166ea8807c2f301839ed0dfc6658a8942d1f428 /usr.sbin/sade
parent44080e30b5035fd5c72753df7b50234d49db0c84 (diff)
downloadFreeBSD-src-1503917ec9b489a39b5b6852d0dd4da1e98df07a.zip
FreeBSD-src-1503917ec9b489a39b5b6852d0dd4da1e98df07a.tar.gz
Add my first cut at TCP/IP device configuration. If this works, the
ftp installation method should now function. We'll know as soon as my make release builds the floppies. I'm just committing this out of my release tree now so that it doesn't get clobbered again.
Diffstat (limited to 'usr.sbin/sade')
-rw-r--r--usr.sbin/sade/config.c23
-rw-r--r--usr.sbin/sade/install.c4
-rw-r--r--usr.sbin/sade/misc.c16
-rw-r--r--usr.sbin/sade/sade.h4
4 files changed, 38 insertions, 9 deletions
diff --git a/usr.sbin/sade/config.c b/usr.sbin/sade/config.c
index 526f1cc..881d875 100644
--- a/usr.sbin/sade/config.c
+++ b/usr.sbin/sade/config.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.47 1995/05/22 14:10:17 jkh Exp $
+ * $Id: config.c,v 1.1 1995/05/23 02:40:50 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -191,5 +191,24 @@ config_sysconfig(void)
void
config_resolv(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;
+ }
+ Mkdir("/etc", NULL);
+ fp = fopen("/etc/resolv.conf", "w");
+ if (!fp) {
+ msgConfirm("Unable to open /etc/resolv.conf! You will need to do this manually.");
+ return;
+ }
+ fprintf(fp, "domain\t%s\n", getenv(VAR_DOMAINNAME));
+ fprintf(fp, "nameserver\t%s\n", getenv(VAR_NAMESERVER));
+ fclose(fp);
+ alreadyDone = TRUE;
+}
diff --git a/usr.sbin/sade/install.c b/usr.sbin/sade/install.c
index 2253445..ba2bdfa 100644
--- a/usr.sbin/sade/install.c
+++ b/usr.sbin/sade/install.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: install.c,v 1.47 1995/05/22 14:10:17 jkh Exp $
+ * $Id: install.c,v 1.48 1995/05/23 02:41:05 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -196,6 +196,7 @@ installInitial(void)
dialog_clear();
chroot("/mnt");
chdir("/");
+ variable_set2(RUNNING_ON_ROOT, "yes");
cpio_extract();
alreadyDone = TRUE;
}
@@ -212,6 +213,7 @@ installFinal(void)
config_resolv();
do_final_setup();
alreadyDone = TRUE;
+ SystemWasInstalled = TRUE;
}
/*
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c
index 5fc29af..197a9ec 100644
--- a/usr.sbin/sade/misc.c
+++ b/usr.sbin/sade/misc.c
@@ -1,7 +1,7 @@
/*
* Miscellaneous support routines..
*
- * $Id: misc.c,v 1.6 1995/05/18 16:53:53 jkh Exp $
+ * $Id: misc.c,v 1.7 1995/05/18 16:57:52 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -40,6 +40,7 @@
#include "sysinstall.h"
#include <ctype.h>
+#include <unistd.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <sys/file.h>
@@ -176,8 +177,12 @@ Mkdir(char *ipath, void *data)
{
struct stat sb;
int final=0;
- char *p, *path = strdup(ipath);
+ char *p, *path;
+ if (access(ipath, R_OK) == 0)
+ return 0;
+
+ path = strdup(ipath);
msgDebug("mkdir(%s)\n", path);
p = path;
if (p[0] == '/') /* Skip leading '/'. */
@@ -222,9 +227,10 @@ Mount(char *mountp, void *dev)
}
memset(&ufsargs,0,sizeof ufsargs);
- if (access(mountpoint, R_OK))
- Mkdir(mountpoint, NULL);
-
+ if (Mkdir(mountpoint, NULL)) {
+ msgConfirm("Unable to make directory mountpoint for %s!", mountpoint);
+ return 1;
+ }
msgDebug("mount %s %s\n", device, mountpoint);
ufsargs.fspec = device;
if (mount(MOUNT_UFS, mountpoint, 0, (caddr_t)&ufsargs) == -1) {
diff --git a/usr.sbin/sade/sade.h b/usr.sbin/sade/sade.h
index 3c3a0f9..c735f22 100644
--- a/usr.sbin/sade/sade.h
+++ b/usr.sbin/sade/sade.h
@@ -4,7 +4,7 @@
* This is probably the last attempt in the `sysinstall' line, the next
* generation being slated to essentially a complete rewrite.
*
- * $Id: sysinstall.h,v 1.26 1995/05/21 15:40:53 jkh Exp $
+ * $Id: sysinstall.h,v 1.27 1995/05/23 02:41:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -83,6 +83,7 @@
/* Internal flag variables */
#define DISK_PARTITIONED "_diskPartitioned"
#define DISK_LABELLED "_diskLabelled"
+#define RUNNING_ON_ROOT "_runningOnRoot"
#define TCP_CONFIGURED "_tcpConfigured"
#define NO_CONFIRMATION "_noConfirmation"
@@ -388,6 +389,7 @@ extern int vsystem(char *fmt, ...);
/* tcpip.c */
extern int tcpOpenDialog(char *);
extern Device *tcpDeviceSelect(void);
+extern Boolean tcpStartPPP(void);
/* termcap.c */
extern int set_termcap(void);
OpenPOWER on IntegriCloud