@@ -162,6 +162,11 @@ Image: vmlinux
Image.%: Image
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
+ifneq ($(CONFIG_EFI_ZBOOT),)
+zImage.efi: Image
+ $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
+endif
+
install: KBUILD_IMAGE := $(boot)/Image
install zinstall:
$(call cmd,install)
@@ -38,3 +38,15 @@ $(obj)/Image.lzo: $(obj)/Image FORCE
$(obj)/Image.zst: $(obj)/Image FORCE
$(call if_changed,zstd)
+
+ZBOOT_PAYLOAD := $(obj)/Image
+ZBOOT_BFD_TARGET := elf64-littleaarch64
+ZBOOT_LD_FLAGS := --defsym=__efistub_strnlen=__pi_strnlen \
+ --defsym=__efistub_memmove=__pi_memmove \
+ --defsym=__efistub_memcpy=__pi_memcpy \
+ --defsym=__efistub_memset=__pi_memset
+
+ZBOOT_EXTRA_OBJS := memcpy.o memset.o strnlen.o
+ZBOOT_EXTRA_DEPS := $(addprefix $(objtree)/arch/arm64/lib/,$(ZBOOT_EXTRA_OBJS))
+
+include $(srctree)/drivers/firmware/efi/libstub/Makefile.zboot
Wire up the generic EFI zboot support for arm64. Signed-off-by: Ard Biesheuvel <ardb@kernel.org> --- arch/arm64/Makefile | 5 +++++ arch/arm64/boot/Makefile | 12 ++++++++++++ 2 files changed, 17 insertions(+)