#!/bin/bash

echo "Erasing DTB Sectors..."
/usr/bin/flash_erase /dev/mtd0 0x180000 8
echo "Writing DTB ..."
/usr/bin/dd if=/boot/board.dtb of=/dev/mtd0 bs=64K seek=24 status=progress
echo "Erasing Kernel Sectors..."
/usr/bin/flash_erase /dev/mtd0 0x200000 0
echo "Writing Kernel.."
/usr/bin/dd if=/boot/zImage of=/dev/mtd0 bs=64K seek=32 status=progress
echo "So, there you have it"
