summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-11-04 10:54:48 +0200
committerToomas Soome <tsoome@me.com>2019-11-05 18:18:16 +0200
commit3423c61d20be9888e6633dfaeca21398c1f155cd (patch)
treeb12828d117a1c6b2caf395b26f3720e326e45e1e
parent777db87909d75c1cbc953f988d5d78a781d1fd39 (diff)
downloadillumos-joyent-3423c61d20be9888e6633dfaeca21398c1f155cd.tar.gz
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>
-rw-r--r--usr/src/boot/sys/boot/common/part.c6
-rw-r--r--usr/src/boot/sys/boot/common/part.h3
-rw-r--r--usr/src/boot/sys/sys/gpt.h10
3 files changed, 12 insertions, 7 deletions
diff --git a/usr/src/boot/sys/boot/common/part.c b/usr/src/boot/sys/boot/common/part.c
index fa3ec75e0f..23c3dce452 100644
--- a/usr/src/boot/sys/boot/common/part.c
+++ b/usr/src/boot/sys/boot/common/part.c
@@ -64,6 +64,7 @@ static const uuid_t gpt_uuid_illumos_boot = GPT_ENT_TYPE_ILLUMOS_BOOT;
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 @@ static struct parttypes {
{ 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 @@ gpt_parttype(uuid_t type)
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);
}
diff --git a/usr/src/boot/sys/boot/common/part.h b/usr/src/boot/sys/boot/common/part.h
index 2881c78b64..bed69c4484 100644
--- a/usr/src/boot/sys/boot/common/part.h
+++ b/usr/src/boot/sys/boot/common/part.h
@@ -64,7 +64,8 @@ enum partition_type {
PART_VTOC_BACKUP,
PART_VTOC_STAND,
PART_VTOC_VAR,
- PART_VTOC_HOME
+ PART_VTOC_HOME,
+ PART_APFS
};
struct ptable_entry {
diff --git a/usr/src/boot/sys/sys/gpt.h b/usr/src/boot/sys/sys/gpt.h
index b04d86312d..bb39876e35 100644
--- a/usr/src/boot/sys/sys/gpt.h
+++ b/usr/src/boot/sys/sys/gpt.h
@@ -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 @@ struct gpt_ent {
#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}}