Creating Custom RK3288 Rootfs Images

Prerequisites

Rockchip RK3288 firmware consists of multiple partition images. When system configurations are altered or new applications are deployed, the firmware must be regenerated. Typically, only the root filesystem (rootfs.img) requires updating; the remaining partitions can remain untouched. The official Rockchip flashing tool often fails to export images exceeding specific sector limits (such as a rootfs sector count of 0x700000 defined in parameter.txt), making alternative extraction methods necessary.

Synchronizing the Live Filesystem Over Network

Transferring the active filesystem to a host machine via rsync allows for accurate replication. This requires both the target board and the Ubuntu host to share the same local network.

Establishing Network Connectivity

If a physical display is unavailable, configure the wireless interface directly from the serial or SSH terminal. Scan for available access points:

nmcli dev wifi list

Authenticate and connect to a network:

nmcli dev wifi connect "WIFI_SSID" password "WIFI_PASSWORD"

Verify the assigned IP address to ensure network access:

ip addr show

Ensure the rsync utility and SSH daemon are correctly configured on the board to permit incoming transfers from the host machine.

Constructing the Rootfs Image

Create a directory on the host to receive the board's filesystem data, then pull the files using rsync. Once the data is localized, generate an empty image file using dd:

dd if=/dev/zero of=custom_rootfs.img bs=1M count=3000

Format the newly created file and assign a volume label:

mkfs.ext4 -L linuxroot custom_rootfs.img

Mount this image to a temporary directory and populate it with the synchronized filesystem files. After the copy completes, unmount the image and minimize its footprint:

e2fsck -f custom_rootfs.img
resize2fs -M custom_rootfs.img

Assembling the Final Firmware

Move the generated custom_rootfs.img into the unpacked Rockchip firmware directory (replacing the old rootfs). Execute the Rockchip packaging script to merge the partitions:

./mkupdate.bat

This yields the final update.img, ready to be flashed onto the device using the Rockchip flashing utility.

Modifying an Existing Image Offline

For minor configuration adjustments, manipulating an existing rootfs image directly is more efficient than a full network sync.

Create a mount point and attach the original image:

mkdir -p /media/rootfs_mount
sudo mount -o loop,rw /path/to/original_rootfs.img /media/rootfs_mount

Navigate to the mounted directory, apply the necessary file modifications, and unmount:

sudo umount /media/rootfs_mount

Proceed to rebuild and shrink the image using the same resize2fs process detailed above, followed by the final firmware packaging step.

Tags: RK3288 Rootfs Firmware Embedded Linux Rockchip

Posted on Sat, 15 Aug 2026 16:08:16 +0000 by BinaryDragon