GSOC boot sequence - mdubinko/gsoc-contrib GitHub Wiki

WIP FW revision 1.3

There are 3 partitions on the update image (details) plus potentially filesystems on USB and SD cards, so things get a little confusing.

SD auto_login

invoke emmc_install.sh | tee /dev/tty0

SD emmc_install

What do these fdisk inputs map to? (Especially the initial '2')

fdisk /dev/mmcblk1 with inputs 2 o n p 1 32768 131071 n p 2 131072 (another Enter) w
mkfs.vfat /dev/mmcblk1p1
mkfs.ext4 /dev/mmcblk1p2
dd from u-boot-sunxi-with-spl.bin to /dev/mmcblk1 blocksize 1024 seek 8
mount /dev/mmcblk1p1 to /mnt/emmc_p1
mount /dev/mmcblk1p2 to /mnt/emmc_p2
mount /dev/mmcblk0p3 to /mnt/uddir
copy uImage, xiegu-a20-gsoc.dtb, and boot.scr to /mnt/emmc_p1
untar /mnt/uddir/rootfs.tar to /mnt/emmc_p2
copy application files to /mnt/emmc_p2/usr/local
copy startup files to /mnt/emmc_p2/etc/init.d  (including S90bluetooth, S91gsoc, S92updatehelper)
copy config files to /mnt/emmc_p2/etc
delete local files and auto_login from /mnt/emmc_p2
echo "finished!"
reboot

S90bluetooth

Possibly stock bluez bluetooth.init

S91gsoc

In a loop, run the main app. (If it crashes, start it right up again)

S92updatehelper

Where does that tar.gz file come from?

# tf will be /dev/mmcblk0px,x=1,2,...
# usb storage will be /dev/sdxy,x=a,b,...;y=1,2,...

if /dev/sda exists, mount it to /mnt/uddir
else if /dev/mmcblk0p1 exists, mount it to /mnt/uddir
otherwise fail

if file exists /mnt/uddir/udhelper.tar.gz, unpack it with openssl and tar xvf into /mnt/uddir
otherwise fail (and delete)
run unpacked script then delete

echo "finished"