Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/stand/lib While the old gpt.S mbr code looks a...



details:   https://anonhg.NetBSD.org/src/rev/67533834e7b9
branches:  trunk
changeset: 335651:67533834e7b9
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sun Jan 18 20:18:07 2015 +0000

description:
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 ee4300a34c33 -r 67533834e7b9 sys/arch/i386/stand/lib/biosdisk.c
--- a/sys/arch/i386/stand/lib/biosdisk.c        Sun Jan 18 19:09:54 2015 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.c        Sun Jan 18 20:18:07 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.44 2015/01/18 20:18:07 jakllsch 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