From e93ebb2cb1e12dd65ef6294e0e5faa0f07a784ed Mon Sep 17 00:00:00 2001 From: Firefly Date: Fri, 20 Nov 2015 15:39:12 +0800 Subject: [PATCH] [build] Config PATH for 2ndbootloader and 3ndbootloader to pack images correctly To pack dtb to boot.img and recovery.img correctly Signed-off-by: Firefly --- build/core/Makefile | 24 ++++++++++++++++++++++++ build/tools/releasetools/common.py | 11 +++++++++++ 2 files changed, 35 insertions(+) diff --git a/build/core/Makefile b/build/core/Makefile index 93672895c4..61446552cd 100644 --- a/build/core/Makefile +++ b/build/core/Makefile @@ -480,6 +480,13 @@ INTERNAL_BOOTIMAGE_ARGS += \ $(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) endif +ifeq ($(TARGET_BOARD_PLATFORM),sofia3gr) +ifeq ($(strip $(TARGET_BOOTLOADER_IS_3ND)),true) + INTERNAL_BOOTIMAGE_ARGS += \ + $(addprefix --third ,$(INSTALLED_3NDBOOTLOADER_TARGET)) +endif +endif + INTERNAL_BOOTIMAGE_FILES := $(filter-out --%,$(INTERNAL_BOOTIMAGE_ARGS)) BOARD_KERNEL_CMDLINE := $(strip $(BOARD_KERNEL_CMDLINE)) @@ -906,8 +913,12 @@ $(RECOVERY_INSTALL_OTA_KEYS): $(OTA_PUBLIC_KEYS) $(DUMPKEY_JAR) $(extra_keys) $( java -jar $(DUMPKEY_JAR) $(PRIVATE_OTA_PUBLIC_KEYS) $(extra_keys) $(RADICAL_UPDATE_CERT) > $@ ifeq ($(strip $(TARGET_BOOTLOADER_IS_2ND)),true) +ifeq ($(TARGET_BOARD_PLATFORM),sofia3gr) +$(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_2NDBOOTLOADER_RECOVERY_TARGET) +else $(INSTALLED_RECOVERYIMAGE_TARGET): $(INSTALLED_2NDBOOTLOADER_TARGET) endif +endif $(INSTALLED_RECOVERYIMAGE_TARGET): $(MKBOOTFS) $(MKBOOTIMG) $(MINIGZIP) \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_BOOTIMAGE_TARGET) \ @@ -1445,9 +1456,14 @@ ifdef INSTALLED_KERNEL_TARGET $(hide) $(ACP) $(INSTALLED_KERNEL_TARGET) $(zip_root)/RECOVERY/kernel endif ifdef INSTALLED_2NDBOOTLOADER_TARGET +ifeq ($(TARGET_BOARD_PLATFORM),sofia3gr) + $(hide) $(ACP) \ + $(INSTALLED_2NDBOOTLOADER_RECOVERY_TARGET) $(zip_root)/RECOVERY/second +else $(hide) $(ACP) \ $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/RECOVERY/second endif +endif ifdef BOARD_KERNEL_CMDLINE $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/RECOVERY/cmdline endif @@ -1468,6 +1484,14 @@ ifdef INSTALLED_2NDBOOTLOADER_TARGET $(hide) $(ACP) \ $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second endif + +ifdef INSTALLED_3NDBOOTLOADER_TARGET +ifeq ($(TARGET_BOARD_PLATFORM),sofia3gr) + $(hide) $(ACP) \ + $(INSTALLED_3NDBOOTLOADER_TARGET) $(zip_root)/BOOT/third +endif +endif + ifdef BOARD_KERNEL_CMDLINE $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline endif diff --git a/build/tools/releasetools/common.py b/build/tools/releasetools/common.py index c4130cceec..3088488fa4 100644 --- a/build/tools/releasetools/common.py +++ b/build/tools/releasetools/common.py @@ -348,6 +348,17 @@ def BuildBootableImage(sourcedir, fs_config_file, info_dict=None): if os.access(fn, os.F_OK): cmd.append("--pagesize") cmd.append(open(fn).read().rstrip("\n")) + + fn = os.path.join(sourcedir, "second") + if os.access(fn, os.F_OK): + cmd.append("--second") + cmd.append(fn) + + + fn = os.path.join(sourcedir, "third") + if os.access(fn, os.F_OK): + cmd.append("--third") + cmd.append(fn) args = info_dict.get("mkbootimg_args", None) if args and args.strip():