-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Chore] tools.images_packer: refine previous offline_ota_image_builder to support 2 image packing mode #267
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments, please have a check!
image_version=_image_version, | ||
) | ||
) | ||
image_files[_ecu_id] = _image_fpath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_ecu_id key must be checked if the key already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated at a9edc6b. If same ECU has multiple target OTA image being specified, a warning log will be issued, and later setting will override the previous one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ota-client/tools/images_packer/__main__.py
Lines 72 to 79 in a9edc6b
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 |
… target OTA image being specified to specific ECU
… into refine/ota_image_bundle
@Bodong-Yang |
@@ -69,6 +69,13 @@ def main_build_offline_ota_image_bundle(args: argparse.Namespace): | |||
image_version=_image_version, | |||
) | |||
) | |||
if _ecu_id in image_files: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should not be warning. For the user, this is the unexpected behavior, so it should be error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I agree! This is unexpected behavior. Let me fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated at 786ef4d, now multiple images specified to the same ECU will cause the images_packer logging an error and then exit.
) | ||
) | ||
sys.exit(errno.EINVAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Description
This PR refines the
tools.offline_ota_image_builder
(renamed toimages_packer
) to explicitly provides two image packing mode(each requires different command args), which:build-cache-src
: build external cache source image and (optionally) prepare specific device as external cache source device,build-offline-ota-imgs-bundle
: build offline OTA image bundle for offline OTA.Note
fully offline OTA helper script is not yet implemented.
For detailed usage, please check
tools/images_packer/README.md
.