~/android/rk3588/android12/build.sh
~/android/rk3588/android12/RKTools/linux/Linux_Pack_Firmware/rockdev/mkupdate.sh
build.sh -u -f
主要就是以下几条命令
//进入打包工具目录,并使用mkupdate.sh打包脚本,参数一为rk3588,参数二为Image
cd RKTools/linux/Linux_Pack_Firmware/rockdev && ./mkupdate.sh rk3588 Image
//产生 package-file-tmp文件,分区表
./gen-package-file.sh Image > package-file-tmp
//根据package-file-tmp打包固件,生产update.img
./afptool -pack ./ Image/update.img package-file-tmp || pause
// 最后将MiniLoaderAll加进去,系统未Android系统
./rkImageMaker -RK3588 Image/MiniLoaderAll.bin Image/update.img update.img -os_type:androidos || pause
注:rkImageMaker 与 afptool -pack是不开放源码
另外还有解包工具
~/android/rk3588/android12/RKTools/linux/Linux_Pack_Firmware/rockdev/unpack.sh
./afptool -pack ./Image/update.img || pause
// afptool(Android Firmware Package Tool)
// 当前目录有package-file,分区表
./afptool -pack ./Image/update.img || pause
------ PACKAGE ------
Add file: ./package-file
package-file,Add file: ./package-file done,offset=0x800,size=0x11a,userspace=0x1
Add file: ./Image/MiniLoaderAll.bin
bootloader,Add file: ./Image/MiniLoaderAll.bin done,offset=0x1000,size=0x661c0,userspace=0xcd
Add file: ./Image/parameter.txt
parameter,Add file: ./Image/parameter.txt done,offset=0x67800,size=0x1d5,userspace=0x1
Add file: ./Image/uboot.img
uboot,Add file: ./Image/uboot.img done,offset=0x68000,size=0x400000,userspace=0x800
Add file: ./Image/misc.img
misc,Add file: ./Image/misc.img done,offset=0x468000,size=0xc000,userspace=0x18
Add file: ./Image/boot.img
boot,Add file: ./Image/boot.img done,offset=0x474000,size=0x1ff4400,userspace=0x3fe9
Add file: ./Image/recovery.img
recovery,Add file: ./Image/recovery.img done,offset=0x2468800,size=0x1e23400,userspace=0x3c47
Add file: ./Image/rootfs.img
rootfs,Add file: ./Image/rootfs.img done,offset=0x428c000,size=0x849fd000,userspace=0x1093fa
Add CRC...
Make firmware OK!
------ OK ------
./rkImageMaker -RK3568 Image/MiniLoaderAll.bin Image/update.img update.img -os_type:androidos || pause
// 指定主控,-RK3568,-RK3588等
// 将Image目录下的miniloader与update合成rk固件(update.img),并放在当前目录
./rkImageMaker -RK3568 Image/MiniLoaderAll.bin Image/update.img update.img -os_type:androidos || pause
********rkImageMaker ver 2.0********
Generating new image, please wait...
Writing head info...
Writing boot file...
Writing firmware...
Generating MD5 data...
MD5 data generated successfully!
New image generated successfully!
./rkImageMaker -unpack update.img output || pause
./afptool -unpack output/firmware.img output || pause