summaryrefslogtreecommitdiffstats
path: root/tools/releasetools/common.py
diff options
context:
space:
mode:
authorChirayu Desai <cdesai@cyanogenmod.org>2013-05-03 14:54:48 +0530
committerGerrit Code Review <gerrit@cyanogenmod.org>2013-07-23 17:35:40 +0000
commitff41d07cb201bea2ba2d29581ef2dd9fffbdc62f (patch)
tree86eef846c8b713e89e8de9a6842811591336ed7a /tools/releasetools/common.py
parentd496200ad4fef365af317a212bf1cf759ae00ae3 (diff)
downloadbuild-ff41d07cb201bea2ba2d29581ef2dd9fffbdc62f.zip
build-ff41d07cb201bea2ba2d29581ef2dd9fffbdc62f.tar.gz
build-ff41d07cb201bea2ba2d29581ef2dd9fffbdc62f.tar.bz2
releasetools: use prebuilt boot image if using a custom boot image makefile
Change-Id: Ic348d31e8df7933dc4f9f055b7a5a2beacc21d32
Diffstat (limited to 'tools/releasetools/common.py')
-rw-r--r--tools/releasetools/common.py8
1 files changed, 7 insertions, 1 deletions
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)