summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall/config.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-04-28 01:07:27 +0000
committerjkh <jkh@FreeBSD.org>1996-04-28 01:07:27 +0000
commit757f0d4140ba92ac2ff7e00fc840bf99ecee5f21 (patch)
treee29bd26ab9f65572bd124e188a21b4a1744bcb54 /usr.sbin/sysinstall/config.c
parent7a8e35fbab581e26b8a60eeea29077d5d66b9e11 (diff)
downloadFreeBSD-src-757f0d4140ba92ac2ff7e00fc840bf99ecee5f21.zip
FreeBSD-src-757f0d4140ba92ac2ff7e00fc840bf99ecee5f21.tar.gz
Move some of functions around in order to make this stuff easier
to work on.
Diffstat (limited to 'usr.sbin/sysinstall/config.c')
-rw-r--r--usr.sbin/sysinstall/config.c59
1 files changed, 57 insertions, 2 deletions
diff --git a/usr.sbin/sysinstall/config.c b/usr.sbin/sysinstall/config.c
index 1c0ef70..5577fc5 100644
--- a/usr.sbin/sysinstall/config.c
+++ b/usr.sbin/sysinstall/config.c
@@ -4,7 +4,7 @@
* This is probably the last program in the `sysinstall' line - the next
* generation being essentially a complete rewrite.
*
- * $Id: config.c,v 1.24 1996/04/13 13:31:25 jkh Exp $
+ * $Id: config.c,v 1.25 1996/04/23 01:29:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@@ -37,6 +37,13 @@
#include "sysinstall.h"
#include <sys/disklabel.h>
#include <sys/wait.h>
+#include <sys/errno.h>
+#include <sys/ioctl.h>
+#include <sys/fcntl.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <sys/mount.h>
static Chunk *chunk_list[MAX_CHUNKS];
static int nchunks;
@@ -379,7 +386,6 @@ skip:
if (cp && *cp != '0' && (hp = variable_get(VAR_HOSTNAME))) {
char cp2[255];
- (void)vsystem("/bin/hostname %s", hp);
fp = fopen("/etc/hosts", "w");
if (!index(hp, '.'))
cp2[0] = '\0';
@@ -537,3 +543,52 @@ configPorts(dialogMenuItem *self)
return DITEM_FAILURE;
return DITEM_SUCCESS;
}
+
+/* Load gated package */
+int
+configGated(dialogMenuItem *self)
+{
+ if (package_add("gated-3.5a11") == DITEM_SUCCESS)
+ variable_set2("gated", "YES");
+ return DITEM_SUCCESS;
+}
+
+/* Load pcnfsd package */
+int
+configPCNFSD(dialogMenuItem *self)
+{
+ if (package_add("pcnfsd-93.02.16") == DITEM_SUCCESS)
+ variable_set2("pcnfsd", "YES");
+ return DITEM_SUCCESS;
+}
+
+int
+configNFSServer(dialogMenuItem *self)
+{
+ char cmd[256];
+
+ /* If we're an NFS server, we need an exports file */
+ if (!file_readable("/etc/exports")) {
+ WINDOW *w = savescr();
+
+ msgConfirm("Operating as an NFS server means that you must first configure\n"
+ "an /etc/exports file to indicate which hosts are allowed certain\n"
+ "kinds of access to your local file systems.\n"
+ "Press [ENTER] now to invoke an editor on /etc/exports\n");
+ system("echo '#The following examples export /usr to 3 machines named after ducks,' > /etc/exports");
+ system("echo '#/home and all directories under it to machines named after dead rock stars' >> /etc/exports");
+ system("echo '#and, finally, /a to 2 privileged machines allowed to write on it as root.' >> /etc/exports");
+ system("echo '#/usr huey louie dewie' >> /etc/exports");
+ system("echo '#/home -alldirs janice jimmy frank' >> /etc/exports");
+ system("echo '#/a -maproot=0 bill albert' >> /etc/exports");
+ system("echo '#' >> /etc/exports");
+ system("echo '# You should replace these lines with your actual exported filesystems.' >> /etc/exports");
+ system("echo >> /etc/exports");
+ sprintf(cmd, "%s /etc/exports", variable_get(VAR_EDITOR));
+ dialog_clear();
+ systemExecute(cmd);
+ restorescr(w);
+ }
+ variable_set2("nfs_server", "YES");
+ return DITEM_SUCCESS;
+}
OpenPOWER on IntegriCloud