git: e1c95a0233c6 - stable/13 - bi_load: only add MODULEP on arches that have it defined

From: Warner Losh <imp_at_FreeBSD.org>
Date: Tue, 24 Jan 2023 22:09:42 UTC
The branch stable/13 has been updated by imp:

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

commit e1c95a0233c646db795a98638093525392fc9b9b
Author:     Roger Pau Monné <royger@FreeBSD.org>
AuthorDate: 2021-02-16 15:06:14 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2023-01-24 21:49:16 +0000

    bi_load: only add MODULEP on arches that have it defined
    
    Do not attempt to add MODINFOMD_MODULEP to the kernel medatada on
    arches that don't have it defined.
    
    This fixes the build for arches different than amd64 after
    7d3259775cb69f250df3e7fe51d6fff2283c6f20.
    
    Sponsored by:   Citrix Systems R&D
    Reported by:    lwhsu, arichardson
    
    (cherry picked from commit 97527e9c4fd37140da3129bc12003172edbf7a23)
---
 stand/efi/loader/bootinfo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/stand/efi/loader/bootinfo.c b/stand/efi/loader/bootinfo.c
index 74be4f8f5d74..046d56a2b4fb 100644
--- a/stand/efi/loader/bootinfo.c
+++ b/stand/efi/loader/bootinfo.c
@@ -533,7 +533,9 @@ bi_load(char *args, vm_offset_t *modulep, vm_offset_t *kernendp, bool exit_bs)
 		    "device tree blob found!\n");
 #endif
 	file_addmetadata(kfp, MODINFOMD_KERNEND, sizeof(kernend), &kernend);
+#ifdef MODINFOMD_MODULEP
 	file_addmetadata(kfp, MODINFOMD_MODULEP, sizeof(module), &module);
+#endif
 	file_addmetadata(kfp, MODINFOMD_FW_HANDLE, sizeof(ST), &ST);
 #ifdef LOADER_GELI_SUPPORT
 	geli_export_key_metadata(kfp);