diff --git a/tools/images_packer/README.md b/tools/images_packer/README.md index 6fc53a094..e0be9e8db 100644 --- a/tools/images_packer/README.md +++ b/tools/images_packer/README.md @@ -133,7 +133,7 @@ This image builder requires latest ota-client to be installed/accessable. The re ```bash # current folder layout: venv ota-client (venv) $ cd ota-client -(venv) $ sudo -E env PATH=$PATH python3 -m tools.image_packer build-cache-src --image-dir=./images_dir --output=t2.tar +(venv) $ sudo -E env PATH=$PATH python3 -m tools.images_packer build-cache-src --image-dir=./images_dir --output=t2.tar ``` This will build the external cache source image with images listed in `./images_dir`, and export the built image as `t2.tar` tar archive. @@ -143,17 +143,17 @@ This will build the external cache source image with images listed in `./images_ ```bash # current folder layout: venv ota-client (venv) $ cd ota-client -(venv) $ sudo -E env PATH=$PATH python3 -m tools.image_packer build-offline-ota-imgs-bundle --image=p1:p1_image.tgz:ver_20230808 --image=p2:p2_image.tgz:ver_20230808 --output=t2.tar +(venv) $ sudo -E env PATH=$PATH python3 -m tools.images_packer build-offline-ota-imgs-bundle --image=p1:p1_image.tgz:ver_20230808 --image=p2:p2_image.tgz:ver_20230808 --output=t2.tar ``` This will build the offline OTA image with `p1_image.tgz` and `p2_image.tgz`, which are for ECU `p1` and `p2`, and export the built image as `t2.tar` tar archive. -#### Usage 3: Build the external cache source image and create external cache source dev +#### Usage 3: Build the external cache source image and create external cache source device ```bash # current folder layout: venv ota-client (venv) $ cd ota-client -(venv) $ sudo -E env PATH=$PATH python3 -m tools.image_packer build-cache-src --image-dir=./images_dir --write-to=/dev/ +(venv) $ sudo -E env PATH=$PATH python3 -m tools.images_packer build-cache-src --image-dir=./images_dir --write-to=/dev/ ``` This will build the external cache source image OTA images listed in the `./images_dir`, and prepare the `/dev/` as external cache source device(ext4 filesystem labelled with `ota_cache_src`) with image rootfs exported to the filesystem on `/dev/`. @@ -183,7 +183,7 @@ optional arguments: ### `build-offline-ota-imgs-bundle` subcommand ```text -usage: images_packer build-offline-ota-imgs-bundle [-h] --image :[:] [-o ] +usage: images_packer build-offline-ota-imgs-bundle [-h] --image :[:] -o build OTA image bundle for offline OTA use. @@ -191,6 +191,7 @@ optional arguments: -h, --help show this help message and exit --image :[:] OTA image for as tar archive(compressed or uncompressed), this option can be used multiple times to include multiple images. + NOTE: if multiple OTA target image is specified for the same ECU, the later one will override the previous set one. -o , --output save the generated image bundle tar archive to . ``` diff --git a/tools/images_packer/__main__.py b/tools/images_packer/__main__.py index 867d3f144..c8779720f 100644 --- a/tools/images_packer/__main__.py +++ b/tools/images_packer/__main__.py @@ -69,6 +69,13 @@ def main_build_offline_ota_image_bundle(args: argparse.Namespace): image_version=_image_version, ) ) + if _ecu_id in image_files: + logger.warning( + ( + f"override previously set OTA target image for ECU@{_ecu_id} " + f"from {image_files[_ecu_id]} to {_image_fpath}" + ) + ) image_files[_ecu_id] = _image_fpath else: logger.warning(f"ignore illegal image pair: {raw_pair}") @@ -233,7 +240,9 @@ def command_build_offline_ota_image_bundle( "--image", help=( "OTA image for as tar archive(compressed or uncompressed), " - "this option can be used multiple times to include multiple images." + "this option can be used multiple times to include multiple images. \n" + "NOTE: if multiple OTA target image is specified for the same ECU, the later one " + "will override the previous set one." ), required=True, metavar=":[:]",