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

Commit 00484806 authored by Koushik Dutta's avatar Koushik Dutta
Browse files

Add support for building Clockwork Recovery.

Preparing this so cherry picks are clean.

Change-Id: I9ca4084c0f19824c967bcdbb19b6aac02f547f80

Prevent building of patch recovery if so desired.

Preparing this so cherry picks are clean.

Change-Id: I96aa45fdc5f035732c3f2d4b0bd2c3b523bb87b1

delete device specific rc from ramdisk of recovery

this does not need to be built...

add support for explicitly setting a ramdisk address

support page size flag for boot images

allow separate recovery kernels

Change-Id: I0e4df1e1b3440cf2b3a37fe41aa22791dda1aa47
parent c191e5a6
Loading
Loading
Loading
Loading
+24 −5
Original line number Diff line number Diff line
@@ -336,7 +336,13 @@ ifdef BOARD_KERNEL_BASE
  INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)
endif

include $(BUILD_SYSTEM)/kernel.mk
ifneq ($(BOARD_FORCE_RAMDISK_ADDRESS),)
    INTERNAL_BOOTIMAGE_ARGS += --ramdiskaddr $(BOARD_FORCE_RAMDISK_ADDRESS)
endif

ifneq ($(BOARD_PAGE_SIZE),)
    INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_PAGE_SIZE)
endif

INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img

@@ -356,6 +362,8 @@ $(INSTALLED_BOOTIMAGE_TARGET): $(MKBOOTIMG) $(INTERNAL_BOOTIMAGE_FILES)
	$(hide) $(call assert-max-image-size,$@,$(BOARD_BOOTIMAGE_PARTITION_SIZE),raw)
endif # TARGET_BOOTIMAGE_USE_EXT2

include $(BUILD_SYSTEM)/kernel.mk

else	# TARGET_NO_KERNEL
# HACK: The top-level targets depend on the bootimage.  Not all targets
# can produce a bootimage, though, and emulator targets need the ramdisk
@@ -560,7 +568,7 @@ ifeq (,$(filter true, $(TARGET_NO_KERNEL) $(TARGET_NO_RECOVERY) $(BUILD_TINY_AND
INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img

recovery_initrc := $(call include-path-for, recovery)/etc/init.rc
recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system
recovery_kernel := $(INSTALLED_RECOVERY_KERNEL_TARGET)
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
recovery_build_prop := $(INSTALLED_BUILD_PROP_TARGET)
recovery_binary := $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery
@@ -590,6 +598,12 @@ endif
ifdef BOARD_KERNEL_BASE
  INTERNAL_RECOVERYIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)
endif
ifneq ($(BOARD_FORCE_RAMDISK_ADDRESS),)
    INTERNAL_RECOVERYIMAGE_ARGS += --ramdiskaddr $(BOARD_FORCE_RAMDISK_ADDRESS)
endif
ifneq ($(BOARD_PAGE_SIZE),)
    INTERNAL_RECOVERYIMAGE_ARGS += --pagesize $(BOARD_PAGE_SIZE)
endif

# Keys authorized to sign OTA packages this build will accept.  The
# build always uses test-keys for this; release packaging tools will
@@ -627,6 +641,8 @@ $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \
	echo Modifying ramdisk contents...
	cp -f $(recovery_initrc) $(TARGET_RECOVERY_ROOT_OUT)/
	cp -f $(recovery_binary) $(TARGET_RECOVERY_ROOT_OUT)/sbin/
	rm -f $(TARGET_RECOVERY_ROOT_OUT)/init.*.rc
	mkdir -p $(TARGET_RECOVERY_ROOT_OUT)/system/bin
	cp -rf $(recovery_resources_common) $(TARGET_RECOVERY_ROOT_OUT)/
	$(foreach item,$(recovery_resources_private), \
	  cp -rf $(item) $(TARGET_RECOVERY_ROOT_OUT)/)
@@ -714,7 +730,7 @@ endif
# image size check calculation.
ifneq ($(INSTALLED_RECOVERYIMAGE_TARGET),)
intermediates := $(call intermediates-dir-for,PACKAGING,recovery_patch)
RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p
RECOVERY_FROM_BOOT_PATCH := #$(intermediates)/recovery_from_boot.p
$(RECOVERY_FROM_BOOT_PATCH): $(INSTALLED_RECOVERYIMAGE_TARGET) \
                             $(INSTALLED_BOOTIMAGE_TARGET) \
			     $(HOST_OUT_EXECUTABLES)/imgdiff \
@@ -1035,11 +1051,14 @@ else
$(INTERNAL_OTA_PACKAGE_TARGET): backuptool := true
endif

ifeq ($(TARGET_NO_RECOVERY),)
ifeq ($(TARGET_NO_RECOVERY),true)
    TARGET_OTA_NO_RECOVERY := true
endif
ifeq ($(TARGET_OTA_NO_RECOVERY),)
# default to "false"
$(INTERNAL_OTA_PACKAGE_TARGET): recoveryex := false
else
$(INTERNAL_OTA_PACKAGE_TARGET): recoveryex := $(TARGET_NO_RECOVERY)
$(INTERNAL_OTA_PACKAGE_TARGET): recoveryex := $(TARGET_OTA_NO_RECOVERY)
endif

ifeq ($(TARGET_OTA_ASSERT_DEVICE),)
+14 −0
Original line number Diff line number Diff line
@@ -89,3 +89,17 @@ $(INSTALLED_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
	$(transform-prebuilt-to-target)

endif # TARGET_PREBUILT_KERNEL

ifeq ($(TARGET_PREBUILT_RECOVERY_KERNEL),)

$(INSTALLED_RECOVERY_KERNEL_TARGET): $(TARGET_PREBUILT_KERNEL) | $(ACP)
	@echo "Transforming $(INSTALLED_RECOVERY_KERNEL_TARGET) to $(TARGET_PREBUILT_KERNEL)"
	$(transform-prebuilt-to-target)

else

$(INSTALLED_RECOVERY_KERNEL_TARGET): $(TARGET_PREBUILT_RECOVERY_KERNEL) | $(ACP)
	@echo "Transforming $(INSTALLED_RECOVERY_KERNEL_TARGET) to $(TARGET_PREBUILT_RECOVERY_KERNEL)"
	$(transform-prebuilt-to-target)

endif
+2 −0
Original line number Diff line number Diff line
@@ -16,8 +16,10 @@ endif # TARGET_NO_BOOTLOADER

ifneq ($(strip $(TARGET_NO_KERNEL)),true)
  INSTALLED_KERNEL_TARGET := $(PRODUCT_OUT)/kernel
  INSTALLED_RECOVERY_KERNEL_TARGET := $(PRODUCT_OUT)/recovery_kernel
else
  INSTALLED_KERNEL_TARGET :=
  INSTALLED_RECOVERY_KERNEL_TARGET :=
endif

# Use the add-radio-file function to add values to this variable.