]> xenbits.xensource.com Git - unikraft/unikraft.git/commitdiff
plat/common: Generate an arm64 linux image when LXBOOT is enabled
authorMichalis Pappas <michalis@unikraft.io>
Thu, 10 Aug 2023 09:10:52 +0000 (11:10 +0200)
committerUnikraft <monkey@unikraft.io>
Fri, 11 Aug 2023 19:49:38 +0000 (19:49 +0000)
Update Linker.uk to generate a raw binary image prepended with the
arm64 linux boot header when LXBOOT is enabled on arm64.

Signed-off-by: Michalis Pappas <michalis@unikraft.io>
Reviewed-by: Sergiu Moga <sergiu@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #988

plat/common/Makefile.rules
plat/kvm/Linker.uk

index 2eda112ceb279c13adc76019845728430669012f..f89fdeae06dd7e768c2e8ad4a43f8557ffd29800 100644 (file)
@@ -17,3 +17,8 @@ endef
 define build_efi =
        @$(SCRIPTS_DIR)/mkefi.py $(1)
 endef
+
+define build_linux =
+       $(call build_cmd,OBJCOPY,,$(1).bin, $(OBJCOPY) -O binary $(1))
+       $(call build_cmd,MKLINUX,,$(1).img, $(SCRIPTS_DIR)/mklinux.py $(1) $(2))
+endef
index 97c2413c49a8eee35b98a212e2f4b91c01b8cee9..1ce85ee39c13c36665b1e98a372e991fdbc875b2 100644 (file)
@@ -10,6 +10,9 @@ KVM_LDFLAGS-y += -Wl,--entry=uk_efi_entry64
 KVM_LDFLAGS-y += -Wl,-m,elf_x86_64
 endif
 else ifeq (arm64,$(CONFIG_UK_ARCH))
+ifeq ($(CONFIG_KVM_BOOT_PROTO_LXBOOT),y)
+LINUX_HDR_ARM64 := y
+endif
 ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
 KVM_LDFLAGS-y += -Wl,--entry=uk_efi_entry64
 KVM_LDFLAGS-y += -Wl,-m,aarch64elf
@@ -77,6 +80,9 @@ endif
 ifeq ($(CONFIG_KVM_BOOT_PROTO_EFI_STUB),y)
        $(call build_efi,$@)
 endif
+ifeq ($(LINUX_HDR_ARM64),y)
+       $(call build_linux,$@,$<)
+endif
 
 $(KVM_IMAGE).sym: $(KVM_DEBUG_IMAGE)
        $(call build_cmd,NM,,$@, $(NM) -n $< > $@)