03-Firmware_Unpacking_and_Packing

This section mainly introduces the process of unpacking and repacking RK firmware on Windows or Linux.

Windows

To be tested and improved.

Linux

Obtaining the tools

  1. Network disk path:

rk356x_data\3-SoftwareData Software Materials\Linux_Pack_Firmware.zip
  1. Linux-SDK source code path:

rk356x-linux\tools\linux\Linux_Pack_Firmware
  1. Android-SDK source code path:

rk-android13.0\RKTools\linux\Linux_Pack_Firmware

Unpacking

  1. Place the Linux_Pack_Firmware directory in your virtual machine's working directory.

$ ls Linux_Pack_Firmware/
rockdev
  1. Put the firmware to be unpacked in the rockdev directory and rename it to update.img.

$ cd Linux_Pack_Firmware/rockdev
$ mv update-rk3568-kickpi-k1-linux-debian--20250403-150845.img update.img
  1. Run the script to unpack the firmware.

$ ./unpack.sh
  1. The unpacked partition images and other files are located in:

$ ls output/
Image  MiniLoaderAll.bin  package-file  parameter.txt

After modifying or replacing the unpacked partition images, you can repack them to generate a new firmware.

Packing

After modifying the unpacked images, you can repack them.

  1. Copy the files to the corresponding paths in the rockdev directory and delete the update.img used for unpacking.

$ cp -rf output/* ./ 
$ mv parameter.txt Image/
$ mv MiniLoaderAll.bin Image/
$ rm update.img
  1. Modify the package-file to update the file paths to the actual locations of the files.

# NAME  PATH
package-file    package-file
parameter       Image/parameter.txt
bootloader      Image/MiniLoaderAll.bin
uboot   Image/uboot.img
misc    Image/misc.img
boot    Image/boot.img
recovery        Image/recovery.img
backup  RESERVED
rootfs  Image/rootfs.img
  1. Run the corresponding version script to pack the firmware.

$ ./rk356x-mkupdate.sh
  1. The packed image is located in the rockdev directory:

$ ls update.img

Last updated