forked from openkylin/platform_build
Remove obsolete MTD support from the releasetools scripts.
Bug: http://b/29250988 Change-Id: I653dc306485c6b35411840b53211d42eb6d19e34
This commit is contained in:
parent
b727d5bb32
commit
305b088729
|
@ -184,11 +184,9 @@ def AddUserdata(output_zip, prefix="IMAGES/"):
|
||||||
print "userdata.img already exists in %s, no need to rebuild..." % (prefix,)
|
print "userdata.img already exists in %s, no need to rebuild..." % (prefix,)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Skip userdata.img if no size.
|
||||||
image_props = build_image.ImagePropFromGlobalDict(OPTIONS.info_dict, "data")
|
image_props = build_image.ImagePropFromGlobalDict(OPTIONS.info_dict, "data")
|
||||||
# We only allow yaffs to have a 0/missing partition_size.
|
if not image_props.get("partition_size"):
|
||||||
# Extfs, f2fs must have a size. Skip userdata.img if no size.
|
|
||||||
if (not image_props.get("fs_type", "").startswith("yaffs") and
|
|
||||||
not image_props.get("partition_size")):
|
|
||||||
return
|
return
|
||||||
|
|
||||||
print "creating userdata.img..."
|
print "creating userdata.img..."
|
||||||
|
|
|
@ -390,14 +390,8 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):
|
||||||
build_command = ["mkf2fsuserimg.sh"]
|
build_command = ["mkf2fsuserimg.sh"]
|
||||||
build_command.extend([out_file, prop_dict["partition_size"]])
|
build_command.extend([out_file, prop_dict["partition_size"]])
|
||||||
else:
|
else:
|
||||||
build_command = ["mkyaffs2image", "-f"]
|
print("Error: unknown filesystem type '%s'" % (fs_type))
|
||||||
if prop_dict.get("mkyaffs2_extra_flags", None):
|
return False
|
||||||
build_command.extend(prop_dict["mkyaffs2_extra_flags"].split())
|
|
||||||
build_command.append(in_dir)
|
|
||||||
build_command.append(out_file)
|
|
||||||
if "selinux_fc" in prop_dict:
|
|
||||||
build_command.append(prop_dict["selinux_fc"])
|
|
||||||
build_command.append(prop_dict["mount_point"])
|
|
||||||
|
|
||||||
if in_dir != origin_in:
|
if in_dir != origin_in:
|
||||||
# Construct a staging directory of the root file system.
|
# Construct a staging directory of the root file system.
|
||||||
|
@ -501,7 +495,6 @@ def ImagePropFromGlobalDict(glob_dict, mount_point):
|
||||||
common_props = (
|
common_props = (
|
||||||
"extfs_sparse_flag",
|
"extfs_sparse_flag",
|
||||||
"squashfs_sparse_flag",
|
"squashfs_sparse_flag",
|
||||||
"mkyaffs2_extra_flags",
|
|
||||||
"selinux_fc",
|
"selinux_fc",
|
||||||
"skip_fsck",
|
"skip_fsck",
|
||||||
"verity",
|
"verity",
|
||||||
|
|
|
@ -128,14 +128,6 @@ def LoadInfoDict(input_file, input_dir=None):
|
||||||
# files. Look for them, in case we're processing an old
|
# files. Look for them, in case we're processing an old
|
||||||
# target_files zip.
|
# target_files zip.
|
||||||
|
|
||||||
if "mkyaffs2_extra_flags" not in d:
|
|
||||||
try:
|
|
||||||
d["mkyaffs2_extra_flags"] = read_helper(
|
|
||||||
"META/mkyaffs2-extra-flags.txt").strip()
|
|
||||||
except KeyError:
|
|
||||||
# ok if flags don't exist
|
|
||||||
pass
|
|
||||||
|
|
||||||
if "recovery_api_version" not in d:
|
if "recovery_api_version" not in d:
|
||||||
try:
|
try:
|
||||||
d["recovery_api_version"] = read_helper(
|
d["recovery_api_version"] = read_helper(
|
||||||
|
@ -816,10 +808,6 @@ def CheckSize(data, target, info_dict):
|
||||||
if not fs_type or not limit:
|
if not fs_type or not limit:
|
||||||
return
|
return
|
||||||
|
|
||||||
if fs_type == "yaffs2":
|
|
||||||
# image size should be increased by 1/64th to account for the
|
|
||||||
# spare area (64 bytes per 2k page)
|
|
||||||
limit = limit / 2048 * (2048+64)
|
|
||||||
size = len(data)
|
size = len(data)
|
||||||
pct = float(size) * 100.0 / limit
|
pct = float(size) * 100.0 / limit
|
||||||
msg = "%s size (%d) is %.2f%% of limit (%d)" % (target, size, pct, limit)
|
msg = "%s size (%d) is %.2f%% of limit (%d)" % (target, size, pct, limit)
|
||||||
|
@ -1615,8 +1603,6 @@ DataImage = blockimgdiff.DataImage
|
||||||
|
|
||||||
# map recovery.fstab's fs_types to mount/format "partition types"
|
# map recovery.fstab's fs_types to mount/format "partition types"
|
||||||
PARTITION_TYPES = {
|
PARTITION_TYPES = {
|
||||||
"yaffs2": "MTD",
|
|
||||||
"mtd": "MTD",
|
|
||||||
"ext4": "EMMC",
|
"ext4": "EMMC",
|
||||||
"emmc": "EMMC",
|
"emmc": "EMMC",
|
||||||
"f2fs": "EMMC",
|
"f2fs": "EMMC",
|
||||||
|
|
|
@ -167,7 +167,7 @@ class EdifyGenerator(object):
|
||||||
self.script.append("set_progress(%f);" % (frac,))
|
self.script.append("set_progress(%f);" % (frac,))
|
||||||
|
|
||||||
def PatchCheck(self, filename, *sha1):
|
def PatchCheck(self, filename, *sha1):
|
||||||
"""Check that the given file (or MTD reference) has one of the
|
"""Check that the given file has one of the
|
||||||
given *sha1 hashes, checking the version saved in cache if the
|
given *sha1 hashes, checking the version saved in cache if the
|
||||||
file does not match."""
|
file does not match."""
|
||||||
self.script.append(
|
self.script.append(
|
||||||
|
@ -176,7 +176,7 @@ class EdifyGenerator(object):
|
||||||
') || abort("\\"%s\\" has unexpected contents.");' % (filename,))
|
') || abort("\\"%s\\" has unexpected contents.");' % (filename,))
|
||||||
|
|
||||||
def Verify(self, filename):
|
def Verify(self, filename):
|
||||||
"""Check that the given file (or MTD reference) has one of the
|
"""Check that the given file has one of the
|
||||||
given hashes (encoded in the filename)."""
|
given hashes (encoded in the filename)."""
|
||||||
self.script.append(
|
self.script.append(
|
||||||
'apply_patch_check("{filename}") && '
|
'apply_patch_check("{filename}") && '
|
||||||
|
@ -185,7 +185,7 @@ class EdifyGenerator(object):
|
||||||
filename=filename))
|
filename=filename))
|
||||||
|
|
||||||
def FileCheck(self, filename, *sha1):
|
def FileCheck(self, filename, *sha1):
|
||||||
"""Check that the given file (or MTD reference) has one of the
|
"""Check that the given file has one of the
|
||||||
given *sha1 hashes."""
|
given *sha1 hashes."""
|
||||||
self.script.append('assert(sha1_check(read_file("%s")' % (filename,) +
|
self.script.append('assert(sha1_check(read_file("%s")' % (filename,) +
|
||||||
"".join([', "%s"' % (i,) for i in sha1]) +
|
"".join([', "%s"' % (i,) for i in sha1]) +
|
||||||
|
@ -322,11 +322,7 @@ class EdifyGenerator(object):
|
||||||
p = fstab[mount_point]
|
p = fstab[mount_point]
|
||||||
partition_type = common.PARTITION_TYPES[p.fs_type]
|
partition_type = common.PARTITION_TYPES[p.fs_type]
|
||||||
args = {'device': p.device, 'fn': fn}
|
args = {'device': p.device, 'fn': fn}
|
||||||
if partition_type == "MTD":
|
if partition_type == "EMMC":
|
||||||
self.script.append(
|
|
||||||
'write_raw_image(package_extract_file("%(fn)s"), "%(device)s");'
|
|
||||||
% args)
|
|
||||||
elif partition_type == "EMMC":
|
|
||||||
if mapfn:
|
if mapfn:
|
||||||
args["map"] = mapfn
|
args["map"] = mapfn
|
||||||
self.script.append(
|
self.script.append(
|
||||||
|
|
Loading…
Reference in New Issue