the GUI is just here to let the user pick which release to install (we could have more than 1 OS on the SD card). Then the GUI just does the following :
burn.start(_root + "/flash -o /dev/mmcblk0");
So basically, it changes to the folder that contains the image to install and calls the 'flash' script that is in the SD root folder. The flash script is this file:
Which then does:
SCRIPTPATH=$(dirname $(readlink -f "$0") )
sudo $SCRIPTPATH/mksdcard -p partitions.txt -i $PWD -o /dev/$OUTPUT -s $((`cat /sys/block/$OUTPUT/size`/2))
The flashing really is done in the last command.
You can skip the GUI completely and directly invoke the last command from any shell script, that you can start at boot automatically. It will do the flashing automatically at boot, like you wanted.
mksdcard script can be found in https://git.linaro.org/landing-teams/working/qualcomm/db-boot-tools.git/.