[flashrom] [patch] partial write test script

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Fri Oct 29 05:35:52 CEST 2010


On 29.10.2010 04:58, David Hendricks wrote:
> New version, more bug fixes. Thanks for Carl-Daniel for testing!
> - Restore the original ROM before beginning the second set of tests.
> - The last iteration of the second test (un-aligned partial writes) was
> causing problems on a 128KB part (emulated). I've removed it for now since
> I'm in a hurry to get out tonight.
> - Fixed a copy + paste error in the 4k aligned test layout.
> - Added $FLASHROM_PARAM to the list of parameters passed into Flashrom.
>   

Thanks! The following change to the second while loop seems to fix the
issues with 128kB flash chips for me:

# Protect against too long write
writelen=4096
if [ $((${offset} + 4096 + 4096)) -ge 131072 ]; then
        writelen=$((131072 - $((${offset} + 4096))))
        if [ ${writelen} -lt 0 ]; then
                writelen=0
        fi     
fi     
dd if=${ZERO_4K} of=${TESTFILE} bs=1 conv=notrunc seek=${offset} 2>/dev/null
dd if=${FF_4K} of=${TESTFILE} bs=1 conv=notrunc seek=$((${offset} +
4096)) count=writelen 2>/dev/null

Regards,
Carl-Daniel

-- 
http://www.hailfinger.org/





More information about the flashrom mailing list