It's worth noting that you don't have to necessarily change anything in the build process. As long as you plan to not insert partitions in the middle, you can:
write the image to the card
with parted, resize the root partition to whatever you want
make a new partition
If you want to have more than 4 partitions total, this works best with GPT partition table, but legacy msdos works too with a little more effort
`fsck.ext4 -f /dev/foo` where foo is the root partition
`resize2fs /dev/foo`
after you have the machine booted, you can then mkfs the new partition [you could probably do it in advance of booting the system too]
I do this regularly, b/c I typically only partition about 1/2 or 1/4 of the SD card to leave the rest for wear-leveling.
Are you trying to do this as a one-off or are you trying to do it for a dozen or more SBCs of the same type?