< >
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
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
< >
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
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
举报