RK3399 android7.1 打包固件出现问题

1、问题点

hcc@bogon:~/ops_rochchip/ops-rk3399/rk3399insdustry$ ./mkimage.sh 
TARGET_BOARD_PLATFORM=rk3399
TARGET_PRODUCT=rk3399_all
TARGET_HARDWARE=rk30board
TARGET_BUILD_VARIANT=userdebug
BOARD_SYSTEMIMAGE_PARTITION_SIZE=1610612736
BOARD_USE_SPARSE_SYSTEM_IMAGE=true
HIGH_RELIABLE_RECOVERY_OTA=false
TARGET_BASE_PARAMETER_IMAGE==device/rockchip/common/baseparameter/baseparameter_fb720.img
system filesysystem is ext4
create boot.img without kernel... done.
create recovery.img without kernel and resource... CRC32=0x567A5F61
OK
done.
create misc.img.... done.
Install wifi ko to /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system/lib/modules/
create system.img...Running:  mkuserimg.sh -s /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system.img ext4 system 1585446912 -D /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system -L system out/target/product/rk3399_all/root/file_contexts.bin
make_ext4fs -s -T -1 -S out/target/product/rk3399_all/root/file_contexts.bin -L system -l 1585446912 -a system /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system.img /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system
Creating filesystem with parameters:
    Size: 1585446912
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8064
    Inode size: 256
    Journal blocks: 6048
    Label: system
    Blocks: 387072
    Block groups: 12
    Reserved block group size: 95
Created filesystem with 3138/96768 inodes and 281030/387072 blocks
build_verity_tree -A aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system.img /tmp/tmpMWUdZa_verity_images/verity.img
system/extras/verity/build_verity_metadata.py build 1585446912 /tmp/tmpMWUdZa_verity_images/verity_metadata.img 0b2042040fc350cc65345e72874a54632660f5f6435b7d7215dfe2a9c3cb5261 aee087a5be3b982978c923f566a94613496b417f2af592639bc80d141e34dfe7 /dev/block/platform/fe330000.sdhci/by-name/system verity_signer build/target/product/security/verity.pk8
cat /tmp/tmpMWUdZa_verity_images/verity_metadata.img >> /tmp/tmpMWUdZa_verity_images/verity.img
fec -e -p 0 /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system.img /tmp/tmpMWUdZa_verity_images/verity.img /tmp/tmpMWUdZa_verity_images/verity_fec.img
cat /tmp/tmpMWUdZa_verity_images/verity_fec.img >> /tmp/tmpMWUdZa_verity_images/verity.img
append2simg /home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system.img /tmp/tmpMWUdZa_verity_images/verity.img
in=/home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system.img out=/home/hcc/ops_rochchip/ops-rk3399/rk3399insdustry/out/target/product/rk3399_all/system.img.out align=1024
Total of 393216 4096-byte output blocks in 5936 input chunks.
Exception:unpack requires a string argument of length 12
Traceback (most recent call last):
  File "device/rockchip/common/sparse_tool.py", line 183, in <module>
    main()
  File "device/rockchip/common/sparse_tool.py", line 175, in main
    print("i=%u" % (i))
UnboundLocalError: local variable 'i' referenced before assignment

2、解决方法:

rk3399insdustry/device/rockchip/common$ git diff
diff --git a/sparse_tool.py b/sparse_tool.py
index 47df687..efb1afa 100755
--- a/sparse_tool.py
+++ b/sparse_tool.py
@@ -46,7 +46,7 @@ def main():
                   % (total_blks, blk_sz, total_chunks))
             out_total_chunks = 0
             out_head = bytearray(28)
-            out_chunk = bytearray(12)
+            out_chunk = struct.pack("<2H2I", 0,0,0,0)
             chunk_struct = list(struct.unpack("<2H2I", out_chunk))
             buffer = bytearray(align_unit * 1024)
             offset = 0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值