Module Name: src
Committed By: phx
Date: Sun Aug 21 13:12:48 UTC 2011
Modified Files:
src/sys/arch/ofppc/stand/ofwboot: ofdev.c
Log Message:
Fixed booting from disks without a valid disklabel (e.g. CDROM). This
became broken with my last changes in rev.1.18..
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/ofppc/stand/ofwboot/ofdev.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/ofppc/stand/ofwboot/ofdev.c
diff -u src/sys/arch/ofppc/stand/ofwboot/ofdev.c:1.18 src/sys/arch/ofppc/stand/ofwboot/ofdev.c:1.19
--- src/sys/arch/ofppc/stand/ofwboot/ofdev.c:1.18 Thu Aug 18 09:03:28 2011
+++ src/sys/arch/ofppc/stand/ofwboot/ofdev.c Sun Aug 21 13:12:48 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: ofdev.c,v 1.18 2011/08/18 09:03:28 phx Exp $ */
+/* $NetBSD: ofdev.c,v 1.19 2011/08/21 13:12:48 phx Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -292,14 +292,15 @@
ofdev.partoff = 0;
} else if (error != 0)
goto bad;
-
- part = partition ? partition - 'a' : 0;
- ofdev.partoff = label.d_partitions[part].p_offset;
- if (label.d_partitions[part].p_fstype == FS_RAID) {
+ else {
+ part = partition ? partition - 'a' : 0;
+ ofdev.partoff = label.d_partitions[part].p_offset;
+ if (label.d_partitions[part].p_fstype == FS_RAID) {
#define RF_PROTECTED_SECTORS 64
- ofdev.partoff += RF_PROTECTED_SECTORS;
- DPRINTF("devopen: found RAID partition, "
- "adjusting offset to %lx\n", ofdev.partoff);
+ ofdev.partoff += RF_PROTECTED_SECTORS;
+ DPRINTF("devopen: found RAID partition, "
+ "adjusting offset to %lx\n", ofdev.partoff);
+ }
}
of->f_dev = devsw;
of->f_devdata = &ofdev;