Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 10 Feb 2013 19:27:17 +0000 (UTC)
From:      "Andrey V. Elsukov" <ae@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r246630 - in head/sys: boot/common sys
Message-ID:  <201302101927.r1AJRHbF081078@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ae
Date: Sun Feb 10 19:27:17 2013
New Revision: 246630
URL: http://svnweb.freebsd.org/changeset/base/246630

Log:
  Add bootcamp support to the loader.
  
  Tested by:	dchagin
  MFC after:	1 week

Modified:
  head/sys/boot/common/part.c
  head/sys/sys/diskmbr.h

Modified: head/sys/boot/common/part.c
==============================================================================
--- head/sys/boot/common/part.c	Sun Feb 10 19:21:17 2013	(r246629)
+++ head/sys/boot/common/part.c	Sun Feb 10 19:27:17 2013	(r246630)
@@ -645,9 +645,13 @@ ptable_open(void *dev, off_t sectors, ui
 	/* Do we have some invalid values? */
 	if (i != NDOSPART ||
 	    (table->type == PTABLE_GPT && count > 1)) {
-		table->type = PTABLE_NONE;
-		DEBUG("invalid values detected, ignore partition table");
-		goto out;
+		if (dp[1].dp_typ != DOSPTYP_HFS) {
+			table->type = PTABLE_NONE;
+			DEBUG("invalid values detected, ignore "
+			    "partition table");
+			goto out;
+		}
+		DEBUG("Bootcamp detected");
 	}
 #ifdef LOADER_GPT_SUPPORT
 	if (table->type == PTABLE_GPT) {

Modified: head/sys/sys/diskmbr.h
==============================================================================
--- head/sys/sys/diskmbr.h	Sun Feb 10 19:21:17 2013	(r246629)
+++ head/sys/sys/diskmbr.h	Sun Feb 10 19:27:17 2013	(r246630)
@@ -51,6 +51,7 @@
 #define	DOSPTYP_PPCBOOT	0x41	/* PReP/CHRP boot partition */
 #define	DOSPTYP_LDM	0x42	/* Win2k dynamic extended partition */
 #define	DOSPTYP_386BSD	0xa5	/* 386BSD partition type */
+#define	DOSPTYP_HFS	0xaf	/* HFS/HFS+ partition type */
 #define	DOSPTYP_LINSWP	0x82	/* Linux swap partition */
 #define	DOSPTYP_LINUX	0x83	/* Linux partition */
 #define	DOSPTYP_LINLVM	0x8e	/* Linux LVM partition */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302101927.r1AJRHbF081078>