use the max image sizes from the target files zip
For some time now the build system has included all the max image sizes in a file in the META directory. Use these instead of needing to parse the BoardConfig.mk file for the device at the time of building an image or OTA package.
This commit is contained in:
@@ -46,18 +46,18 @@ def Run(args, **kwargs):
|
||||
return subprocess.Popen(args, **kwargs)
|
||||
|
||||
|
||||
def LoadBoardConfig(fn):
|
||||
"""Parse a board_config.mk file looking for lines that specify the
|
||||
maximum size of various images, and parse them into the
|
||||
OPTIONS.max_image_size dict."""
|
||||
def LoadMaxSizes():
|
||||
"""Load the maximum allowable images sizes from the input
|
||||
target_files size."""
|
||||
OPTIONS.max_image_size = {}
|
||||
for line in open(fn):
|
||||
line = line.strip()
|
||||
m = re.match(r"BOARD_(BOOT|RECOVERY|SYSTEM|USERDATA)IMAGE_MAX_SIZE"
|
||||
r"\s*:=\s*(\d+)", line)
|
||||
if not m: continue
|
||||
|
||||
OPTIONS.max_image_size[m.group(1).lower() + ".img"] = int(m.group(2))
|
||||
try:
|
||||
for line in open(os.path.join(OPTIONS.input_tmp, "META", "imagesizes.txt")):
|
||||
image, size = line.split()
|
||||
size = int(size)
|
||||
OPTIONS.max_image_size[image + ".img"] = size
|
||||
except IOError, e:
|
||||
if e.errno == errno.ENOENT:
|
||||
pass
|
||||
|
||||
|
||||
def BuildAndAddBootableImage(sourcedir, targetname, output_zip):
|
||||
|
Reference in New Issue
Block a user