#!/bin/sh
set -e

echo "Unmounting boot"
while umount /boot 2> /dev/null; do true; done

echo "Mounting boot partion"
mount /dev/mmcblk0p1 /boot

echo "Downloading firmware"
curl http://downloads.overthebox.net/bios/BIOS.V2B.fv --output /boot/BIOSUPDATE.fv

echo "Rebooting"
reboot
