Fix boot failure from installation floppies. PR port-macppc/53103

Also bump version to denote a visible fix.
Should be pulled up to netbsd-8 and netbsd-7.
This commit is contained in:
tsutsui 2018-11-16 14:58:54 +00:00
parent dd276a2ec2
commit 730f9ec0e6
2 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofdev.c,v 1.26 2012/02/19 12:02:55 tsutsui Exp $ */
/* $NetBSD: ofdev.c,v 1.27 2018/11/16 14:58:54 tsutsui Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -437,10 +437,11 @@ devopen(struct open_file *of, const char *name, char **file)
ofdev.type = OFDEV_DISK;
ofdev.bsize = DEV_BSIZE;
/* First try to find a disklabel without partitions */
if (strategy(&ofdev, F_READ,
LABELSECTOR, DEV_BSIZE, buf, &nread) != 0
|| nread != DEV_BSIZE
|| getdisklabel(buf, &label)) {
if (!floppyboot &&
(strategy(&ofdev, F_READ,
LABELSECTOR, DEV_BSIZE, buf, &nread) != 0
|| nread != DEV_BSIZE
|| getdisklabel(buf, &label))) {
/* Else try APM or MBR partitions */
struct drvr_map *map = (struct drvr_map *)buf;

View File

@ -1,4 +1,4 @@
$NetBSD: version,v 1.13 2010/10/17 15:33:04 phx Exp $
$NetBSD: version,v 1.14 2018/11/16 14:58:54 tsutsui Exp $
1.1: Initial revision from NetBSD/powerpc.
1.2: Use MI loadfile().
@ -14,3 +14,4 @@ $NetBSD: version,v 1.13 2010/10/17 15:33:04 phx Exp $
1.11: Check floppyboot and disable LOAD_NOTE to avoid backward seek.
1.12: Read Apple Partition Map to find the root partition, when
no OF path was specified.
1.13: Fix boot failure of installation floppies