[flashrom] [PATCH] dummyflasher.c: add an "empty" parameter and initialize with random bytes by default

Uwe Hermann uwe at hermann-uwe.de
Fri Jul 22 12:54:27 CEST 2011


On Thu, Jul 21, 2011 at 11:55:32PM +0200, Stefan Tauner wrote:
> On Thu, 21 Jul 2011 23:27:34 +0200
> Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net> wrote:
> 
> > Am 21.07.2011 17:54 schrieb Stefan Tauner:
> > > previously the dummies were initialized to be empty (all ones), which makes writes skip
> > > erasing altogether. with this patch the default is to fill it with random bytes instead and the
> > > old behavior can be enforced with stating "empty=yes" on the command line.
> > >
> > > Signed-off-by: Stefan Tauner <stefan.tauner at student.tuwien.ac.at>
> > >   
> > 
> > Does the following not work for you?
> > 
> > dd if=/dev/urandom bs=1k count=4k of=oldimage.bin
> > flashrom -p dummy:emulate=SST25VF032B,image=oldimage.bin -w newimage.bin

Works fine here, but having a commandline option such as the
"content=..." in the updated patch is worthwhile IMHO, it saves the user
quite some unneeded hassle to create dummy images on a filesystem,
which is possibly even a bit harder on DOS or elsewhere due to missing
dd and so on. Also in the qflashrom GUI I'd personally like to be able
to present the user with a drop-down of possible dummy chip contents
(which are autogenerated by libflashrom).

The "image=" option should stay of course, it's very useful too, e.g.
for specially crafted test images etc. But for a few simple cases such
as 0x00, 0xff, random, etc. the "content=" option makes sense, IMHO.


> did i mention that the man page needs an update? :P

That too, yes.


Uwe.
-- 
http://hermann-uwe.de     | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org




More information about the flashrom mailing list