Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/arch/i386/stand/lib Pull up following revision(s) (re...



details:   https://anonhg.NetBSD.org/src/rev/f655dbda6d04
branches:  netbsd-7
changeset: 798866:f655dbda6d04
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Jan 20 09:45:20 2015 +0000

description:
Pull up following revision(s) (requested by jakllsch in ticket #436):
        sys/arch/i386/stand/lib/biosdisk.c: revision 1.44
While the old gpt.S mbr code looks at both primary and alternate GPT
partition tables, mbrgpt.S and DKWEDGE_METHOD_GPT only look in the
primary.  Align the bootxx/boot2 biosdisk code with this so as to avoid
situations where the disk becomes unbootable when it has an undestroyed
secondary GPT.

diffstat:

 sys/arch/i386/stand/lib/biosdisk.c |  14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diffs (35 lines):

diff -r e1b1c8570c0d -r f655dbda6d04 sys/arch/i386/stand/lib/biosdisk.c
--- a/sys/arch/i386/stand/lib/biosdisk.c        Tue Jan 20 09:42:31 2015 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.c        Tue Jan 20 09:45:20 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk.c,v 1.43 2013/10/31 20:31:04 christos Exp $   */
+/*     $NetBSD: biosdisk.c,v 1.43.4.1 2015/01/20 09:45:20 martin Exp $ */
 
 /*
  * Copyright (c) 1996, 1998
@@ -330,9 +330,6 @@
                gptsector[1] = d->ll.chs_sectors - 1;
        }
 
-       /*
-        * Use any valid GPT available, do not require both GPTs to be valid
-        */
        for (i = 0; i < __arraycount(gptsector); i++) {
                error = check_gpt(d, gptsector[i]);
                if (error == 0)
@@ -344,6 +341,15 @@
                return -1;
        }
 
+#ifndef USE_SECONDARY_GPT
+       if (i > 0) {
+#ifdef DISK_DEBUG
+               printf("ignoring valid secondary GPT\n");
+#endif
+               return -1;
+       }
+#endif
+
 #ifdef DISK_DEBUG
        printf("using %s GPT\n", (i == 0) ? "primary" : "secondary");
 #endif



Home | Main Index | Thread Index | Old Index