mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-16 23:57:54 +01:00
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.
This commit is contained in:
parent
43012d292c
commit
7b61dc31a2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8709
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: media_strategy.c,v 1.11 1995/05/22 14:10:23 jkh Exp $
|
||||
* $Id: media_strategy.c,v 1.12 1995/05/23 02:41:11 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -55,7 +55,7 @@
|
||||
#include <sys/dkbad.h>
|
||||
#include <sys/mman.h>
|
||||
#include <netdb.h>
|
||||
#include "libftp.h"
|
||||
#include "ftp.h"
|
||||
|
||||
#define MSDOSFS
|
||||
#define CD9660
|
||||
@ -399,6 +399,33 @@ mediaInitTape(Device *dev)
|
||||
Boolean
|
||||
mediaInitNetwork(Device *dev)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (!strncmp("cuaa", dev->name, 4)) {
|
||||
if (tcpStartPPP()) {
|
||||
msgConfirm("You have selected a serial device as your network installation device.\nThe PPP dialer is now running on the 3rd screen (type ALT-F3 to interact\nwith it) and should be used to establish the link BEFORE YOU HIT RETURN\nhere! Once you hit return in this screen (type ALT-F1 to return to this\nscreen from the PPP screen) the installation will assume that your link\nis set up and begin transfering the distributions over PPP.");
|
||||
}
|
||||
else {
|
||||
msgConfirm("Unable to start PPP! This installation method\ncannot be used.");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
char *cp, ifconfig[64];
|
||||
|
||||
sprintf(ifconfig, "%s%s", VAR_IFCONFIG, dev->name);
|
||||
cp = getenv(ifconfig);
|
||||
if (!cp) {
|
||||
msgConfirm("The %s device is not configured. You will need to do so\nin the Networking configuration menu before proceeding.");
|
||||
return FALSE;
|
||||
}
|
||||
i = vsystem("ifconfig %s", ifconfig);
|
||||
if (i) {
|
||||
msgConfirm("Unable to configure the %s interface!\nThis installation method cannot be used.");
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
config_resolv();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: tcpip.c,v 1.9 1995/05/18 16:44:41 gpalmer Exp $
|
||||
* $Id: tcpip.c,v 1.10 1995/05/21 15:40:54 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Gary J Palmer. All rights reserved.
|
||||
@ -571,3 +571,26 @@ tcpDeviceSelect(void)
|
||||
return netDevice;
|
||||
}
|
||||
|
||||
/* Start PPP on the 3rd screen */
|
||||
Boolean
|
||||
tcpStartPPP(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = open("/dev/ttyv2", O_RDWR);
|
||||
if (fd == -1)
|
||||
return FALSE;
|
||||
|
||||
if (!fork()) {
|
||||
dup2(fd, 0);
|
||||
dup2(fd, 1);
|
||||
dup2(fd, 2);
|
||||
execl("/stand/ppp", "/stand/ppp", (char *)NULL);
|
||||
exit(1);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: tcpip.c,v 1.9 1995/05/18 16:44:41 gpalmer Exp $
|
||||
* $Id: tcpip.c,v 1.10 1995/05/21 15:40:54 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Gary J Palmer. All rights reserved.
|
||||
@ -571,3 +571,26 @@ tcpDeviceSelect(void)
|
||||
return netDevice;
|
||||
}
|
||||
|
||||
/* Start PPP on the 3rd screen */
|
||||
Boolean
|
||||
tcpStartPPP(void)
|
||||
{
|
||||
int fd;
|
||||
|
||||
fd = open("/dev/ttyv2", O_RDWR);
|
||||
if (fd == -1)
|
||||
return FALSE;
|
||||
|
||||
if (!fork()) {
|
||||
dup2(fd, 0);
|
||||
dup2(fd, 1);
|
||||
dup2(fd, 2);
|
||||
execl("/stand/ppp", "/stand/ppp", (char *)NULL);
|
||||
exit(1);
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user