Here is an example script that I'm using to read the flash contents to a file
once and update it as I flash newer versions of the software:

#!/bin/sh

flashrom="flashrom"
programmer="ft2232_spi:type=openmoko,divisor=8"

contents="~/flash-contents.img"
image="$1"

if [ -z $image ]
then
        echo "Reading initial flash contents"

        timeb=$( date +%s )
        $flashrom -p $programmer -r $contents
        timea=$( date +%s )

        echo "Time: "$(( $timea - $timeb ))" seconds"
else
        echo "Writing new flash contents"

        timeb=$( date +%s )
        $flashrom -p $programmer -w $image -C $contents --noverify
        timea=$( date +%s )

        cp $image $contents

        echo "Time: "$(( $timea - $timeb ))" seconds"
fi


_______________________________________________
flashrom mailing list
flashrom@flashrom.org
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to