take bootable images from target_files if present
Now that we're building and saving images in the target_files at build time, we should use those images instead of rebuilding them. Bug: 17201052 Change-Id: I459e650f66f1e0bdf01ad54df9e34f36bf2ee899
This commit is contained in:
@@ -355,14 +355,20 @@ def GetBootableImage(name, prebuilt_name, unpack_dir, tree_subdir,
|
|||||||
info_dict=None):
|
info_dict=None):
|
||||||
"""Return a File object (with name 'name') with the desired bootable
|
"""Return a File object (with name 'name') with the desired bootable
|
||||||
image. Look for it in 'unpack_dir'/BOOTABLE_IMAGES under the name
|
image. Look for it in 'unpack_dir'/BOOTABLE_IMAGES under the name
|
||||||
'prebuilt_name', otherwise construct it from the source files in
|
'prebuilt_name', otherwise look for it under 'unpack_dir'/IMAGES,
|
||||||
|
otherwise construct it from the source files in
|
||||||
'unpack_dir'/'tree_subdir'."""
|
'unpack_dir'/'tree_subdir'."""
|
||||||
|
|
||||||
prebuilt_path = os.path.join(unpack_dir, "BOOTABLE_IMAGES", prebuilt_name)
|
prebuilt_path = os.path.join(unpack_dir, "BOOTABLE_IMAGES", prebuilt_name)
|
||||||
if os.path.exists(prebuilt_path):
|
if os.path.exists(prebuilt_path):
|
||||||
print "using prebuilt %s..." % (prebuilt_name,)
|
print "using prebuilt %s from BOOTABLE_IMAGES..." % (prebuilt_name,)
|
||||||
return File.FromLocalFile(name, prebuilt_path)
|
return File.FromLocalFile(name, prebuilt_path)
|
||||||
else:
|
|
||||||
|
prebuilt_path = os.path.join(unpack_dir, "IMAGES", prebuilt_name)
|
||||||
|
if os.path.exists(prebuilt_path):
|
||||||
|
print "using prebuilt %s from IMAGES..." % (prebuilt_name,)
|
||||||
|
return File.FromLocalFile(name, prebuilt_path)
|
||||||
|
|
||||||
print "building image from target_files %s..." % (tree_subdir,)
|
print "building image from target_files %s..." % (tree_subdir,)
|
||||||
fs_config = "META/" + tree_subdir.lower() + "_filesystem_config.txt"
|
fs_config = "META/" + tree_subdir.lower() + "_filesystem_config.txt"
|
||||||
data = BuildBootableImage(os.path.join(unpack_dir, tree_subdir),
|
data = BuildBootableImage(os.path.join(unpack_dir, tree_subdir),
|
||||||
|
Reference in New Issue
Block a user