From 3791e4db2e843c4b39a1e0b6ec314a5774e23868 Mon Sep 17 00:00:00 2001 From: Ameya Thakur Date: Mon, 29 Jul 2013 17:39:37 -0700 Subject: [PATCH] build: Add changes to release tools and mkbootimg Change the prototype of LoadRecoveryFstab to take in the device type as a argument. Fix the case where mkbootimg was being passed a incorrect argument. Change-Id: Ic6ac596d8d96d3a5effbdf513763ec1cb92b1a03 --- core/Makefile | 7 +++++++ tools/releasetools/common.py | 12 ++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index df34aba6d..e0989dd93 100644 --- a/core/Makefile +++ b/core/Makefile @@ -1780,6 +1780,9 @@ ifdef INSTALLED_2NDBOOTLOADER_TARGET $(hide) $(ACP) \ $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/$(PRIVATE_RECOVERY_OUT)/second endif +ifdef BOARD_KERNEL_TAGS_OFFSET + $(hide) echo "$(BOARD_KERNEL_TAGS_OFFSET)" > $(zip_root)/RECOVERY/tags_offset +endif ifdef BOARD_KERNEL_CMDLINE $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/$(PRIVATE_RECOVERY_OUT)/cmdline endif @@ -1818,6 +1821,10 @@ ifdef INSTALLED_2NDBOOTLOADER_TARGET $(hide) $(ACP) \ $(INSTALLED_2NDBOOTLOADER_TARGET) $(zip_root)/BOOT/second endif + +ifdef BOARD_KERNEL_TAGS_OFFSET + $(hide) echo "$(BOARD_KERNEL_TAGS_OFFSET)" > $(zip_root)/BOOT/tags_offset +endif ifdef BOARD_KERNEL_CMDLINE $(hide) echo "$(BOARD_KERNEL_CMDLINE)" > $(zip_root)/BOOT/cmdline endif diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 20045d09f..216fc0514 100755 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -230,6 +230,9 @@ def LoadInfoDict(input_file, input_dir=None): vendor_base_fs_file,) del d["vendor_base_fs_file"] + + if "device_type" not in d: + d["device_type"] = "MMC" try: data = read_helper("META/imagesizes.txt") for line in data.split("\n"): @@ -263,7 +266,7 @@ def LoadInfoDict(input_file, input_dir=None): d["fstab"] = None else: d["fstab"] = LoadRecoveryFSTab(read_helper, d["fstab_version"], - d.get("system_root_image", False)) + d.get("system_root_image", d["device_type"], False)) d["build.prop"] = LoadBuildProp(read_helper) return d @@ -286,7 +289,7 @@ def LoadDictionaryFromLines(lines): d[name] = value return d -def LoadRecoveryFSTab(read_helper, fstab_version, system_root_image=False): +def LoadRecoveryFSTab(read_helper, fstab_version, type, system_root_image=False): class Partition(object): def __init__(self, mount_point, fs_type, device, length, device2, context): self.mount_point = mount_point @@ -468,6 +471,11 @@ def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None, cmd.append("--tags-addr") cmd.append(open(fn).read().rstrip("\n")) + fn = os.path.join(sourcedir, "tags_offset") + if os.access(fn, os.F_OK): + cmd.append("--tags_offset") + cmd.append(open(fn).read().rstrip("\n")) + fn = os.path.join(sourcedir, "ramdisk_offset") if os.access(fn, os.F_OK): cmd.append("--ramdisk_offset") -- 2.11.0