git: 67f1c082b5ec - main - mkimg: Add ms-basic-data alias for GPT

From: Jose Luis Duran <jlduran_at_FreeBSD.org>
Date: Mon, 13 Jul 2026 12:26:36 UTC
The branch main has been updated by jlduran:

URL: https://cgit.FreeBSD.org/src/commit/?id=67f1c082b5ec37e2060b74e6f1f952ed38761468

commit 67f1c082b5ec37e2060b74e6f1f952ed38761468
Author:     Jose Luis Duran <jlduran@FreeBSD.org>
AuthorDate: 2026-07-13 12:25:30 +0000
Commit:     Jose Luis Duran <jlduran@FreeBSD.org>
CommitDate: 2026-07-13 12:25:30 +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
---
 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,