Build a boot image for 16K kernel

This image can be used to switch the device to 16K kernel.

Test: th
Bug: 293313353
Change-Id: Iea3ad29e0b3789f0c499004f3f346ab3c460f39e
diff --git a/core/Makefile b/core/Makefile
index d24949c..ce0ecdc 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1096,6 +1096,16 @@
 kernel_16k: $(BUILT_KERNEL_16K_TARGET)
 .PHONY: kernel_16k
 
+BUILT_BOOTIMAGE_16K_TARGET := $(PRODUCT_OUT)/boot_16k.img
+
+$(BUILT_BOOTIMAGE_16K_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) $(INTERNAL_GKI_CERTIFICATE_DEPS)
+	$(call pretty,"Target boot 16k image: $@")
+	$(call build_boot_from_kernel_avb_enabled,$@,$(BUILT_KERNEL_16K_TARGET))
+
+
+bootimage_16k: $(BUILT_BOOTIMAGE_16K_TARGET)
+.PHONY: bootimage_16k
+
 endif
 
 
@@ -1292,9 +1302,10 @@
 
 ifeq (true,$(BOARD_AVB_ENABLE))
 
-# $1: boot image target
-define build_boot_board_avb_enabled
-  $(eval kernel := $(call bootimage-to-kernel,$(1)))
+# $1: output boot image target
+# $2: input path to kernel binary
+define build_boot_from_kernel_avb_enabled
+  $(eval kernel := $(2))
   $(MKBOOTIMG) --kernel $(kernel) $(INTERNAL_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $(1)
   $(if $(BOARD_GKI_SIGNING_KEY_PATH), \
     $(eval boot_signature := $(call intermediates-dir-for,PACKAGING,generic_boot)/$(notdir $(1)).boot_signature) \
@@ -1313,6 +1324,12 @@
           $(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
 endef
 
+# $1: boot image target
+define build_boot_board_avb_enabled
+  $(eval kernel := $(call bootimage-to-kernel,$(1)))
+  $(call build_boot_from_kernel_avb_enabled,$(1),$(kernel))
+endef
+
 $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(AVBTOOL) $(INTERNAL_BOOTIMAGE_FILES) $(BOARD_AVB_BOOT_KEY_PATH) $(INTERNAL_GKI_CERTIFICATE_DEPS)
 	$(call pretty,"Target boot image: $@")
 	$(call build_boot_board_avb_enabled,$@)