From 786ef4d160af649bf21ca82f42b5e30b34eca644 Mon Sep 17 00:00:00 2001 From: Bodong YANG Date: Tue, 26 Dec 2023 05:52:19 +0000 Subject: [PATCH] explicitly reject setting multiple OTA target image to the same ECU --- tools/images_packer/__main__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/images_packer/__main__.py b/tools/images_packer/__main__.py index c8779720f..b03a3e34e 100644 --- a/tools/images_packer/__main__.py +++ b/tools/images_packer/__main__.py @@ -70,12 +70,14 @@ def main_build_offline_ota_image_bundle(args: argparse.Namespace): ) ) if _ecu_id in image_files: - logger.warning( + logger.error( ( - f"override previously set OTA target image for ECU@{_ecu_id} " - f"from {image_files[_ecu_id]} to {_image_fpath}" + f"ERR: OTA target image for ECU@{_ecu_id} is already set to" + f"from {image_files[_ecu_id]}, please check the params" ) ) + sys.exit(errno.EINVAL) + image_files[_ecu_id] = _image_fpath else: logger.warning(f"ignore illegal image pair: {raw_pair}")