#!/bin/sh -e

HOST=$1
if [ -e $HOST ]; then
        HOST="192.168.113.43:8000"
fi

#ACTIVE=$(fw_printenv -c /etc/fw_env.config.spi boot-active -n)
#PART="/dev/mmcblk1p"

rm -f /tmp/boot.squashfs
wget "$HOST/HW_A20_/IMAGE_/boot.squashfs" -O /tmp/boot.squashfs || exit

dd if=/tmp/boot.squashfs of=/dev/mmcblk1p1 bs=512k conv=fsync
dd if=/tmp/boot.squashfs of=/dev/mmcblk1p2 bs=512k conv=fsync


