Loading tools/releasetools/add_img_to_target_files.py +0 −12 Original line number Diff line number Diff line Loading @@ -317,11 +317,6 @@ def CreateImage(input_dir, info_dict, what, output_file, block_list=None): logger.info("creating %s.img...", what) image_props = build_image.ImagePropFromGlobalDict(info_dict, what) fstab = info_dict["fstab"] mount_point = "/" + what if fstab and mount_point in fstab: image_props["fs_type"] = fstab[mount_point].fs_type image_props["timestamp"] = FIXED_FILE_TIMESTAMP if what == "system": Loading Loading @@ -406,9 +401,6 @@ def AddUserdata(output_zip): else: user_dir = common.MakeTempDir() fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/data"].fs_type build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict) Loading Loading @@ -495,10 +487,6 @@ def AddCache(output_zip): image_props["timestamp"] = FIXED_FILE_TIMESTAMP user_dir = common.MakeTempDir() fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/cache"].fs_type build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "cache.img", OPTIONS.info_dict) Loading tools/releasetools/common.py +44 −32 Original line number Diff line number Diff line Loading @@ -393,37 +393,8 @@ def LoadInfoDict(input_file, repacking=False): makeint("boot_size") makeint("fstab_version") # We changed recovery.fstab path in Q, from ../RAMDISK/etc/recovery.fstab to # ../RAMDISK/system/etc/recovery.fstab. LoadInfoDict() has to handle both # cases, since it may load the info_dict from an old build (e.g. when # generating incremental OTAs from that build). system_root_image = d.get("system_root_image") == "true" if d.get("no_recovery") != "true": recovery_fstab_path = "RECOVERY/RAMDISK/system/etc/recovery.fstab" if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = "RECOVERY/RAMDISK/etc/recovery.fstab" else: path = os.path.join(input_file, *recovery_fstab_path.split("/")) if not os.path.exists(path): recovery_fstab_path = "RECOVERY/RAMDISK/etc/recovery.fstab" d["fstab"] = LoadRecoveryFSTab( read_helper, d["fstab_version"], recovery_fstab_path, system_root_image) elif d.get("recovery_as_boot") == "true": recovery_fstab_path = "BOOT/RAMDISK/system/etc/recovery.fstab" if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = "BOOT/RAMDISK/etc/recovery.fstab" else: path = os.path.join(input_file, *recovery_fstab_path.split("/")) if not os.path.exists(path): recovery_fstab_path = "BOOT/RAMDISK/etc/recovery.fstab" d["fstab"] = LoadRecoveryFSTab( read_helper, d["fstab_version"], recovery_fstab_path, system_root_image) else: d["fstab"] = None # Load recovery fstab if applicable. d["fstab"] = _FindAndLoadRecoveryFstab(d, input_file, read_helper) # Tries to load the build props for all partitions with care_map, including # system and vendor. Loading Loading @@ -549,6 +520,47 @@ def LoadRecoveryFSTab(read_helper, fstab_version, recovery_fstab_path, return d def _FindAndLoadRecoveryFstab(info_dict, input_file, read_helper): """Finds the path to recovery fstab and loads its contents.""" # recovery fstab is only meaningful when installing an update via recovery # (i.e. non-A/B OTA). Skip loading fstab if device used A/B OTA. if info_dict.get('ab_update') == 'true': return None # We changed recovery.fstab path in Q, from ../RAMDISK/etc/recovery.fstab to # ../RAMDISK/system/etc/recovery.fstab. This function has to handle both # cases, since it may load the info_dict from an old build (e.g. when # generating incremental OTAs from that build). system_root_image = info_dict.get('system_root_image') == 'true' if info_dict.get('no_recovery') != 'true': recovery_fstab_path = 'RECOVERY/RAMDISK/system/etc/recovery.fstab' if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = 'RECOVERY/RAMDISK/etc/recovery.fstab' else: path = os.path.join(input_file, *recovery_fstab_path.split('/')) if not os.path.exists(path): recovery_fstab_path = 'RECOVERY/RAMDISK/etc/recovery.fstab' return LoadRecoveryFSTab( read_helper, info_dict['fstab_version'], recovery_fstab_path, system_root_image) if info_dict.get('recovery_as_boot') == 'true': recovery_fstab_path = 'BOOT/RAMDISK/system/etc/recovery.fstab' if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = 'BOOT/RAMDISK/etc/recovery.fstab' else: path = os.path.join(input_file, *recovery_fstab_path.split('/')) if not os.path.exists(path): recovery_fstab_path = 'BOOT/RAMDISK/etc/recovery.fstab' return LoadRecoveryFSTab( read_helper, info_dict['fstab_version'], recovery_fstab_path, system_root_image) return None def DumpInfoDict(d): for k, v in sorted(d.items()): logger.info("%-25s = (%s) %s", k, type(v).__name__, v) Loading Loading
tools/releasetools/add_img_to_target_files.py +0 −12 Original line number Diff line number Diff line Loading @@ -317,11 +317,6 @@ def CreateImage(input_dir, info_dict, what, output_file, block_list=None): logger.info("creating %s.img...", what) image_props = build_image.ImagePropFromGlobalDict(info_dict, what) fstab = info_dict["fstab"] mount_point = "/" + what if fstab and mount_point in fstab: image_props["fs_type"] = fstab[mount_point].fs_type image_props["timestamp"] = FIXED_FILE_TIMESTAMP if what == "system": Loading Loading @@ -406,9 +401,6 @@ def AddUserdata(output_zip): else: user_dir = common.MakeTempDir() fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/data"].fs_type build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "userdata.img", OPTIONS.info_dict) Loading Loading @@ -495,10 +487,6 @@ def AddCache(output_zip): image_props["timestamp"] = FIXED_FILE_TIMESTAMP user_dir = common.MakeTempDir() fstab = OPTIONS.info_dict["fstab"] if fstab: image_props["fs_type"] = fstab["/cache"].fs_type build_image.BuildImage(user_dir, image_props, img.name) common.CheckSize(img.name, "cache.img", OPTIONS.info_dict) Loading
tools/releasetools/common.py +44 −32 Original line number Diff line number Diff line Loading @@ -393,37 +393,8 @@ def LoadInfoDict(input_file, repacking=False): makeint("boot_size") makeint("fstab_version") # We changed recovery.fstab path in Q, from ../RAMDISK/etc/recovery.fstab to # ../RAMDISK/system/etc/recovery.fstab. LoadInfoDict() has to handle both # cases, since it may load the info_dict from an old build (e.g. when # generating incremental OTAs from that build). system_root_image = d.get("system_root_image") == "true" if d.get("no_recovery") != "true": recovery_fstab_path = "RECOVERY/RAMDISK/system/etc/recovery.fstab" if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = "RECOVERY/RAMDISK/etc/recovery.fstab" else: path = os.path.join(input_file, *recovery_fstab_path.split("/")) if not os.path.exists(path): recovery_fstab_path = "RECOVERY/RAMDISK/etc/recovery.fstab" d["fstab"] = LoadRecoveryFSTab( read_helper, d["fstab_version"], recovery_fstab_path, system_root_image) elif d.get("recovery_as_boot") == "true": recovery_fstab_path = "BOOT/RAMDISK/system/etc/recovery.fstab" if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = "BOOT/RAMDISK/etc/recovery.fstab" else: path = os.path.join(input_file, *recovery_fstab_path.split("/")) if not os.path.exists(path): recovery_fstab_path = "BOOT/RAMDISK/etc/recovery.fstab" d["fstab"] = LoadRecoveryFSTab( read_helper, d["fstab_version"], recovery_fstab_path, system_root_image) else: d["fstab"] = None # Load recovery fstab if applicable. d["fstab"] = _FindAndLoadRecoveryFstab(d, input_file, read_helper) # Tries to load the build props for all partitions with care_map, including # system and vendor. Loading Loading @@ -549,6 +520,47 @@ def LoadRecoveryFSTab(read_helper, fstab_version, recovery_fstab_path, return d def _FindAndLoadRecoveryFstab(info_dict, input_file, read_helper): """Finds the path to recovery fstab and loads its contents.""" # recovery fstab is only meaningful when installing an update via recovery # (i.e. non-A/B OTA). Skip loading fstab if device used A/B OTA. if info_dict.get('ab_update') == 'true': return None # We changed recovery.fstab path in Q, from ../RAMDISK/etc/recovery.fstab to # ../RAMDISK/system/etc/recovery.fstab. This function has to handle both # cases, since it may load the info_dict from an old build (e.g. when # generating incremental OTAs from that build). system_root_image = info_dict.get('system_root_image') == 'true' if info_dict.get('no_recovery') != 'true': recovery_fstab_path = 'RECOVERY/RAMDISK/system/etc/recovery.fstab' if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = 'RECOVERY/RAMDISK/etc/recovery.fstab' else: path = os.path.join(input_file, *recovery_fstab_path.split('/')) if not os.path.exists(path): recovery_fstab_path = 'RECOVERY/RAMDISK/etc/recovery.fstab' return LoadRecoveryFSTab( read_helper, info_dict['fstab_version'], recovery_fstab_path, system_root_image) if info_dict.get('recovery_as_boot') == 'true': recovery_fstab_path = 'BOOT/RAMDISK/system/etc/recovery.fstab' if isinstance(input_file, zipfile.ZipFile): if recovery_fstab_path not in input_file.namelist(): recovery_fstab_path = 'BOOT/RAMDISK/etc/recovery.fstab' else: path = os.path.join(input_file, *recovery_fstab_path.split('/')) if not os.path.exists(path): recovery_fstab_path = 'BOOT/RAMDISK/etc/recovery.fstab' return LoadRecoveryFSTab( read_helper, info_dict['fstab_version'], recovery_fstab_path, system_root_image) return None def DumpInfoDict(d): for k, v in sorted(d.items()): logger.info("%-25s = (%s) %s", k, type(v).__name__, v) Loading