Skip to content

Commit 5812a10

Browse files
committed
Add a couple of GPT partition type GUIDs one might encounter when
fiddling around with RISC-V systems (Linux XBOOTLDR, SiFive BBL).
1 parent bafb17b commit 5812a10

3 files changed

Lines changed: 18 additions & 5 deletions

File tree

sbin/gpt/gpt_uuid.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: gpt_uuid.c,v 1.25 2025/02/23 20:47:19 christos Exp $ */
1+
/* $NetBSD: gpt_uuid.c,v 1.26 2025/10/11 18:55:31 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
3232

3333
#include <sys/cdefs.h>
3434
#ifdef __RCSID
35-
__RCSID("$NetBSD: gpt_uuid.c,v 1.25 2025/02/23 20:47:19 christos Exp $");
35+
__RCSID("$NetBSD: gpt_uuid.c,v 1.26 2025/10/11 18:55:31 thorpej Exp $");
3636
#endif
3737

3838
#include <err.h>
@@ -79,6 +79,7 @@ static const struct {
7979
{ GPT_ENT_TYPE_LINUX_RAID, "linux-raid", "Linux RAID" },
8080
{ GPT_ENT_TYPE_LINUX_SWAP, "linux-swap", "Linux swap" },
8181
{ GPT_ENT_TYPE_LINUX_LVM, "linux-lvm", "Linux LVM" },
82+
{ GPT_ENT_TYPE_LINUX_XBOOTLDR, "linux-xbootldr", "Linux XBOOTLDR" },
8283
{ GPT_ENT_TYPE_MS_BASIC_DATA, "windows", "Windows basic data" },
8384
{ GPT_ENT_TYPE_MS_RESERVED, "windows-reserved", "Windows reserved" },
8485
{ GPT_ENT_TYPE_MS_RECOVERY, "windows-recovery", "Windows recovery" },
@@ -93,6 +94,7 @@ static const struct {
9394
{ GPT_ENT_TYPE_VMWARE_VMKCORE, "vmcore", "VMware VMkernel core dump" },
9495
{ GPT_ENT_TYPE_VMWARE_VMFS, "vmfs", "VMware VMFS" },
9596
{ GPT_ENT_TYPE_VMWARE_RESERVED, "vmresered", "VMware reserved" },
97+
{ GPT_ENT_TYPE_SIFIVE_BBL, "sifive-bbl", "SiFive BBL" },
9698
};
9799

98100
static void

sbin/gpt/gpt_uuid.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: gpt_uuid.h,v 1.11 2024/08/19 17:15:38 christos Exp $ */
1+
/* $NetBSD: gpt_uuid.h,v 1.12 2025/10/11 18:55:31 thorpej Exp $ */
22

33
/*-
44
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -62,6 +62,7 @@ typedef enum {
6262
GPT_TYPE_LINUX_SWAP,
6363
GPT_TYPE_LINUX_RAID,
6464
GPT_TYPE_LINUX_LVM,
65+
GPT_TYPE_LINUX_XBOOTLDR,
6566
GPT_TYPE_MS_BASIC_DATA,
6667
GPT_TYPE_MS_RESERVED,
6768
GPT_TYPE_MS_RECOVERY,
@@ -74,7 +75,8 @@ typedef enum {
7475
GPT_TYPE_OPENBSD_DATA,
7576
GPT_TYPE_VMWARE_VMKCORE,
7677
GPT_TYPE_VMWARE_VMFS,
77-
GPT_TYPE_VMWARE_RESERVED
78+
GPT_TYPE_VMWARE_RESERVED,
79+
GPT_TYPE_SIFIVE_BBL
7880
} gpt_type_t;
7981

8082
typedef uint8_t gpt_uuid_t[16];

sys/sys/disklabel_gpt.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $NetBSD: disklabel_gpt.h,v 1.17 2024/08/19 17:16:02 christos Exp $ */
1+
/* $NetBSD: disklabel_gpt.h,v 1.18 2025/10/11 18:55:31 thorpej Exp $ */
22

33
/*
44
* Copyright (c) 2002 Marcel Moolenaar
@@ -170,6 +170,8 @@ struct gpt_ent {
170170
{0x0657fd6d,0xa4ab,0x43c4,0x84,0xe5,{0x09,0x33,0xc8,0x4b,0x4f,0x4f}}
171171
#define GPT_ENT_TYPE_LINUX_LVM \
172172
{0xe6d6d379,0xf507,0x44c2,0xa2,0x3c,{0x23,0x8f,0x2a,0x3d,0xf9,0x28}}
173+
#define GPT_ENT_TYPE_LINUX_XBOOTLDR \
174+
{0xbc13c2ff,0x59e6,0x4262,0xa3,0x52,{0xb2,0x75,0xfd,0x6f,0x71,0x72}}
173175

174176
#define GPT_ENT_TYPE_APPLE_HFS \
175177
{0x48465300,0x0000,0x11aa,0xaa,0x11,{0x00,0x30,0x65,0x43,0xec,0xac}}
@@ -192,4 +194,11 @@ struct gpt_ent {
192194
#define GPT_ENT_TYPE_VMWARE_RESERVED \
193195
{0x9198EFFC,0x31C0,0x11DB,0x8F,0x78,{0x00,0x0C,0x29,0x11,0xD1,0xB8}}
194196

197+
/*
198+
* Used by SiFive and StarFive RISC-V mask ROMs to find the boot
199+
* loader.
200+
*/
201+
#define GPT_ENT_TYPE_SIFIVE_BBL \
202+
{0x2e54b353,0x1271,0x4842,0x80,0x6f,{0xe4,0x36,0xd6,0xaf,0x69,0x85}}
203+
195204
#endif /* _SYS_DISKLABEL_GPT_H_ */

0 commit comments

Comments
 (0)