Module Name: src
Committed By: martin
Date: Tue Jan 20 09:45:20 UTC 2015
Modified Files:
src/sys/arch/i386/stand/lib [netbsd-7]: biosdisk.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.4.1 src/sys/arch/i386/stand/lib/biosdisk.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/i386/stand/lib/biosdisk.c
diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.43 src/sys/arch/i386/stand/lib/biosdisk.c:1.43.4.1
--- src/sys/arch/i386/stand/lib/biosdisk.c:1.43 Thu Oct 31 20:31:04 2013
+++ src/sys/arch/i386/stand/lib/biosdisk.c Tue Jan 20 09:45:20 2015
@@ -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 @@ read_gpt(struct biosdisk *d)
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 @@ read_gpt(struct biosdisk *d)
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