@@ -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: install-image := Image
zinstall: install-image := Image.gz
install zinstall:
@@ -16,7 +16,7 @@
OBJCOPYFLAGS_Image :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
-targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo
+targets := Image Image.bz2 Image.gz Image.lz4 Image.lzma Image.lzo zImage.efi
$(obj)/Image: vmlinux FORCE
$(call if_changed,objcopy)
@@ -35,3 +35,18 @@ $(obj)/Image.lzma: $(obj)/Image FORCE
$(obj)/Image.lzo: $(obj)/Image FORCE
$(call if_changed,lzo)
+
+OBJCOPYFLAGS_Image.gz.o := -O elf64-littleaarch64 -I binary \
+ --rename-section .data=.gzdata,load,alloc,readonly,contents
+$(obj)/Image.gz.o: $(obj)/Image.gz FORCE
+ $(call if_changed,objcopy)
+
+ZBOOT_DEPS := memcpy.o memset.o strnlen.o
+$(obj)/zImage.efi.elf: $(obj)/Image.gz.o $(addprefix $(objtree)/arch/arm64/lib/,$(ZBOOT_DEPS))
+ $(Q)$(LD) -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds \
+ -o $@ $^ $(objtree)/drivers/firmware/efi/libstub/lib.a \
+ --defsym=pe_machine_type=0xaa64
+
+$(obj)/zImage.efi: OBJCOPYFLAGS := -O binary
+$(obj)/zImage.efi: $(obj)/zImage.efi.elf FORCE
+ $(call if_changed,objcopy)
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 | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-)