Loading tools/releasetools/ota_from_target_files.py +10 −4 Original line number Diff line number Diff line Loading @@ -1124,17 +1124,18 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): additional_args += ["--enable_lz4diff=" + str(OPTIONS.enable_lz4diff).lower()] env_override = {} if source_file and OPTIONS.enable_lz4diff: input_tmp = common.UnzipTemp(source_file, ["META/liblz4.so"]) liblz4_path = os.path.join(input_tmp, "META", "liblz4.so") liblz4_path = os.path.join(source_file, "META", "liblz4.so") assert os.path.exists( liblz4_path), "liblz4.so not found in META/ dir of target file {}".format(liblz4_path) logger.info("Enabling lz4diff %s", liblz4_path) additional_args += ["--liblz4_path", liblz4_path] erofs_compression_param = OPTIONS.target_info_dict.get( "erofs_default_compressor") assert erofs_compression_param is not None, "'erofs_default_compressor' not found in META/misc_info.txt of target build. This is required to enable lz4diff." additional_args += ["--erofs_compression_param", erofs_compression_param] env_override["LD_PRELOAD"] = liblz4_path + \ ":" + os.environ.get("LD_PRELOAD", "") if OPTIONS.disable_vabc: additional_args += ["--disable_vabc=true"] Loading @@ -1144,10 +1145,15 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): additional_args += ["--compressor_types", OPTIONS.compressor_types] additional_args += ["--max_timestamp", max_timestamp] env = dict(os.environ) if env_override: logger.info("Using environment variables %s", env_override) env.update(env_override) payload.Generate( target_file, source_file, additional_args + partition_timestamps_flags additional_args + partition_timestamps_flags, env=env ) # Sign the payload. Loading tools/releasetools/ota_utils.py +6 −5 Original line number Diff line number Diff line Loading @@ -845,16 +845,16 @@ class PayloadGenerator(object): self.is_partial_update = is_partial_update self.spl_downgrade = spl_downgrade def _Run(self, cmd): # pylint: disable=no-self-use def _Run(self, cmd, **kwargs): # pylint: disable=no-self-use # Don't pipe (buffer) the output if verbose is set. Let # brillo_update_payload write to stdout/stderr directly, so its progress can # be monitored. if OPTIONS.verbose: common.RunAndCheckOutput(cmd, stdout=None, stderr=None) common.RunAndCheckOutput(cmd, stdout=None, stderr=None, **kwargs) else: common.RunAndCheckOutput(cmd) common.RunAndCheckOutput(cmd, **kwargs) def Generate(self, target_file, source_file=None, additional_args=None): def Generate(self, target_file, source_file=None, additional_args=None, **kwargs): """Generates a payload from the given target-files zip(s). Args: Loading @@ -863,6 +863,7 @@ class PayloadGenerator(object): generating a full OTA. additional_args: A list of additional args that should be passed to delta_generator binary; or None. kwargs: Any additional args to pass to subprocess.Popen """ if additional_args is None: additional_args = [] Loading Loading @@ -918,7 +919,7 @@ class PayloadGenerator(object): if self.is_partial_update: cmd.extend(["--is_partial_update=true"]) cmd.extend(additional_args) self._Run(cmd) self._Run(cmd, **kwargs) self.payload_file = payload_file self.payload_properties = None Loading Loading
tools/releasetools/ota_from_target_files.py +10 −4 Original line number Diff line number Diff line Loading @@ -1124,17 +1124,18 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): additional_args += ["--enable_lz4diff=" + str(OPTIONS.enable_lz4diff).lower()] env_override = {} if source_file and OPTIONS.enable_lz4diff: input_tmp = common.UnzipTemp(source_file, ["META/liblz4.so"]) liblz4_path = os.path.join(input_tmp, "META", "liblz4.so") liblz4_path = os.path.join(source_file, "META", "liblz4.so") assert os.path.exists( liblz4_path), "liblz4.so not found in META/ dir of target file {}".format(liblz4_path) logger.info("Enabling lz4diff %s", liblz4_path) additional_args += ["--liblz4_path", liblz4_path] erofs_compression_param = OPTIONS.target_info_dict.get( "erofs_default_compressor") assert erofs_compression_param is not None, "'erofs_default_compressor' not found in META/misc_info.txt of target build. This is required to enable lz4diff." additional_args += ["--erofs_compression_param", erofs_compression_param] env_override["LD_PRELOAD"] = liblz4_path + \ ":" + os.environ.get("LD_PRELOAD", "") if OPTIONS.disable_vabc: additional_args += ["--disable_vabc=true"] Loading @@ -1144,10 +1145,15 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None): additional_args += ["--compressor_types", OPTIONS.compressor_types] additional_args += ["--max_timestamp", max_timestamp] env = dict(os.environ) if env_override: logger.info("Using environment variables %s", env_override) env.update(env_override) payload.Generate( target_file, source_file, additional_args + partition_timestamps_flags additional_args + partition_timestamps_flags, env=env ) # Sign the payload. Loading
tools/releasetools/ota_utils.py +6 −5 Original line number Diff line number Diff line Loading @@ -845,16 +845,16 @@ class PayloadGenerator(object): self.is_partial_update = is_partial_update self.spl_downgrade = spl_downgrade def _Run(self, cmd): # pylint: disable=no-self-use def _Run(self, cmd, **kwargs): # pylint: disable=no-self-use # Don't pipe (buffer) the output if verbose is set. Let # brillo_update_payload write to stdout/stderr directly, so its progress can # be monitored. if OPTIONS.verbose: common.RunAndCheckOutput(cmd, stdout=None, stderr=None) common.RunAndCheckOutput(cmd, stdout=None, stderr=None, **kwargs) else: common.RunAndCheckOutput(cmd) common.RunAndCheckOutput(cmd, **kwargs) def Generate(self, target_file, source_file=None, additional_args=None): def Generate(self, target_file, source_file=None, additional_args=None, **kwargs): """Generates a payload from the given target-files zip(s). Args: Loading @@ -863,6 +863,7 @@ class PayloadGenerator(object): generating a full OTA. additional_args: A list of additional args that should be passed to delta_generator binary; or None. kwargs: Any additional args to pass to subprocess.Popen """ if additional_args is None: additional_args = [] Loading Loading @@ -918,7 +919,7 @@ class PayloadGenerator(object): if self.is_partial_update: cmd.extend(["--is_partial_update=true"]) cmd.extend(additional_args) self._Run(cmd) self._Run(cmd, **kwargs) self.payload_file = payload_file self.payload_properties = None Loading