[flashrom] [PATCH 0/1] Add support for reading the current flash contents from a file

Paul Kocialkowski contact at paulk.fr
Fri Dec 4 10:57:52 CET 2015


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





More information about the flashrom mailing list