[openfirmware] [commit] r2869 - cpu/x86/pc/olpc/via
repository service
svn at openfirmware.info
Mon Feb 20 08:21:57 CET 2012
Author: quozl
Date: Mon Feb 20 08:21:56 2012
New Revision: 2869
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2869
Log:
OLPC fs-verify - split for use by factory scripts, trim some comments
Modified:
cpu/x86/pc/olpc/via/fsverify.fth
Modified: cpu/x86/pc/olpc/via/fsverify.fth
==============================================================================
--- cpu/x86/pc/olpc/via/fsverify.fth Mon Feb 20 07:51:21 2012 (r2868)
+++ cpu/x86/pc/olpc/via/fsverify.fth Mon Feb 20 08:21:56 2012 (r2869)
@@ -7,12 +7,10 @@
get-hex# to /nand-block
get-hex# to #image-eblocks
open-nand
- \ #image-eblocks show-init
/nand-block /nand-page / to nand-pages/block
;
: zblocks-end: ( -- )
- \ XXX could check that everything else is erased ...
;
\ This could be a no-op ...
@@ -22,12 +20,8 @@
;
: erase-all ( -- )
- \ XXX probably should set a flag saying that unspecified blocks are expected to be ff
;
-\ We simultaneously DMA one data buffer onto NAND while unpacking the
-\ next block of data into another. The buffers exchange roles after
-\ each block.
load-base value data-buffer
: verify-hash ( hashname$ hash$ -- okay? )
@@ -48,28 +42,26 @@
safe-parse-word ( eblock# hashname$ )
safe-parse-word hex-decode ( eblock# hashname$ [ hash$ ] err? )
" Malformed hash string" ?nand-abort ( eblock# hashname$ hash$ )
-
+
verify-hash ( eblock# okay? )
-\ if show-written else show-bad then ( )
swap .d if (cr else cr then
;
previous definitions
-: fs-verify ( "devspec" -- )
- load-crypto abort" Can't load hash routines"
+: $fs-verify ( file$ -- )
+ load-crypto abort" Can't load hash routines" ( file$ )
- false to secure-fsupdate?
- safe-parse-word r/o open-file ( fd )
- abort" Can't open file" ( fd )
-
- file @ ( fd fd' )
- over file ! linefeed line-delimiter c! ( fd fd' )
- file ! ( fd )
+ false to secure-fsupdate? ( file$ )
+ r/o open-file abort" Can't open file" ( fd )
+
+ file @ ( fd fd' )
+ over file ! linefeed line-delimiter c! ( fd fd' )
+ file ! ( fd )
t-hms(
- also fs-verify-commands
- ['] include-file catch ?dup if ( x error )
+ also fs-verify-commands
+ ['] include-file catch ?dup if ( x error )
nip .error
then
previous
@@ -77,6 +69,11 @@
close-nand-ihs
)t-hms
;
+
+: fs-verify ( "devspec" -- )
+ safe-parse-word $fs-verify
+;
+
[then]
\ dev screen d# 5000 to burnin-time dend
More information about the openfirmware
mailing list