git: 4f7475ab5b3f - main - loader: Small tweak to how md is configured

From: Warner Losh <imp_at_FreeBSD.org>
Date: Fri, 11 Sep 2026 05:04:16 UTC
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=4f7475ab5b3f78300b5357a3ee53cd09e03efb7c

commit 4f7475ab5b3f78300b5357a3ee53cd09e03efb7c
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2026-09-11 04:13:01 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2026-09-11 04:15:27 +0000

    loader: Small tweak to how md is configured
    
    Only the EFI loader supports the md devices (as the moment). Create
    LOADER_MD_SUPPORT and only try to compile md when that's true. For the
    moment, also allow it when only MD_IMAGE_SIZE is defined, but that
    will be dropped since LOADER_MD_SUPPORT is a superset.
    
    Sponsored by:           Netflix
    Reviewed by:            tsoome
    Differential Revision:  https://reviews.freebsd.org/D59416
---
 stand/efi/loader/Makefile | 1 +
 stand/loader.mk           | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/stand/efi/loader/Makefile b/stand/efi/loader/Makefile
index d423062dc132..f4ee1846a6f3 100644
--- a/stand/efi/loader/Makefile
+++ b/stand/efi/loader/Makefile
@@ -6,6 +6,7 @@ LOADER_EXT2FS_SUPPORT?=	no
 LOADER_GZ_SUPPORT?=     yes
 LOADER_BZIP2_SUPPORT?=  yes
 LOADER_XZ_SUPPORT?=     yes
+LOADER_MD_SUPPORT?=	yes
 
 .include <bsd.init.mk>
 
diff --git a/stand/loader.mk b/stand/loader.mk
index 0ff5bd144d93..7ef25586f77a 100644
--- a/stand/loader.mk
+++ b/stand/loader.mk
@@ -48,6 +48,7 @@ SRCS+=	metadata.c
 # LOADER_GZIP_SUPPORT	Add support for gzip compressed files
 # LOADER_INSTALL_SUPPORT Add support for booting off of installl ISOs
 # LOADER_MBR_SUPPORT	Add support for MBR partitions
+# LOADER_MD_SUPPORT	Add support for Memory disks
 # LOADER_MSDOS_SUPPORT	Add support for FAT filesystems
 # LOADER_NET_SUPPORT	Adds networking support (useless w/o net drivers sometimes)
 # LOADER_NFS_SUPPORT	Add NFS support
@@ -70,10 +71,12 @@ SRCS+= dev_net.c
 SRCS+=  bcache.c
 .endif
 
+.if ${LOADER_MD_SUPPORT:Uno} == "yes"
 .if defined(MD_IMAGE_SIZE)
 CFLAGS+= -DMD_IMAGE_SIZE=${MD_IMAGE_SIZE}
+.endif
+CFLAGS+= -DLOADER_MD_SUPPORT
 SRCS+=	md.c
-.else
 CLEANFILES+=	md.o
 .endif