从NAND启动路由器
将所有固件上传到/tmp
目录
GPT_BIN=$(ls /tmp/|grep 'emmc-gpt') dd if=/tmp/${GPT_BIN} of=/dev/mmcblk0 bs=512 seek=0 count=34 conv=fsync
echo 0 > /sys/block/mmcblk0boot0/force_ro # 4MiB preloader dd if=/dev/zero of=/dev/mmcblk0boot0 bs=512 count=8192 conv=fsync RRE_LOAD=$(ls /tmp/|grep 'emmc-preloader') dd if=/tmp/${RRE_LOAD} of=/dev/mmcblk0boot0 bs=512 conv=fsync
dd if=/dev/zero of=/dev/mmcblk0 bs=512 seek=13312 count=8192 conv=fsync UBOOT=$(ls /tmp/|grep 'emmc-bl31-uboot') dd if=/tmp/${UBOOT} of=/dev/mmcblk0 bs=512 seek=13312 conv=fsync
SYSUPGRADE=$(ls /tmp/|grep 'sysupgrade') dd if=/tmp/${SYSUPGRADE} of=/dev/mmcblk0p5 bs=512 conv=fsync
刷入之后重启会自动进入恢复模式
RECOVERY=$(ls /tmp/|grep 'recovery') dd if=/tmp/${RECOVERY} of=/dev/mmcblk0p4 bs=512 conv=fsync
echo 0 > /sys/block/mmcblk0boot0/force_ro BL2_EMMC=$(ls /tmp/|grep 'bl2_emmc') dd if=/tmp/${BL2_EMMC} of=/dev/mmcblk0boot0
EMMC_BIN=$(ls /tmp/|grep 'mtk-bpi'|grep 'EMMC') dd if=/tmp/${EMMC_BIN} of=/dev/mmcblk0