From owner-p4-projects Sun May 26 20:15:45 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id AEE9437B404; Sun, 26 May 2002 20:15:40 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id EF9E037B403 for ; Sun, 26 May 2002 20:15:39 -0700 (PDT) Received: (from perforce@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g4R3Fdd02740 for perforce@freebsd.org; Sun, 26 May 2002 20:15:39 -0700 (PDT) (envelope-from marcel@freebsd.org) Date: Sun, 26 May 2002 20:15:39 -0700 (PDT) Message-Id: <200205270315.g4R3Fdd02740@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: perforce set sender to marcel@freebsd.org using -f From: Marcel Moolenaar Subject: PERFORCE change 11950 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG http://people.freebsd.org/~peter/p4db/chv.cgi?CH=11950 Change 11950 by marcel@marcel_vaio on 2002/05/26 20:15:26 Back-off when when the second sector contains the GPT signature. This is a short-term hack to allow both a valid MBR and a valid GPT to coexist. We're booting GPT partitions now! Affected files ... ... //depot/projects/ia64/sys/geom/geom_mbr.c#7 edit Differences ... ==== //depot/projects/ia64/sys/geom/geom_mbr.c#7 (text+ko) ==== @@ -61,6 +61,8 @@ #define MBR_CLASS_NAME "MBR" #define MBREXT_CLASS_NAME "MBREXT" +#define GPT_HACK 1 + static void g_dec_dos_partition(u_char *ptr, struct dos_partition *d) { @@ -197,13 +199,27 @@ if (!error && sectorsize != 512) break; gsp->frontstuff = sectorsize * fwsectors; - buf = g_read_data(cp, 0, sectorsize, &error); +#if GPT_HACK + /* + * XXX: GPT hack: Read the second sector as well and back-off + * if it has the GPT signature. + */ + buf = g_read_data(cp, 0, 2 * sectorsize, &error); +#else + buf = g_read_data(cp, 0, 2 * sectorsize, &error); +#endif if (buf == NULL || error != 0) break; if (buf[0x1fe] != 0x55 && buf[0x1ff] != 0xaa) { g_free(buf); break; } +#if GPT_HACK + if (!memcmp(buf + 512, "EFI PART", 8)) { + g_free(buf); + break; + } +#endif for (i = 0; i < NDOSPART; i++) g_dec_dos_partition( buf + DOSPARTOFF + i * sizeof(struct dos_partition), To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message