From ff41d07cb201bea2ba2d29581ef2dd9fffbdc62f Mon Sep 17 00:00:00 2001 From: Chirayu Desai Date: Fri, 3 May 2013 14:54:48 +0530 Subject: releasetools: use prebuilt boot image if using a custom boot image makefile Change-Id: Ic348d31e8df7933dc4f9f055b7a5a2beacc21d32 --- core/Makefile | 2 ++ tools/releasetools/common.py | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index ae64e28..b65a857 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1330,6 +1330,7 @@ endif $(INTERNAL_OTA_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) @echo -e ${CL_YLW}"Package OTA:"${CL_RST}" $@" + MKBOOTIMG=$(BOARD_CUSTOM_BOOTIMG_MK) \ $(OTA_FROM_TARGET_SCRIPT) -v \ -p $(HOST_OUT) \ -k $(KEY_CERT_PAIR) \ @@ -1375,6 +1376,7 @@ endif $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(DISTTOOLS) @echo -e ${CL_YLW}"Package:"${CL_RST}" $@" + MKBOOTIMG=$(BOARD_CUSTOM_BOOTIMG_MK) \ $(IMG_FROM_TARGET_SCRIPT) -v \ -s $(extensions) \ -p $(HOST_OUT) \ diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index b56a16e..ab874f1 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -297,7 +297,13 @@ def GetBootableImage(name, prebuilt_name, unpack_dir, tree_subdir, 'prebuilt_name', otherwise construct it from the source files in 'unpack_dir'/'tree_subdir'.""" - prebuilt_path = os.path.join(unpack_dir, "BOOTABLE_IMAGES", prebuilt_name) + prebuilt_dir = os.path.join(unpack_dir, "BOOTABLE_IMAGES") + prebuilt_path = os.path.join(prebuilt_dir, prebuilt_name) + custom_bootimg_mk = os.getenv('MKBOOTIMG') + if custom_bootimg_mk: + bootimage_path = os.path.join(os.getenv('OUT'), "boot.img") + os.mkdir(prebuilt_dir) + shutil.copyfile(bootimage_path, prebuilt_path) if os.path.exists(prebuilt_path): print "using prebuilt %s..." % (prebuilt_name,) return File.FromLocalFile(name, prebuilt_path) -- cgit v1.1