git: 49233a1fce02 - stable/15 - mkimg: Add ms-basic-data alias for GPT

Jose Luis Duran <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a66d42e.1d6af.3f259285__6003.17634395964$1785123912$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=49233a1fce025a32cbe790d4c0091b68292d30a6

commit 49233a1fce025a32cbe790d4c0091b68292d30a6
Author:     Jose Luis Duran <[email protected]>
AuthorDate: 2026-07-13 12:25:30 +0000
Commit:     Jose Luis Duran <[email protected]>
CommitDate: 2026-07-27 03:41:27 +0000

    mkimg: Add ms-basic-data alias for GPT
    
    While preparing GPT-schemed RaspberryPi images for the NanoBSD
    Reimagined GSoC 2026 project, a discrepancy was identified between
    mkimg(1) and gpart(8) regarding Microsoft Basic Data partitions (GUID
    !ebd0a0a2-b9e5-4433-87c0-68b6b72699c7).
    
    Currently, mkimg(1) relies on the MBR-centric name "ntfs" to identify
    this partition type under the GPT scheme.  Conversely, gpart(8)
    identifies this type as "ms-basic-data".
    
    To allow automation scripts (such as those consuming from gpart backup)
    to use a common partition type across tools, add ALIAS_MS_BASIC_DATA as
    a valid alias.
    
    This is part of a larger effort to avoid a custom, MBR-based image
    generation logic for embedded SoCs like the Raspberry Pi, standardizing
    on GPT layouts across all supported FreeBSD embedded devices.
    
    Reviewed by:    imp
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D58198
    
    (cherry picked from commit 67f1c082b5ec37e2060b74e6f1f952ed38761468)
---
 usr.bin/mkimg/gpt.c    | 1 +
 usr.bin/mkimg/scheme.c | 1 +
 usr.bin/mkimg/scheme.h | 1 +
 3 files changed, 3 insertions(+)

diff --git a/usr.bin/mkimg/gpt.c b/usr.bin/mkimg/gpt.c
index 4471cfa1d4b4..9b5392cb2e2c 100644
--- a/usr.bin/mkimg/gpt.c
+++ b/usr.bin/mkimg/gpt.c
@@ -66,6 +66,7 @@ static struct mkimg_alias gpt_aliases[] = {
     {	ALIAS_FREEBSD_VINUM, ALIAS_PTR2TYPE(&gpt_uuid_freebsd_vinum) },
     {	ALIAS_FREEBSD_ZFS, ALIAS_PTR2TYPE(&gpt_uuid_freebsd_zfs) },
     {	ALIAS_MBR, ALIAS_PTR2TYPE(&gpt_uuid_mbr) },
+    {	ALIAS_MS_BASIC_DATA, ALIAS_PTR2TYPE(&gpt_uuid_ms_basic_data) },
     {	ALIAS_NTFS, ALIAS_PTR2TYPE(&gpt_uuid_ms_basic_data) },
     {	ALIAS_PPCBOOT, ALIAS_PTR2TYPE(&gpt_uuid_prep_boot) },
     {	ALIAS_HIFIVE_BBL, ALIAS_PTR2TYPE(&gpt_uuid_hifive_bbl) },
diff --git a/usr.bin/mkimg/scheme.c b/usr.bin/mkimg/scheme.c
index b64cfe8bd007..fe71c6f5a3a2 100644
--- a/usr.bin/mkimg/scheme.c
+++ b/usr.bin/mkimg/scheme.c
@@ -56,6 +56,7 @@ static struct {
 	{ "freebsd-vinum", ALIAS_FREEBSD_VINUM },
 	{ "freebsd-zfs", ALIAS_FREEBSD_ZFS },
 	{ "mbr", ALIAS_MBR },
+	{ "ms-basic-data", ALIAS_MS_BASIC_DATA },
 	{ "ntfs", ALIAS_NTFS },
 	{ "prepboot", ALIAS_PPCBOOT },
 	{ "hifive-bbl", ALIAS_HIFIVE_BBL },
diff --git a/usr.bin/mkimg/scheme.h b/usr.bin/mkimg/scheme.h
index 7a5e09036ee3..8baad49fe1e0 100644
--- a/usr.bin/mkimg/scheme.h
+++ b/usr.bin/mkimg/scheme.h
@@ -45,6 +45,7 @@ enum alias {
 	ALIAS_FREEBSD_VINUM,
 	ALIAS_FREEBSD_ZFS,
 	ALIAS_MBR,
+	ALIAS_MS_BASIC_DATA,
 	ALIAS_NTFS,
 	ALIAS_PPCBOOT,
 	ALIAS_HIFIVE_BBL,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.