]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
efi_loader: fix building with CONFIG_EFI_VARIABLES_PRESEED=y
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 24 Jun 2026 05:48:19 +0000 (07:48 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Wed, 15 Jul 2026 22:40:42 +0000 (00:40 +0200)
Since commit bd3f9ee679b4 ("kbuild: Bump the build system to 6.1")
out-of-tree builds with CONFIG_EFI_VARIABLES_PRESEED=y fail with errors
like:

    ../lib/efi_loader/efi_var_seed.S:14: Error: file not found:
    ubootefi.var

For out-of-tree build we cannot use CONFIG_EFI_VAR_SEED_FILE in the
.incbin statement of file efi_var_seed.S.

* We have to prepend $(srctree) if the path is relative.
* We must not prepend $(srctree) if the path is absolute.

Fixes: bd3f9ee679b4 ("kbuild: Bump the build system to 6.1")
Reported-by: Jon Mason <jon.mason@arm.com>
Closes: https://lore.kernel.org/u-boot/CAPoiz9zg4OXgHo5J3WtJHKOEuWOdCDrugWfAt6Z+d71j=+q8oA@mail.gmail.com/T/#mffaca10a9e812d03eceafad59999a02e57258b9a
Tested-by: Nora Schiffer <nora.schiffer@ew.tq-group.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Tested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
lib/efi_loader/Makefile
lib/efi_loader/efi_var_seed.S

index d73ad43951b1d4367082efdf180d0a048f8edc24..567db518a8fbe8688184abf27e09e938ae8a6e52 100644 (file)
@@ -74,8 +74,11 @@ obj-$(CONFIG_EFI_SIGNATURE_SUPPORT) += efi_signature.o
 obj-$(CONFIG_EFI_ECPT) += efi_conformance.o
 obj-$(CONFIG_EFI_DEBUG_SUPPORT) += efi_debug_support.o
 
-EFI_VAR_SEED_FILE := $(subst $\",,$(CONFIG_EFI_VAR_SEED_FILE))
-$(obj)/efi_var_seed.o: $(srctree)/$(EFI_VAR_SEED_FILE)
+TMP_VAR_SEED := $(subst $\",,$(CONFIG_EFI_VAR_SEED_FILE))
+EFI_VAR_SEED_FILE := $(if $(filter /% ,$(TMP_VAR_SEED)) \
+  ,$(TMP_VAR_SEED),$(srctree)/$(TMP_VAR_SEED))
+AFLAGS_efi_var_seed.o := -DEFI_VAR_SEED_FILE=\"$(EFI_VAR_SEED_FILE)\"
+$(obj)/efi_var_seed.o: $(EFI_VAR_SEED_FILE)
 
 ifeq ($(CONFIG_EFI_CAPSULE_AUTHENTICATE),y)
 capsule_crt_path=($(subst $(quote),,$(CONFIG_EFI_CAPSULE_CRT_FILE)))
index e0a40cf46c8d2bc5854ad7f43aaf117a310c62de..008a505d19ef47866526d8d0bd53fc7b22cc124c 100644 (file)
@@ -5,13 +5,11 @@
  * Copyright (c) 2020, Heinrich Schuchardt <xypron.glpk@gmx.de>
  */
 
-#include <config.h>
-
 .section .rodata.efi_seed.init,"a"
 .balign 16
 .global __efi_var_file_begin
 __efi_var_file_begin:
-.incbin CONFIG_EFI_VAR_SEED_FILE
+.incbin EFI_VAR_SEED_FILE
 .global __efi_var_file_end
 __efi_var_file_end:
 .balign 16