Go to file
openharmony_ci 406818967d
!84 解决代码告警(master分支)
Merge pull request !84 from zhangcan42/master
2024-10-16 07:24:15 +00:00
.gitee Signed-off-by: hughes802 <h.hu@huawei.com> 2022-08-16 09:21:05 +08:00
test Signed-off-by: chenzihan <chenzihan13@huawei.com> 2023-09-26 12:04:20 +08:00
zipalign Signed-off-by: chenzihan <chenzihan13@huawei.com> 2023-07-31 10:57:53 +08:00
.gitattributes update OpenHarmony 2.0 Canary 2021-06-02 02:19:37 +08:00
blocks_manager.py fix 2024-01-24 17:56:50 +08:00
build_hmp.py add module package tools 2023-03-18 13:11:02 +08:00
build_module_img.py add module package tools 2023-03-18 13:11:02 +08:00
build_module_package.py add module package tools 2023-03-18 13:11:02 +08:00
build_pkcs7.py codex 2023-08-17 15:26:53 +08:00
build_update.py fix 2024-01-26 16:54:35 +08:00
bundle.json Signed-off-by: zhangcan42 <zhangcan42@h-partners.com> 2024-04-18 21:30:28 +08:00
code_yacc.py Signed-off-by: chenzihan <chenzihan13@huawei.com> 2022-09-14 14:51:17 +08:00
create_hashdata.py Merge https://gitee.com/openharmony/update_packaging_tools 2023-08-18 17:28:37 +08:00
create_signed_data.py codex 2023-08-17 15:26:53 +08:00
create_update_package.py codex 2023-08-17 15:26:53 +08:00
gigraph_process.py Signed-off-by: chenzihan <chenzihan13@huawei.com> 2022-09-13 15:08:57 +08:00
image_class.py fix blockdiff 2024-01-24 17:52:01 +08:00
LICENSE update OpenHarmony 2.0 Canary 2021-06-02 02:19:37 +08:00
log_exception.py Signed-off-by: chenzihan <chenzihan13@huawei.com> 2022-09-13 15:08:57 +08:00
OAT.xml 修改oat告警 2023-12-23 04:48:58 +00:00
patch_package_process.py fix conflicts 2023-07-31 13:12:22 +00:00
README_zh.md Signed-off-by: chenzihan <chenzihan13@huawei.com> 2022-10-08 16:37:20 +08:00
README.md update OpenHarmony 2.0 Canary 2021-06-02 02:19:37 +08:00
script_generator.py Merge https://gitee.com/openharmony/update_packaging_tools 2023-08-18 17:28:37 +08:00
transfers_manager.py Signed-off-by: chenzihan <chenzihan13@huawei.com> 2022-09-13 15:08:57 +08:00
unpack_updater_package.py Signed-off-by: chenzihan <chenzihan13@huawei.com> 2024-01-22 11:59:26 +08:00
update_package.py fix 2023-08-21 10:22:04 +08:00
utils.py update utils.py. 2024-10-16 06:50:53 +00:00
vendor_script.py codex 2023-08-17 15:26:53 +08:00

Packaging Tool

Introduction

The packaging tool is used to prepare an update package. It provides the following functions:

  • Creating a full update package: The update package contains only the data necessary for full image update.

  • Creating a differential update package: The update package contains only the data necessary for differential image update.

  • Creating an update package with changeable partitions: The update package contains the partition table and full image data, which are used for partition change processing and image restoration after partition change.

Directory Structure

/base/update/packaging_tools
├── lib                         # Dependency libraries of the packaging tool.
├── blocks_manager.py           # BlocksManager class for block management
├── build_update.py             # Access to the packaging tool for differential update packages
├── gigraph_process.py          # Stash for re-sorting the ActionList
├── image_class.py              # Full image and sparse image parsing
├── log_exception.py            # Global log system with custom exceptions
├── patch_package_process.py    # Differential image processing for obtaining patch difference through differential calculation on blocks
├── script_generator.py         # Update script generator
├── transfers_manager.py        # ActionInfo object creation
├── update_package.py           # Update package format management and update package writing
├── utils.py                    # Options management and related functions
└── vendor_script.py            # Extended update scripts

Description

Running environment:

  • Ubuntu 18.04 or later

  • Python 3.5 or later

  • Python library xmltodict, which is used to parse XML files and needs to be installed independently.

  • bsdiff executable program, which performs differential calculation to generate the patch package

  • imgdiff executable program, which performs differential calculation on the zip, gz, and lz4 files to generate the patch package

  • e2fsdroid executable program, which performs differential calculation to generate the map files of an image

Parameter configuration:

Positional arguments:
target_package         Target package file path.
update_package        Update package file path.
Optional arguments:
-h, --help                                                Show this help message and exit.
-s SOURCE_PACKAGE, --source_package SOURCE_PACKAGE        Source package file path.
-nz, --no_zip                                             No zip mode, which means to output update package without zip.
-pf PARTITION_FILE, --partition_file PARTITION_FILE       Variable partition mode, which means to partition list file path.
-sa {ECC,RSA}, --signing_algorithm {ECC,RSA}              Signing algorithms supported by the tool, including ECC and RSA.
-ha {sha256,sha384}, --hash_algorithm {sha256,sha384}     Hash algorithms supported by the tool, including sha256 and sha384.
-pk PRIVATE_KEY, --private_key PRIVATE_KEY                Private key file path.

Example code for creating a full update package:

python build_update.py ./target/ ./target/package -pk ./target/updater_config/rsa_private_key2048.pem

Example code for creating a differential update package:

python build_update.py -s source.zip ./target/ ./target/package -pk./target/updater_config/rsa_private_key2048.pem

Repositories Involved

Update subsystem

update_packaging_tools