diff mbox series

[v2,5/6] arm64: efi: enable generic EFI compressed boot

Message ID 20220809080944.1119654-6-ardb@kernel.org
State New
Headers show
Series efi: implement generic compressed boot support | expand

Commit Message

Ard Biesheuvel Aug. 9, 2022, 8:09 a.m. UTC
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(+)
diff mbox series

Patch

diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile
index 6d9d4a58b898..ad4f849b91e8 100644
--- a/arch/arm64/Makefile
+++ b/arch/arm64/Makefile
@@ -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)
diff --git a/arch/arm64/boot/Makefile b/arch/arm64/boot/Makefile
index a0e3dedd2883..08fcd39ae808 100644
--- a/arch/arm64/boot/Makefile
+++ b/arch/arm64/boot/Makefile
@@ -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