Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/ofppc/stand/ofwboot Fixed booting from disks withou...



details:   https://anonhg.NetBSD.org/src/rev/a0a073ba8731
branches:  trunk
changeset: 768581:a0a073ba8731
user:      phx <phx%NetBSD.org@localhost>
date:      Sun Aug 21 13:12:48 2011 +0000

description:
Fixed booting from disks without a valid disklabel (e.g. CDROM). This
became broken with my last changes in rev.1.18..

diffstat:

 sys/arch/ofppc/stand/ofwboot/ofdev.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (32 lines):

diff -r c7dbf390fee7 -r a0a073ba8731 sys/arch/ofppc/stand/ofwboot/ofdev.c
--- a/sys/arch/ofppc/stand/ofwboot/ofdev.c      Sun Aug 21 13:08:57 2011 +0000
+++ b/sys/arch/ofppc/stand/ofwboot/ofdev.c      Sun Aug 21 13:12:48 2011 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index