summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sysinstall
diff options
context:
space:
mode:
authorkensmith <kensmith@FreeBSD.org>2007-02-22 20:29:53 +0000
committerkensmith <kensmith@FreeBSD.org>2007-02-22 20:29:53 +0000
commit4c5d9596112b8e98a1d49c75442c54cadc4e225d (patch)
tree7d621e678a92b90d3d90241df5fff62b26013a1c /usr.sbin/sysinstall
parent57251e44a2976e99ca310dcf414873c4f763ddfa (diff)
downloadFreeBSD-src-4c5d9596112b8e98a1d49c75442c54cadc4e225d.zip
FreeBSD-src-4c5d9596112b8e98a1d49c75442c54cadc4e225d.tar.gz
If floppies are used to boot the machine, the user lets the machine
complete the boot and enter into sysinstall, and only then inserts a CD into the CDROM drive and tries to select that as the install media the first call to mount(2) generates EIO but the second call to mount(2) will succeed. This was 100% reproducible on 6.2-RELEASE, RELENG_6, and HEAD. If the user inserts the disc into the CDROM while the machine is booting off the floppies the first call to mount(2) succeeds with no problems. The problem was originally reported in PR #56952 against 5.1-CURRENT so it's been there for a while now. PR: bin/56952 MFC after: 2 weeks
Diffstat (limited to 'usr.sbin/sysinstall')
-rw-r--r--usr.sbin/sysinstall/cdrom.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/sysinstall/cdrom.c b/usr.sbin/sysinstall/cdrom.c
index 75151f4..7264c47 100644
--- a/usr.sbin/sysinstall/cdrom.c
+++ b/usr.sbin/sysinstall/cdrom.c
@@ -80,6 +80,7 @@ mediaInitCDROM(Device *dev)
char *cp = NULL;
Boolean readInfo = TRUE;
static Boolean bogusCDOK = FALSE;
+ int err;
if (cdromMounted)
return TRUE;
@@ -88,7 +89,11 @@ mediaInitCDROM(Device *dev)
bzero(&args, sizeof(args));
args.fspec = dev->devname;
args.flags = 0;
- if (mount("cd9660", mountpoint, MNT_RDONLY, (caddr_t) &args) == -1) {
+ err = mount("cd9660", mountpoint, MNT_RDONLY, (caddr_t) &args);
+ /* If disc inserted too recently first access generates EIO, try again */
+ if (err == -1 && errno == EIO)
+ err = mount("cd9660", mountpoint, MNT_RDONLY, (caddr_t) &args);
+ if (err == -1) {
if (errno == EINVAL) {
msgConfirm("The disc in your drive looks more like an Audio disc than a FreeBSD release.");
return FALSE;
OpenPOWER on IntegriCloud