am a73b6561
: Drop support for target files with no recovery.fstab.
* commit 'a73b6561cee39ad416f4af327dbe72ec565d2423': Drop support for target files with no recovery.fstab.
This commit is contained in:
@@ -1070,6 +1070,7 @@ ifneq ($(TARGET_SIMULATOR),true)
|
|||||||
ifneq ($(TARGET_PRODUCT),sdk)
|
ifneq ($(TARGET_PRODUCT),sdk)
|
||||||
ifneq ($(TARGET_DEVICE),generic)
|
ifneq ($(TARGET_DEVICE),generic)
|
||||||
ifneq ($(TARGET_NO_KERNEL),true)
|
ifneq ($(TARGET_NO_KERNEL),true)
|
||||||
|
ifneq ($(recovery_fstab),)
|
||||||
|
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# OTA update package
|
# OTA update package
|
||||||
@@ -1122,6 +1123,7 @@ $(INTERNAL_UPDATE_PACKAGE_TARGET): $(BUILT_TARGET_FILES_PACKAGE) $(OTATOOLS)
|
|||||||
.PHONY: updatepackage
|
.PHONY: updatepackage
|
||||||
updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET)
|
updatepackage: $(INTERNAL_UPDATE_PACKAGE_TARGET)
|
||||||
|
|
||||||
|
endif # recovery_fstab is defined
|
||||||
endif # TARGET_NO_KERNEL != true
|
endif # TARGET_NO_KERNEL != true
|
||||||
endif # TARGET_DEVICE != generic
|
endif # TARGET_DEVICE != generic
|
||||||
endif # TARGET_PRODUCT != sdk
|
endif # TARGET_PRODUCT != sdk
|
||||||
|
@@ -121,10 +121,6 @@ def LoadInfoDict(zip):
|
|||||||
makeint("boot_size")
|
makeint("boot_size")
|
||||||
|
|
||||||
d["fstab"] = LoadRecoveryFSTab(zip)
|
d["fstab"] = LoadRecoveryFSTab(zip)
|
||||||
if not d["fstab"]:
|
|
||||||
if "fs_type" not in d: d["fs_type"] = "yaffs2"
|
|
||||||
if "partition_type" not in d: d["partition_type"] = "MTD"
|
|
||||||
|
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def LoadRecoveryFSTab(zip):
|
def LoadRecoveryFSTab(zip):
|
||||||
@@ -134,9 +130,7 @@ def LoadRecoveryFSTab(zip):
|
|||||||
try:
|
try:
|
||||||
data = zip.read("RECOVERY/RAMDISK/etc/recovery.fstab")
|
data = zip.read("RECOVERY/RAMDISK/etc/recovery.fstab")
|
||||||
except KeyError:
|
except KeyError:
|
||||||
# older target-files that doesn't have a recovery.fstab; fall back
|
raise ValueError("Could not find RECOVERY/RAMDISK/etc/recovery.fstab")
|
||||||
# to the fs_type and partition_type keys.
|
|
||||||
return
|
|
||||||
|
|
||||||
d = {}
|
d = {}
|
||||||
for line in data.split("\n"):
|
for line in data.split("\n"):
|
||||||
@@ -350,9 +344,6 @@ def CheckSize(data, target, info_dict):
|
|||||||
p = info_dict["fstab"][mount_point]
|
p = info_dict["fstab"][mount_point]
|
||||||
fs_type = p.fs_type
|
fs_type = p.fs_type
|
||||||
limit = info_dict.get(p.device + "_size", None)
|
limit = info_dict.get(p.device + "_size", None)
|
||||||
else:
|
|
||||||
fs_type = info_dict.get("fs_type", None)
|
|
||||||
limit = info_dict.get(target + "_size", None)
|
|
||||||
if not fs_type or not limit: return
|
if not fs_type or not limit: return
|
||||||
|
|
||||||
if fs_type == "yaffs2":
|
if fs_type == "yaffs2":
|
||||||
@@ -777,9 +768,4 @@ def GetTypeAndDevice(mount_point, info):
|
|||||||
if fstab:
|
if fstab:
|
||||||
return PARTITION_TYPES[fstab[mount_point].fs_type], fstab[mount_point].device
|
return PARTITION_TYPES[fstab[mount_point].fs_type], fstab[mount_point].device
|
||||||
else:
|
else:
|
||||||
devices = {"/boot": "boot",
|
return None
|
||||||
"/recovery": "recovery",
|
|
||||||
"/radio": "radio",
|
|
||||||
"/data": "userdata",
|
|
||||||
"/cache": "cache"}
|
|
||||||
return info["partition_type"], info.get("partition_path", "") + devices[mount_point]
|
|
||||||
|
@@ -140,13 +140,6 @@ class EdifyGenerator(object):
|
|||||||
(p.fs_type, common.PARTITION_TYPES[p.fs_type],
|
(p.fs_type, common.PARTITION_TYPES[p.fs_type],
|
||||||
p.device, p.mount_point))
|
p.device, p.mount_point))
|
||||||
self.mounts.add(p.mount_point)
|
self.mounts.add(p.mount_point)
|
||||||
else:
|
|
||||||
what = mount_point.lstrip("/")
|
|
||||||
what = self.info.get("partition_path", "") + what
|
|
||||||
self.script.append('mount("%s", "%s", "%s", "%s");' %
|
|
||||||
(self.info["fs_type"], self.info["partition_type"],
|
|
||||||
what, mount_point))
|
|
||||||
self.mounts.add(mount_point)
|
|
||||||
|
|
||||||
def UnpackPackageDir(self, src, dst):
|
def UnpackPackageDir(self, src, dst):
|
||||||
"""Unpack a given directory from the OTA package into the given
|
"""Unpack a given directory from the OTA package into the given
|
||||||
@@ -173,12 +166,6 @@ class EdifyGenerator(object):
|
|||||||
p = fstab[partition]
|
p = fstab[partition]
|
||||||
self.script.append('format("%s", "%s", "%s");' %
|
self.script.append('format("%s", "%s", "%s");' %
|
||||||
(p.fs_type, common.PARTITION_TYPES[p.fs_type], p.device))
|
(p.fs_type, common.PARTITION_TYPES[p.fs_type], p.device))
|
||||||
else:
|
|
||||||
# older target-files without per-partition types
|
|
||||||
partition = self.info.get("partition_path", "") + partition
|
|
||||||
self.script.append('format("%s", "%s", "%s");' %
|
|
||||||
(self.info["fs_type"], self.info["partition_type"],
|
|
||||||
partition))
|
|
||||||
|
|
||||||
def DeleteFiles(self, file_list):
|
def DeleteFiles(self, file_list):
|
||||||
"""Delete all files in file_list."""
|
"""Delete all files in file_list."""
|
||||||
@@ -231,23 +218,6 @@ class EdifyGenerator(object):
|
|||||||
'package_extract_file("%(fn)s", "%(device)s");' % args)
|
'package_extract_file("%(fn)s", "%(device)s");' % args)
|
||||||
else:
|
else:
|
||||||
raise ValueError("don't know how to write \"%s\" partitions" % (p.fs_type,))
|
raise ValueError("don't know how to write \"%s\" partitions" % (p.fs_type,))
|
||||||
else:
|
|
||||||
# backward compatibility with older target-files that lack recovery.fstab
|
|
||||||
if self.info["partition_type"] == "MTD":
|
|
||||||
self.script.append(
|
|
||||||
('assert(package_extract_file("%(fn)s", "/tmp/%(partition)s.img"),\n'
|
|
||||||
' write_raw_image("/tmp/%(partition)s.img", "%(partition)s"),\n'
|
|
||||||
' delete("/tmp/%(partition)s.img"));')
|
|
||||||
% {'partition': partition, 'fn': fn})
|
|
||||||
elif self.info["partition_type"] == "EMMC":
|
|
||||||
self.script.append(
|
|
||||||
('package_extract_file("%(fn)s", "%(dir)s%(partition)s");')
|
|
||||||
% {'partition': partition, 'fn': fn,
|
|
||||||
'dir': self.info.get("partition_path", ""),
|
|
||||||
})
|
|
||||||
else:
|
|
||||||
raise ValueError("don't know how to write \"%s\" partitions" %
|
|
||||||
(self.info["partition_type"],))
|
|
||||||
|
|
||||||
def SetPermissions(self, fn, uid, gid, mode):
|
def SetPermissions(self, fn, uid, gid, mode):
|
||||||
"""Set file ownership and permissions."""
|
"""Set file ownership and permissions."""
|
||||||
|
Reference in New Issue
Block a user