resolved conflicts for merge of e1c31bac
to master
This commit is contained in:
@@ -64,18 +64,29 @@ def LoadBoardConfig(fn):
|
||||
def BuildAndAddBootableImage(sourcedir, targetname, output_zip):
|
||||
"""Take a kernel, cmdline, and ramdisk directory from the input (in
|
||||
'sourcedir'), and turn them into a boot image. Put the boot image
|
||||
into the output zip file under the name 'targetname'."""
|
||||
into the output zip file under the name 'targetname'. Returns
|
||||
targetname on success or None on failure (if sourcedir does not
|
||||
appear to contain files for the requested image)."""
|
||||
|
||||
print "creating %s..." % (targetname,)
|
||||
|
||||
img = BuildBootableImage(sourcedir)
|
||||
if img is None:
|
||||
return None
|
||||
|
||||
CheckSize(img, targetname)
|
||||
ZipWriteStr(output_zip, targetname, img)
|
||||
return targetname
|
||||
|
||||
def BuildBootableImage(sourcedir):
|
||||
"""Take a kernel, cmdline, and ramdisk directory from the input (in
|
||||
'sourcedir'), and turn them into a boot image. Return the image data."""
|
||||
'sourcedir'), and turn them into a boot image. Return the image
|
||||
data, or None if sourcedir does not appear to contains files for
|
||||
building the requested image."""
|
||||
|
||||
if (not os.access(os.path.join(sourcedir, "RAMDISK"), os.F_OK) or
|
||||
not os.access(os.path.join(sourcedir, "kernel"), os.F_OK)):
|
||||
return None
|
||||
|
||||
ramdisk_img = tempfile.NamedTemporaryFile()
|
||||
img = tempfile.NamedTemporaryFile()
|
||||
@@ -107,7 +118,8 @@ def BuildBootableImage(sourcedir):
|
||||
|
||||
p = Run(cmd, stdout=subprocess.PIPE)
|
||||
p.communicate()
|
||||
assert p.returncode == 0, "mkbootimg of %s image failed" % (targetname,)
|
||||
assert p.returncode == 0, "mkbootimg of %s image failed" % (
|
||||
os.path.basename(sourcedir),)
|
||||
|
||||
img.seek(os.SEEK_SET, 0)
|
||||
data = img.read()
|
||||
|
@@ -327,8 +327,9 @@ def WriteFullOTAPackage(input_zip, output_zip):
|
||||
symlinks = CopySystemFiles(input_zip, output_zip)
|
||||
script.MakeSymlinks(symlinks)
|
||||
|
||||
common.BuildAndAddBootableImage(os.path.join(OPTIONS.input_tmp, "RECOVERY"),
|
||||
"system/recovery.img", output_zip)
|
||||
if common.BuildAndAddBootableImage(
|
||||
os.path.join(OPTIONS.input_tmp, "RECOVERY"),
|
||||
"system/recovery.img", output_zip):
|
||||
Item.Get("system/recovery.img", dir=False)
|
||||
|
||||
FixPermissions(script)
|
||||
|
Reference in New Issue
Block a user