diff options
Diffstat (limited to 'release/sysinstall/cdrom.c')
-rw-r--r-- | release/sysinstall/cdrom.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/release/sysinstall/cdrom.c b/release/sysinstall/cdrom.c index 1fd1380..f6fe16b 100644 --- a/release/sysinstall/cdrom.c +++ b/release/sysinstall/cdrom.c @@ -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: cdrom.c,v 1.42 1998/08/27 00:50:14 jkh Exp $ + * $Id: cdrom.c,v 1.43 1998/10/14 11:23:48 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -54,6 +54,7 @@ #undef CD9660 static Boolean cdromMounted; +static char mountpoint[] = "/dist"; static properties read_props(char *name) @@ -74,7 +75,7 @@ mediaInitCDROM(Device *dev) { struct iso_args args; properties cd_attr = NULL; - char *cp = NULL, *mountpoint = "/dist"; + char *cp = NULL; Boolean readInfo = TRUE; static Boolean bogusCDOK = FALSE; @@ -82,7 +83,6 @@ mediaInitCDROM(Device *dev) return TRUE; Mkdir(mountpoint); - bzero(&args, sizeof(args)); args.fspec = dev->devname; args.flags = 0; @@ -143,7 +143,6 @@ mediaInitCDROM(Device *dev) bogusCDOK = TRUE; } } - msgDebug("Mounted FreeBSD CDROM from device %s\n", dev->devname); properties_free(cd_attr); return TRUE; } @@ -151,35 +150,17 @@ mediaInitCDROM(Device *dev) FILE * mediaGetCDROM(Device *dev, char *file, Boolean probe) { - char buf[PATH_MAX]; - - if (isDebug()) - msgDebug("Request for %s from CDROM\n", file); - snprintf(buf, PATH_MAX, "/dist/%s", file); - if (file_readable(buf)) - return fopen(buf, "r"); - snprintf(buf, PATH_MAX, "/dist/dists/%s", file); - if (file_readable(buf)) - return fopen(buf, "r"); - snprintf(buf, PATH_MAX, "/dist/%s/%s", variable_get(VAR_RELNAME), file); - if (file_readable(buf)) - return fopen(buf, "r"); - snprintf(buf, PATH_MAX, "/dist/%s/dists/%s", variable_get(VAR_RELNAME), file); - return fopen(buf, "r"); + return mediaGenericGet(mountpoint, file); } void mediaShutdownCDROM(Device *dev) { - char *mountpoint = "/dist"; - if (!cdromMounted) return; - msgDebug("Unmounting %s from %s\n", dev->devname, mountpoint); + if (unmount(mountpoint, MNT_FORCE) != 0) msgConfirm("Could not unmount the CDROM from %s: %s", mountpoint, strerror(errno)); - else { - msgDebug("Unmount of CDROM successful\n"); + else cdromMounted = FALSE; - } } |