Enable resizing rootfs partition on Boot

I have used 16 GB SD card to create a custom image from ubuntu server. I wanted to enable resizing boot partition at first boot whenever it is flashed on another SD card (e.g. if I flashed it to 32 GB SD Card).

I have seen some files /etc/FIRST_BOOT and resize-helper, but I don’t know how to enable it.

I know that if FIRST_BOOT then rockchip-fstab is installed which is written in /etc/rc.local.

Usually scripts such as that like the raspberry one first use fdisk to mark new partition size and then add the script call to cmdline.txt or boot.txt so its run before the root is mounted so that resize can take place.
Then after resize a reboot into normal boot as resize runs whilst unmounted.

So guessing as still waiting for mine to be delivered first boot prob checks a lock somewhere and likely call fdisk and partition to end of physical, append boot.txt is it with the resize offline script? Set the lock /var/lock/first_boot or something like and reboot.

Likely you just need to delete the lock file that is set on first boot.

resizing boot partition? The package 96boards-tools-common provides the resize-helper service, which can resize the part, but only extend the rootfs for ext4 FS(RESIZE2FS).

Ooops never read boot presumed root ext4

@jack Thanks, yes resize-helper service was there in /lib/systemd/system and was oneshot.

After enabling using systemctl enable resize-helper it resize the root partition on SD card.