#!/bin/sh
#echo "Try update NAND root filesystem from uSD card ..."
echo "Try update EMMC root filesystem from TFTP ..."

emmc_format
mount /dev/mmcblk0p1 /mnt/mmcblk0p1
cd /mnt/mmcblk0p1
echo "Loading of rootfs.tar.gz from 192.168.0.2 ..."
tftp -g -b 8496 -r rootfs.tar.gz 192.168.0.2
echo "Extracting ..."
tar xzf ./rootfs.tar.gz -C /mnt/mmcblk0p1
sync
rm ./rootfs.tar.gz