fall back to MTD if no recovery.fstab is present
Needed for non-device builds (like for the emulator) to work.
Change-Id: I5fdbfb3af34821811744e8ce5bf1eff8df344c73
diff --git a/tools/releasetools/img_from_target_files b/tools/releasetools/img_from_target_files
index 1447b16..7a32621 100755
--- a/tools/releasetools/img_from_target_files
+++ b/tools/releasetools/img_from_target_files
@@ -61,10 +61,11 @@
img = tempfile.NamedTemporaryFile()
build_command = []
- if OPTIONS.info_dict["fstab"]["/data"].fs_type.startswith("ext"):
+ fstab = OPTIONS.info_dict["fstab"]
+ if fstab and fstab["/data"].fs_type.startswith("ext"):
build_command = ["mkuserimg.sh",
user_dir, img.name,
- OPTIONS.info_dict["fstab"]["/data"].fs_type, "userdata"]
+ fstab["/data"].fs_type, "userdata"]
if "userdata_size" in OPTIONS.info_dict:
build_command.append(str(OPTIONS.info_dict["userdata_size"]))
else:
@@ -109,10 +110,11 @@
pass
build_command = []
- if OPTIONS.info_dict["fstab"]["/system"].fs_type.startswith("ext"):
+ fstab = OPTIONS.info_dict["fstab"]
+ if fstab and fstab["/system"].fs_type.startswith("ext"):
build_command = ["mkuserimg.sh",
os.path.join(OPTIONS.input_tmp, "system"), img.name,
- OPTIONS.info_dict["fstab"]["/system"].fs_type, "system"]
+ fstab["/system"].fs_type, "system"]
if "system_img" in OPTIONS.info_dict:
build_command.append(str(OPTIONS.info_dict["system_size"]))
else: