OK3588 Buildroot 5.10.66 QT Expanding Userdate Partition

Document classification: □ Top secret □ Secret □ Internal information ■ Open

Revision History

Date

Version

Revision History

04/27/2025

V1.0

Initial Version

QT Expanding Userdate Partition

In the OK3588 Linux 5.10.66+qt system, the userdate partition is not expanded by default, resulting in the need to manually expand it each time. The following section demonstrates how to achieve automatic expansion of the userdate partition by modifying the source code.

Modification Method

Mount the image of the file system in the source code.

Source code: OK3588_Linux_fs.

$ cd linuxfs/
$ mkdir fs
$ sudo mount prebuild_rootfs.img fs/

Add file -S99Init.sh.

Add the S99Init.sh file to the /etc/init.d folder.

#!/bin/sh

start() {
/sbin/resize2fs /dev/mmcblk0p6
/sbin/resize2fs /dev/mmcblk0p8

/bin/umount /dev/mmcblk0p8 
sleep 0.1
/sbin/e2fsck  -f /dev/mmcblk0p8
sleep 0.1
tune2fs -m 1 /dev/mmcblk0p8    #Reduce the reserved partition
/bin/mount /dev/mmcblk0p8 /userdata/

sync
}

case "$1" in
        start)
                "$1";;
        *)
                echo "Usage: $0 {start}"
                exit 1
esac

Grant executable permissions:

$ sudo chmod +x S99Init.sh

Configuration file-rcS.

Add the following command to the /etc/init.d/rcS file.

#!/bin/sh


# Start all init scripts in /etc/init.d
# executing them in numerical order.
#
for i in /etc/init.d/S??* ;do

     # Ignore dangling symlinks (if any).
     [ ! -f "$i" ] && continue

     case "$i" in
        *.sh)
            # Source shell script for speed.
            (
                trap - INT QUIT TSTP
                set start
                . $i
            )
            ;;
        *)
            # No sh extension, so fork subprocess.
            $i start
            ;;
    esac
done

rm /etc/init.d/S99Init.sh && sed -i "\|/etc/init.d/rcS|d" "$0"

Mount the image of the file system in the source code.

Source code path: OK3588_Linux_fs/linuxfs

$ sudo umount fs

Finally, refer to the compilation manual for source code compilation and verification.

Add a method in the buildroot source code.

Add OK3588-linux-fs/buildroot/board/forlinx/ok3588/fs-overlay to the source code.
Simply follow the previous method of adding files on this path. You need to recompile Buildroot later.