From 00e4466ce9487b33c6121c8a56b0c23a0389aa7c Mon Sep 17 00:00:00 2001 From: "Andrey V. Elsukov" Date: Mon, 7 Jun 2010 20:31:55 +0000 Subject: 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 Dieter PR: kern/141235 Reviewed by: marcel Approved by: kib (mentor) Approved by: re (bz) --- sys/geom/part/g_part_ebr.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/geom') 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; -- cgit v1.2.3