flasher: use nanddump to avoid dep on mtdblock
[pandora-misc.git] / flasher / rootfs / etc / updater.sh
index 6c89886..8478382 100755 (executable)
@@ -96,7 +96,7 @@ done
 if [ -e u-boot.bin ]
 then
        size=`stat -c %s u-boot.bin`
-       dd if=/dev/mtdblock1 of=u-boot.bin.flashed bs=$size count=1
+       nanddump --omitoob --omitbad -q -l $size -f u-boot.bin.flashed /dev/mtd1ro
        if ! cmp u-boot.bin u-boot.bin.flashed
        then
                flash_eraseall /dev/mtd1
@@ -111,7 +111,8 @@ else
        log "u-boot is missing, skipped."
 fi
 
-if ! cmp /dev/mtdblock2 /usr/local/erasednandblk
+nanddump --omitoob --omitbad -q -f mtd2dump /dev/mtd2ro
+if ! cmp mtd2dump /usr/local/erasednandblk
 then
        flash_eraseall /dev/mtd2
        status_uboot_env="cleared"