#!/bin/sh
[ -z "$2" ] && file="factory.bin" || file="$2/factory.bin"
file_size=$(wc -c < $file)
rootfs_size=$((file_size - 851968))
mtd_write -o 0 -l 851968 write $file Kernel
mtd_write -r -o 851968 -l $rootfs_size write $file RootFS
