changeset 22322:2df5fed90405

11917 loader: recognize apfs Reviewed by: Matthias Scheler <matthias.scheler@wdc.com> Reviewed by: Andrew Stormont <astormont@racktopsystems.com> Reviewed by: Sebastian Wiedenroth <sebastian.wiedenroth@skylime.net> Approved by: Robert Mustacchi <rm@fingolfin.org>
author Toomas Soome <tsoome@me.com>
date Mon, 04 Nov 2019 10:54:48 +0200
parents 2f2763ac2a14
children 8fd2c1bc54c0 8e9e2af79a5b
files usr/src/boot/sys/boot/common/part.c usr/src/boot/sys/boot/common/part.h usr/src/boot/sys/sys/gpt.h
diffstat 3 files changed, 12 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/boot/sys/boot/common/part.c	Sun Nov 03 16:28:18 2019 +0200
+++ b/usr/src/boot/sys/boot/common/part.c	Mon Nov 04 10:54:48 2019 +0200
@@ -64,6 +64,7 @@
 static const uuid_t gpt_uuid_illumos_ufs = GPT_ENT_TYPE_ILLUMOS_UFS;
 static const uuid_t gpt_uuid_illumos_zfs = GPT_ENT_TYPE_ILLUMOS_ZFS;
 static const uuid_t gpt_uuid_reserved = GPT_ENT_TYPE_RESERVED;
+static const uuid_t gpt_uuid_apple_apfs = GPT_ENT_TYPE_APPLE_APFS;
 #endif
 
 struct pentry {
@@ -114,7 +115,8 @@
 	{ PART_VTOC_USR,	"usr" },
 	{ PART_VTOC_STAND,	"stand" },
 	{ PART_VTOC_VAR,	"var" },
-	{ PART_VTOC_HOME,	"home" }
+	{ PART_VTOC_HOME,	"home" },
+	{ PART_APFS,		"APFS" }
 };
 
 const char *
@@ -168,6 +170,8 @@
 		return (PART_ILLUMOS_ZFS);
 	else if (uuid_equal(&type, &gpt_uuid_reserved, NULL))
 		return (PART_RESERVED);
+	else if (uuid_equal(&type, &gpt_uuid_apple_apfs, NULL))
+		return (PART_APFS);
 	return (PART_UNKNOWN);
 }
 
--- a/usr/src/boot/sys/boot/common/part.h	Sun Nov 03 16:28:18 2019 +0200
+++ b/usr/src/boot/sys/boot/common/part.h	Mon Nov 04 10:54:48 2019 +0200
@@ -64,7 +64,8 @@
 	PART_VTOC_BACKUP,
 	PART_VTOC_STAND,
 	PART_VTOC_VAR,
-	PART_VTOC_HOME
+	PART_VTOC_HOME,
+	PART_APFS
 };
 
 struct ptable_entry {
--- a/usr/src/boot/sys/sys/gpt.h	Sun Nov 03 16:28:18 2019 +0200
+++ b/usr/src/boot/sys/sys/gpt.h	Mon Nov 04 10:54:48 2019 +0200
@@ -1,4 +1,4 @@
-/*-
+/*
  * Copyright (c) 2002 Marcel Moolenaar
  * All rights reserved.
  *
@@ -22,8 +22,6 @@
  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * $FreeBSD$
  */
 
 #ifndef _SYS_GPT_H_
@@ -151,11 +149,13 @@
 #define	GPT_ENT_TYPE_APPLE_RAID_OFFLINE	\
 	{0x52414944,0x5f4f,0x11aa,0xaa,0x22,{0x00,0x30,0x65,0x43,0xec,0xac}}
 #define GPT_ENT_TYPE_APPLE_LABEL	\
-    	{0x4C616265,0x6c00,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
+	{0x4C616265,0x6c00,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
 #define	GPT_ENT_TYPE_APPLE_TV_RECOVERY	\
-    	{0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
+	{0x5265636f,0x7665,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
 #define	GPT_ENT_TYPE_APPLE_CORE_STORAGE	\
 	{0x53746f72,0x6167,0x11AA,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
+#define	GPT_ENT_TYPE_APPLE_APFS		\
+	{0x7C3457EF,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
 
 #define	GPT_ENT_TYPE_NETBSD_FFS		\
 	{0x49f48d5a,0xb10e,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}}