[onerng talk] Firmware verification failed, on move to other system

James Cameron quozl at laptop.org
Mon Apr 20 00:45:39 BST 2015


I've found the cause.  It is timing, and hardware specific.

onerng.sh uses dd to read the image, with a fixed wait before the dd
is stopped and the image is verified.

Your wait in onerng.sh was too short for my hardware.  Increased it to
3.5 seconds and it works fine.

I've tested a range of waits.  See attached graph for plot, and raw
data below.  There's some randomness, but a clear trend.

The dd is CPU intensive; lots of one byte reads.  My system has a lot
of context switching by network applications, but a load average of
only 0.10.

But this extra delay is only needed on one of my systems, and is not a
good idea for everybody.  A more correct method may be to move the
command negotiation and image reading into the python script and use a
timeout on the reads; that way it should complete within minimum time.

It would also be more resilient against an insertion while a system is
heavily used by other tasks.


wait	image-length	dd-size	exit-status

0.5     39809   39950   0
0.55    48093   48234   0
0.6     40068   48017   0
0.65    59920   60061   0
0.7     56026   56167   0
0.75    51329   59278   0
0.8     71898   72039   0
0.85    62109   70058   0
0.9     72834   72975   0
0.95    80539   80680   0
1.0     87614   87755   0
1.05    83944   91893   0
1.1     87551   87692   0
1.15    91320   99013   0
1.2     110872  111013  0
1.25    104693  104834  0
1.3     106186  106327  0
1.35    117558  117699  0
1.4     115525  123346  0
1.45    117031  117172  0
1.5     133443  133584  0
1.55    134188  134329  0
1.6     141009  141150  0
1.65    132537  132678  0
1.7     152318  152459  0
1.75    148965  149106  0
1.8     141362  141503  0
1.85    167831  167972  0
1.9     163320  171397  0
1.95    177207  177348  0
2.0     0       170374  0
2.05    185682  185823  0
2.1     182141  182282  0
2.15    194020  194161  0
2.2     175477  175618  0
2.25    201264  201405  0
2.3     192690  192831  0
2.35    215655  215796  0
2.4     196095  196236  0
2.45    209664  209805  0
2.5     217304  225381  0
2.55    212524  212665  0
2.6     210794  218871  0
2.65    223780  223921  0
2.7     236893  244970  0
2.75    214855  214996  0
2.8     233200  233341  0
2.85    262144  263710  1
2.9     246872  247013  0
2.95    248052  248193  0
3.0     262144  272140  1
3.05    262144  283773  1
3.1     254508  254649  0
3.15    262144  275617  1
3.2     262144  283507  1
3.25    262144  267198  1
3.3     262144  266860  1
3.35    262144  266924  1
3.4     262144  273949  1
3.45    262144  299273  1
3.5     262144  321305  1
3.55    262144  292574  1

p.s. also found that onerng.sh is called twice on device add, once
with $1 set to 1-6.1.2 and once with it set to ttyACM0.  The first
call is ignored because [ ! -c /dev/1-6.1.2 ] is true.  Maybe the udev
rule could do with a tweak.  No impact.

-- 
James Cameron
http://quozl.linux.org.au/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 7696 bytes
Desc: not available
URL: <http://lists.ourshack.com/pipermail/discuss/attachments/20150420/c973291f/attachment.png>


More information about the Discuss mailing list