| Name | Date | Size | #Lines | LOC | ||
|---|---|---|---|---|---|---|
| .. | - | - | ||||
| vb_pub_key/ | 22-Oct-2025 | - | 5 | 4 | ||
| hvbtool.py | D | 22-Oct-2025 | 64.7 KiB | 1,584 | 1,308 | |
| readme.md | D | 22-Oct-2025 | 5.4 KiB | 107 | 48 |
readme.md
11、本工具用于HVB格式的镜像签名 2 3 - hvbtool.py 镜像签名脚本,是签名工具的执行脚本 4 5 6 72、使用方法 8 9 - hash类镜像签名 10 11 ./hvbtool.py make_hash_footer --image xxx.img //待签名镜像 12 13 --partition xxx //分区名 14 15 --partition_size 31457280 //分区大小 16 17 --pubkey xxx_pub.pem //公钥key 18 19 --privkey xxx_priv.pem //私钥key 20 21 --algorithm SHA256_RSA2048 //签名算法,目前支持SHA256_RSA2048、SHA256_RSA4096和SM2 22 23 --rollback_index //防回滚号 24 25 --rollback_location //防回滚号存放位置 26 27 --output xxx.img //签名后镜像 28 29 e.g. ./hvbtool.py make_hash_footer --image boot.img --partition boot --partition_size 31457280 --pubkey boot_pub.pem --privkey boot_priv.pem --algorithm SHA256_RSA2048/SHA256_RSA4096/SM2 --rollback_index 0 --rollback_location 1 --output ./signed_boot.img 30 31 32 33 - hashtree类镜像签名 34 35 ./hvbtool.py make_hashtree_footer --image xxx.img //待签名镜像 36 37 --partition xxx //分区名 38 39 --partition_size 3724541952 //分区大小 40 41 --pubkey xxx_pub.pem //公钥key 42 43 --privkey xxx_priv.pem //私钥key 44 45 --algorithm SHA256_RSA2048 //签名算法,目前支持SHA256_RSA2048、SHA256_RSA4096和SM2 46 47 --rollback_index //防回滚号 48 49 --rollback_location //防回滚号存放位置 50 51 --output xxx.img //签名后镜像 52 53 e.g. ./hvbtool.py make_hashtree_footer --image system.img --partition system --partition_size 3724541952 --pubkey system_pub.pem --privkey system_priv.pem --algorithm SHA256_RSA2048/SHA256_RSA4096/SM2 --rollback_index 0 --rollback_location 1 --output ./signed_system.img 54 55 56 57 - 制作rvt镜像 58 59 ./hvbtool.py mak_rvt_image --partition rvt //rvt分区 60 61 --partition_size 4194304 //分区大小 62 63 --pubkey xxx_pub.pem //公钥key 64 65 --privkey xxx_priv.pem //私钥key 66 67 --algorithm SHA256_RSA2048 //签名算法 68 69 //目前支持SHA256_RSA2048、SHA256_RSA4096和SM2 70 71 --rollback_index //防回滚号 72 73 --rollback_location //防回滚号存放位置 74 75 --chain_partition xxx:xxx.pem //校验链路的分区:公钥 76 77 //每个chain_partition表示一个分区 78 79 --output rvt.img //输出rvt镜像 80 81 82 83 e.g. ./hvbtool.py make_rvt_image --pubkey test_pub.pem --privkey test_priv.pem --partition rvt --partition_size 4194304 --algorithm SHA256_RSA2048/SHA256_RSA4096/SM2 --rollback_index 0 --rollback_location 1 --chain_partition boot:boot_xxx.pem --chain_partition ramdisk:ramdisk_xxx.pem --chain_partition eng_vendor:eng_vendor_xxx.pem --chain_partition eng_system:eng_system_xxx.pem --output ./rvt.img 84 85 86 87 - 解析hvb镜像 88 89 ./hvbtool.py parse_image --image xxx.img //待解析的hvb签名镜像 90 91 e.g. ./hvbtool.py parse_image --image odm.img 92 93 94 95 - 擦除签名镜像的footer及签名内容 96 97 ./hvbtool.py erase_image --image xxx.img //待擦除的hvb签名镜像 98 99 e.g. ./hvbtool.py erase_image --image odm.img 100 1013、注意事项 102 103 - 需要python3. 0.0以上的版本 104 - 待签名镜像可以放在任意目录,执行脚本时,传入绝对路径或相对路径皆可 105 - 执行hvbtool.py脚本时,各参数间用空格隔开,不能换行 106 107