Make Jordan's ``half baked'' code compile so that make release's aren't

stopped dead in their tracks. Also add the beginnings of my
distribution extraction code in media_strategy.c
This commit is contained in:
Gary Palmer 1995-05-20 03:49:10 +00:00
parent 7ab5b08b2c
commit e61618782b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8637
6 changed files with 85 additions and 26 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.6 1995/05/17 14:39:51 jkh Exp $
* $Id: media.c,v 1.7 1995/05/20 00:13:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -51,13 +51,13 @@
int
mediaSetCDROM(char *str)
{
Device *devs;
Device **devs;
int cnt;
if (OnCDROM == TRUE)
return 1;
else {
devs = deviceFind(NULL, MEDIA_TYPE_CDROM);
devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
cnt = deviceCount(devs);
if (!cnt) {
msgConfirm("No CDROM devices found! Please check that your system's\nconfiguration is correct and that the CDROM drive is of a supported\ntype. For more information, consult the hardware guide\nin the Doc menu.");
@ -81,10 +81,6 @@ int
mediaSetFloppy(char *str)
{
dmenuOpenSimple(&MenuMediaFloppy);
if (getenv(MEDIA_DEVICE)) {
variable_set2(MEDIA_TYPE, "floppy");
return 1;
}
return 0;
}
@ -121,10 +117,6 @@ int
mediaSetFTP(char *str)
{
dmenuOpenSimple(&MenuMediaFTP);
if (getenv(MEDIA_DEVICE)) {
variable_set2(MEDIA_TYPE, "ftp");
return 1;
}
return 0;
}
@ -149,7 +141,10 @@ mediaOpen(char *parent, char *me)
if (parent)
snprintf(fname, FILENAME_MAX, "%s%s", parent, me);
else
snprintf(fname, FILENAME_MAX, "%s/%s", me, me);
#if 0
strncpy(fname, me, FILENAME_MAX);
#endif
/* XXX mediaDevice points to where we want to get it from */
return NULL;
}
@ -166,9 +161,11 @@ mediaGetType(void)
char *cp;
dmenuOpenSimple(&MenuMedia);
#if 0
cp = getenv(MEDIA_TYPE);
if (!cp)
return FALSE;
#endif
return TRUE;
}
@ -182,3 +179,8 @@ mediaVerify(void)
}
return TRUE;
}
void
mediaClose(void)
{
}

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.5 1995/05/16 11:37:18 jkh Exp $
* $Id: media_strategy.c,v 1.1 1995/05/17 14:39:53 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -43,12 +43,64 @@
#include <stdio.h>
#include "sysinstall.h"
#include <ctype.h>
#include <sys/stat.h>
#include <sys/errno.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/param.h>
#include <sys/dkbad.h>
#define MSDOSFS
#define CD9660
#define NFS
#include <sys/mount.h>
#undef MSDOSFS
#undef CD9660
#undef NFS
int
genericGetDist(char *dist, char *source)
{
return 0;
}
/* Various media "strategy" routines */
Boolean
mediaInitCDROM(Device *dev)
{
struct iso_args args;
struct stat sb;
if (Mkdir("/mnt/cdrom", NULL))
return FALSE;
args.fspec = dev->devname;
if (mount(MOUNT_CD9660, "/mnt/cdrom", 0, (caddr_t) &args) == -1)
{
msgConfirm("Error mounting %s on /mnt/cdrom: %s\n",
dev, strerror(errno));
return FALSE;
}
/* Do a very simple check to see if this looks roughly like a 2.0.5 CDROM
Unfortunately FreeBSD won't let us read the ``label'' AFAIK, which is one
sure way of telling the disc version :-( */
if (stat("/mnt/cdrom/dists", &sb))
{
if (errno == ENOENT)
{
msgConfirm("Couldn't locate the directory `dists' on the cdrom\n\
Is this a 2.0.5 CDROM?\n");
return FALSE;
} else {
msgConfirm("Couldn't stat directory %s: %s", "/mnt/cdrom/dists", strerror(errno));
return FALSE;
}
}
return TRUE;
}

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: sysinstall.h,v 1.20 1995/05/19 16:58:57 jkh Exp $
* $Id: sysinstall.h,v 1.21 1995/05/20 00:13:14 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -297,6 +297,7 @@ extern FILE *mediaOpen(char *parent, char *me);
extern Boolean mediaGetType(void);
extern Boolean mediaExtractDist(FILE *fp);
extern Boolean mediaVerify(void);
extern void mediaClose(void);
/* media_strategy.c */
extern Boolean mediaInitUFS(Device *dev);

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: sysinstall.h,v 1.20 1995/05/19 16:58:57 jkh Exp $
* $Id: sysinstall.h,v 1.21 1995/05/20 00:13:14 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -297,6 +297,7 @@ extern FILE *mediaOpen(char *parent, char *me);
extern Boolean mediaGetType(void);
extern Boolean mediaExtractDist(FILE *fp);
extern Boolean mediaVerify(void);
extern void mediaClose(void);
/* media_strategy.c */
extern Boolean mediaInitUFS(Device *dev);

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.6 1995/05/17 14:39:51 jkh Exp $
* $Id: media.c,v 1.7 1995/05/20 00:13:11 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -51,13 +51,13 @@
int
mediaSetCDROM(char *str)
{
Device *devs;
Device **devs;
int cnt;
if (OnCDROM == TRUE)
return 1;
else {
devs = deviceFind(NULL, MEDIA_TYPE_CDROM);
devs = deviceFind(NULL, DEVICE_TYPE_CDROM);
cnt = deviceCount(devs);
if (!cnt) {
msgConfirm("No CDROM devices found! Please check that your system's\nconfiguration is correct and that the CDROM drive is of a supported\ntype. For more information, consult the hardware guide\nin the Doc menu.");
@ -81,10 +81,6 @@ int
mediaSetFloppy(char *str)
{
dmenuOpenSimple(&MenuMediaFloppy);
if (getenv(MEDIA_DEVICE)) {
variable_set2(MEDIA_TYPE, "floppy");
return 1;
}
return 0;
}
@ -121,10 +117,6 @@ int
mediaSetFTP(char *str)
{
dmenuOpenSimple(&MenuMediaFTP);
if (getenv(MEDIA_DEVICE)) {
variable_set2(MEDIA_TYPE, "ftp");
return 1;
}
return 0;
}
@ -149,7 +141,10 @@ mediaOpen(char *parent, char *me)
if (parent)
snprintf(fname, FILENAME_MAX, "%s%s", parent, me);
else
snprintf(fname, FILENAME_MAX, "%s/%s", me, me);
#if 0
strncpy(fname, me, FILENAME_MAX);
#endif
/* XXX mediaDevice points to where we want to get it from */
return NULL;
}
@ -166,9 +161,11 @@ mediaGetType(void)
char *cp;
dmenuOpenSimple(&MenuMedia);
#if 0
cp = getenv(MEDIA_TYPE);
if (!cp)
return FALSE;
#endif
return TRUE;
}
@ -182,3 +179,8 @@ mediaVerify(void)
}
return TRUE;
}
void
mediaClose(void)
{
}

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: sysinstall.h,v 1.20 1995/05/19 16:58:57 jkh Exp $
* $Id: sysinstall.h,v 1.21 1995/05/20 00:13:14 jkh Exp $
*
* Copyright (c) 1995
* Jordan Hubbard. All rights reserved.
@ -297,6 +297,7 @@ extern FILE *mediaOpen(char *parent, char *me);
extern Boolean mediaGetType(void);
extern Boolean mediaExtractDist(FILE *fp);
extern Boolean mediaVerify(void);
extern void mediaClose(void);
/* media_strategy.c */
extern Boolean mediaInitUFS(Device *dev);