Add support for separate kernels for boot and recovery [2/2]

* Either as prebuilts, or with separate defconfigs

Change-Id: Iae31e3634178e66b4119c718994fe1c660414529
This commit is contained in:
marcost2 2021-07-06 13:03:14 -03:00 committed by Bartłomiej Rudecki
parent ef7318daaf
commit 453fe9d9a0
Signed by: przekichane
GPG key ID: 751F23C6F014EF76

View file

@ -1021,6 +1021,17 @@ else
INSTALLED_KERNEL_TARGET := INSTALLED_KERNEL_TARGET :=
endif endif
ifdef INSTALLED_KERNEL_TARGET
ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))
INSTALLED_RECOVERY_KERNEL_TARGET := $(INSTALLED_KERNEL_TARGET)
else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE))
ifneq "$(or $(TARGET_KERNEL_RECOVERY_CONFIG), $(TARGET_PREBUILT_RECOVERY_KERNEL))" ""
INSTALLED_RECOVERY_KERNEL_TARGET := $(PRODUCT_OUT)/recovery_kernel
else
INSTALLED_RECOVERY_KERNEL_TARGET := $(firstword $(INSTALLED_KERNEL_TARGET))
endif
endif
endif
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# the root dir # the root dir
INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_ROOT_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES)) INSTALLED_FILES_OUTSIDE_IMAGES := $(filter-out $(TARGET_ROOT_OUT)/%, $(INSTALLED_FILES_OUTSIDE_IMAGES))
@ -2430,7 +2441,7 @@ IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(r
# if building multiple boot images from multiple kernels, use the first kernel listed # if building multiple boot images from multiple kernels, use the first kernel listed
# for the recovery image # for the recovery image
recovery_kernel := $(firstword $(INSTALLED_KERNEL_TARGET)) recovery_kernel := $(INSTALLED_RECOVERY_KERNEL_TARGET)
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio
recovery_resources_common := bootable/recovery/res recovery_resources_common := bootable/recovery/res
@ -6442,6 +6453,7 @@ $(BUILT_TARGET_FILES_DIR): \
$(INSTALLED_PVMFW_EMBEDDED_AVBKEY_TARGET) \ $(INSTALLED_PVMFW_EMBEDDED_AVBKEY_TARGET) \
$(INSTALLED_CUSTOMIMAGES_TARGET) \ $(INSTALLED_CUSTOMIMAGES_TARGET) \
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \ $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
$(INSTALLED_RECOVERY_KERNEL_TARGET) \
$(INSTALLED_KERNEL_TARGET) \ $(INSTALLED_KERNEL_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_RAMDISK_TARGET) \
$(INSTALLED_DTBIMAGE_TARGET) \ $(INSTALLED_DTBIMAGE_TARGET) \
@ -6485,12 +6497,9 @@ ifneq (true,$(BOARD_INCLUDE_RECOVERY_RAMDISK_IN_VENDOR_BOOT))
$(hide) $(call package_files-copy-root, \ $(hide) $(call package_files-copy-root, \
$(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK) $(TARGET_RECOVERY_ROOT_OUT),$(zip_root)/$(PRIVATE_RECOVERY_OUT)/RAMDISK)
endif endif
ifdef INSTALLED_KERNEL_TARGET ifdef INSTALLED_RECOVERY_KERNEL_TARGET
ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT))) # The python script that wraps it all up wants it to be named kernel, so do that
cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/ cp $(INSTALLED_RECOVERY_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE))
cp $(firstword $(INSTALLED_KERNEL_TARGET)) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
endif
endif endif
ifneq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(BOARD_USES_RECOVERY_AS_BOOT))) ifneq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(BOARD_USES_RECOVERY_AS_BOOT)))
ifdef INSTALLED_2NDBOOTLOADER_TARGET ifdef INSTALLED_2NDBOOTLOADER_TARGET