I’m building an armbian image and want to add some partitions to the result disk. I use the post_create_partitions hook to do that. The documentation doesn’t show how to use it, so I looked at the armbian’s sources:
https://github.com/armbian/build/blob/99815c0a8880d4e04fc64742412632e1d41c1334/lib/functions/image/partitioning.sh#L206
Here they create a string and pass it to sfdisk. In my hook I do a similar row to add two partitions:
echo -ne "label:dosnsize=1Gnsize=1Gn+n" | sfdisk -a "${SDCARD}".raw --no-reread || exit_with_error "Partition fail."
But building of the image fails with message: No free sectors available.
Failed to add #3 partition: No space left on device.
How to add partitions?