Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b802699c authored by marcost2's avatar marcost2 Committed by Jarl-Penguin
Browse files

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

* Either as prebuilts, or with separate defconfigs

Change-Id: Iae31e3634178e66b4119c718994fe1c660414529
parent 87e08519
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -753,6 +753,17 @@ else
  INSTALLED_KERNEL_TARGET :=
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
INTERNAL_ROOT_FILES := $(filter $(TARGET_ROOT_OUT)/%, \
@@ -1937,7 +1948,7 @@ IGNORE_RECOVERY_SEPOLICY := $(patsubst $(TARGET_RECOVERY_OUT)/%,--exclude=/%,$(r

# if building multiple boot images from multiple kernels, use the first kernel listed
# for the recovery image
recovery_kernel := $(firstword $(INSTALLED_KERNEL_TARGET))
recovery_kernel := $(INSTALLED_RECOVERY_KERNEL_TARGET)
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio
recovery_resources_common := bootable/recovery/res
@@ -4964,6 +4975,7 @@ $(BUILT_TARGET_FILES_PACKAGE): \
	    $(INSTALLED_PVMFWIMAGE_TARGET) \
	    $(INSTALLED_CUSTOMIMAGES_TARGET) \
	    $(INSTALLED_ANDROID_INFO_TXT_TARGET) \
	    $(INSTALLED_RECOVERY_KERNEL_TARGET) \
	    $(INSTALLED_KERNEL_TARGET) \
	    $(INSTALLED_RAMDISK_TARGET) \
	    $(INSTALLED_DTBIMAGE_TARGET) \
@@ -5005,12 +5017,9 @@ endif
	@# OTA install helpers
	$(hide) $(call package_files-copy-root, \
	    $(PRODUCT_OUT)/install,$(zip_root)/INSTALL)
ifdef INSTALLED_KERNEL_TARGET
ifneq (,$(filter true,$(BOARD_USES_RECOVERY_AS_BOOT)))
	cp $(INSTALLED_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/
else ifneq (true,$(BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE))
	cp $(firstword $(INSTALLED_KERNEL_TARGET)) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
endif
ifdef INSTALLED_RECOVERY_KERNEL_TARGET
	# The python script that wraps it all up wants it to be named kernel, so do that
	cp $(INSTALLED_RECOVERY_KERNEL_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/kernel
endif
ifneq (truetrue,$(strip $(BUILDING_VENDOR_BOOT_IMAGE))$(strip $(BOARD_USES_RECOVERY_AS_BOOT)))
ifdef INSTALLED_2NDBOOTLOADER_TARGET