Merge changes from topic "split_ramdisk"

* changes:
  Exclude board cmdline/dtb/pagesize/base in generic boot image
  Add BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT.
  Add BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE.
  Add GKI global variable.
This commit is contained in:
Treehugger Robot
2020-10-17 00:40:54 +00:00
committed by Gerrit Code Review
3 changed files with 125 additions and 30 deletions

View File

@@ -1287,23 +1287,27 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None,
for building the requested image.
"""
if info_dict is None:
info_dict = OPTIONS.info_dict
# "boot" or "recovery", without extension.
partition_name = os.path.basename(sourcedir).lower()
kernel = None
if partition_name == "recovery":
kernel = "kernel"
if info_dict.get("exclude_kernel_from_recovery_image") == "true":
logger.info("Excluded kernel binary from recovery image.")
else:
kernel = "kernel"
else:
kernel = image_name.replace("boot", "kernel")
kernel = kernel.replace(".img", "")
if not os.access(os.path.join(sourcedir, kernel), os.F_OK):
if kernel and not os.access(os.path.join(sourcedir, kernel), os.F_OK):
return None
if has_ramdisk and not os.access(os.path.join(sourcedir, "RAMDISK"), os.F_OK):
return None
if info_dict is None:
info_dict = OPTIONS.info_dict
img = tempfile.NamedTemporaryFile()
if has_ramdisk:
@@ -1313,7 +1317,9 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None,
# use MKBOOTIMG from environ, or "mkbootimg" if empty or not set
mkbootimg = os.getenv('MKBOOTIMG') or "mkbootimg"
cmd = [mkbootimg, "--kernel", os.path.join(sourcedir, kernel)]
cmd = [mkbootimg]
if kernel:
cmd += ["--kernel", os.path.join(sourcedir, kernel)]
fn = os.path.join(sourcedir, "second")
if os.access(fn, os.F_OK):