NFS installation was broken - try to fix it.

This commit is contained in:
Jordan K. Hubbard 1995-05-30 05:13:24 +00:00
parent d1de348dff
commit e34d8f08ab
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8860
7 changed files with 50 additions and 27 deletions

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: media.c,v 1.21 1995/05/28 03:04:58 jkh Exp $
* $Id: media.c,v 1.22 1995/05/29 11:01:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -232,7 +232,6 @@ mediaSetFTP(char *str)
static Device ftpDevice;
char *cp;
tcpDeviceSelect(NULL);
dmenuOpenSimple(&MenuMediaFTP);
cp = getenv("ftp");
if (!cp)
@ -244,9 +243,9 @@ mediaSetFTP(char *str)
else
variable_set2("ftp", cp);
}
tcpDeviceSelect(NULL);
strcpy(ftpDevice.name, cp);
ftpDevice.type = DEVICE_TYPE_NETWORK;
ftpDevice.type = DEVICE_TYPE_FTP;
ftpDevice.init = mediaInitFTP;
ftpDevice.get = mediaGetFTP;
ftpDevice.close = mediaCloseFTP;
@ -282,12 +281,13 @@ mediaSetNFS(char *str)
val = msgGetInput(NULL, "Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format: hostname:/some/freebsd/dir");
if (!val)
return 0;
strcpy(nfsDevice.name, "nfs");
tcpDeviceSelect(NULL);
strncpy(nfsDevice.name, val, DEV_NAME_MAX);
nfsDevice.type = DEVICE_TYPE_NFS;
nfsDevice.init = mediaInitNFS;
nfsDevice.get = mediaGetNFS;
nfsDevice.shutdown = mediaShutdownNFS;
nfsDevice.private = strdup(val);
nfsDevice.private = mediaDevice;
mediaDevice = &nfsDevice;
return 1;
}

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.38 1995/05/29 11:01:29 jkh Exp $
* $Id: menus.c,v 1.39 1995/05/29 11:58:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -663,12 +663,13 @@ When you're done, select Cancel",
};
DMenu MenuNetworking = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
DMENU_NORMAL_TYPE,
"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.",
aspects of your system's network configuration.\n\n\
When you are done, select Cancel.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",

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: media.c,v 1.21 1995/05/28 03:04:58 jkh Exp $
* $Id: nfs.c,v 1.2 1995/05/29 11:01:35 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -53,17 +53,23 @@ Boolean NFSMounted;
Boolean
mediaInitNFS(Device *dev)
{
Device *netDevice = (Device *)dev->private;
if (NFSMounted)
return TRUE;
if (netDevice->init)
if (!(*netDevice->init)(netDevice))
return FALSE;
if (Mkdir("/nfs", NULL))
return FALSE;
if (!vsystem("mount_nfs %s %s %s /nfs", getenv("nfsSlowPC") ? "-r 1024 -w 1024" : "",
getenv("nfsServerSecure") ? "-P" : "", dev->private))
getenv("nfsServerSecure") ? "-P" : "", dev->name))
return TRUE;
else {
msgConfirm("Error mounting %s on /nfs: %s (%u)\n", dev->private, strerror(errno), errno);
msgConfirm("Error mounting %s on /nfs: %s (%u)\n", dev->name, strerror(errno), errno);
return FALSE;
}
NFSMounted = TRUE;
@ -85,6 +91,8 @@ mediaGetNFS(char *file)
void
mediaShutdownNFS(Device *dev)
{
Device *netdev = (Device *)dev->private;
if (!NFSMounted)
return;
msgDebug("Unmounting /nfs\n");
@ -92,6 +100,8 @@ mediaShutdownNFS(Device *dev)
msgConfirm("Could not unmount the NFS partition: %s\n", strerror(errno));
if (isDebug())
msgDebug("Unmount returned\n");
if (netdev->shutdown)
(*netdev->shutdown)(netdev);
NFSMounted = FALSE;
return;
}

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.38 1995/05/29 11:01:29 jkh Exp $
* $Id: menus.c,v 1.39 1995/05/29 11:58:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -663,12 +663,13 @@ When you're done, select Cancel",
};
DMenu MenuNetworking = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
DMENU_NORMAL_TYPE,
"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.",
aspects of your system's network configuration.\n\n\
When you are done, select Cancel.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",

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: media.c,v 1.21 1995/05/28 03:04:58 jkh Exp $
* $Id: media.c,v 1.22 1995/05/29 11:01:27 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -232,7 +232,6 @@ mediaSetFTP(char *str)
static Device ftpDevice;
char *cp;
tcpDeviceSelect(NULL);
dmenuOpenSimple(&MenuMediaFTP);
cp = getenv("ftp");
if (!cp)
@ -244,9 +243,9 @@ mediaSetFTP(char *str)
else
variable_set2("ftp", cp);
}
tcpDeviceSelect(NULL);
strcpy(ftpDevice.name, cp);
ftpDevice.type = DEVICE_TYPE_NETWORK;
ftpDevice.type = DEVICE_TYPE_FTP;
ftpDevice.init = mediaInitFTP;
ftpDevice.get = mediaGetFTP;
ftpDevice.close = mediaCloseFTP;
@ -282,12 +281,13 @@ mediaSetNFS(char *str)
val = msgGetInput(NULL, "Please enter the full NFS file specification for the remote\nhost and directory containing the FreeBSD distribution files.\nThis should be in the format: hostname:/some/freebsd/dir");
if (!val)
return 0;
strcpy(nfsDevice.name, "nfs");
tcpDeviceSelect(NULL);
strncpy(nfsDevice.name, val, DEV_NAME_MAX);
nfsDevice.type = DEVICE_TYPE_NFS;
nfsDevice.init = mediaInitNFS;
nfsDevice.get = mediaGetNFS;
nfsDevice.shutdown = mediaShutdownNFS;
nfsDevice.private = strdup(val);
nfsDevice.private = mediaDevice;
mediaDevice = &nfsDevice;
return 1;
}

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.38 1995/05/29 11:01:29 jkh Exp $
* $Id: menus.c,v 1.39 1995/05/29 11:58:16 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -663,12 +663,13 @@ When you're done, select Cancel",
};
DMenu MenuNetworking = {
DMENU_NORMAL_TYPE | DMENU_SELECTION_RETURNS,
DMENU_NORMAL_TYPE,
"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.",
aspects of your system's network configuration.\n\n\
When you are done, select Cancel.",
NULL,
NULL,
{ { "NFS client", "This machine will be an NFS client",

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: media.c,v 1.21 1995/05/28 03:04:58 jkh Exp $
* $Id: nfs.c,v 1.2 1995/05/29 11:01:35 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -53,17 +53,23 @@ Boolean NFSMounted;
Boolean
mediaInitNFS(Device *dev)
{
Device *netDevice = (Device *)dev->private;
if (NFSMounted)
return TRUE;
if (netDevice->init)
if (!(*netDevice->init)(netDevice))
return FALSE;
if (Mkdir("/nfs", NULL))
return FALSE;
if (!vsystem("mount_nfs %s %s %s /nfs", getenv("nfsSlowPC") ? "-r 1024 -w 1024" : "",
getenv("nfsServerSecure") ? "-P" : "", dev->private))
getenv("nfsServerSecure") ? "-P" : "", dev->name))
return TRUE;
else {
msgConfirm("Error mounting %s on /nfs: %s (%u)\n", dev->private, strerror(errno), errno);
msgConfirm("Error mounting %s on /nfs: %s (%u)\n", dev->name, strerror(errno), errno);
return FALSE;
}
NFSMounted = TRUE;
@ -85,6 +91,8 @@ mediaGetNFS(char *file)
void
mediaShutdownNFS(Device *dev)
{
Device *netdev = (Device *)dev->private;
if (!NFSMounted)
return;
msgDebug("Unmounting /nfs\n");
@ -92,6 +100,8 @@ mediaShutdownNFS(Device *dev)
msgConfirm("Could not unmount the NFS partition: %s\n", strerror(errno));
if (isDebug())
msgDebug("Unmount returned\n");
if (netdev->shutdown)
(*netdev->shutdown)(netdev);
NFSMounted = FALSE;
return;
}