aboutsummaryrefslogtreecommitdiff
path: root/sys/geom
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2010-06-07 20:31:55 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2010-06-07 20:31:55 +0000
commit00e4466ce9487b33c6121c8a56b0c23a0389aa7c (patch)
tree7404dd011325284e06c404339547d7d8aaa2f27b /sys/geom
parent40a7bbabd99d06c5243d239deafa5a30eb3891b7 (diff)
downloadsrc-00e4466ce9487b33c6121c8a56b0c23a0389aa7c.tar.gz
src-00e4466ce9487b33c6121c8a56b0c23a0389aa7c.zip
MFC r197608:
The first 96 bytes may not be zeroes. It can contain trivial boot code that merely emits an error and waits for a key press before rebooting. The error being that extended partitions are not bootable. The origin is presumed to be Windows 2000; Windows XP does not do this... For now, ignore the first 96 bytes when checking that the EBR is (for the most part) all zeroes. Tested by: Mario Lobo <mlobo at digiart.art.br> Dieter <dieterbsd at engineer.com> PR: kern/141235 Reviewed by: marcel Approved by: kib (mentor) Approved by: re (bz)
Notes
Notes: svn path=/stable/8/; revision=208899
Diffstat (limited to 'sys/geom')
-rw-r--r--sys/geom/part/g_part_ebr.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/geom/part/g_part_ebr.c b/sys/geom/part/g_part_ebr.c
index ab04866cfd20..b107e6120c07 100644
--- a/sys/geom/part/g_part_ebr.c
+++ b/sys/geom/part/g_part_ebr.c
@@ -410,13 +410,13 @@ g_part_ebr_probe(struct g_part_table *table, struct g_consumer *cp)
goto out;
/*
- * The sector is all zeroes, except for the partition entries
- * and some signatures or disk serial number. Those can be
- * found in the 9 bytes immediately in front of the partition
- * table.
+ * The sector is all zeroes, except for the partition entries,
+ * pseudo boot code and some signatures or disk serial number.
+ * The latter can be found in the 9 bytes immediately in front
+ * of the partition table.
*/
sum = 0;
- for (index = 0; index < DOSPARTOFF - 9; index++)
+ for (index = 96; index < DOSPARTOFF - 9; index++)
sum += buf[index];
if (sum != 0)
goto out;