[openfirmware] [commit] r2937 - in cpu: arm/olpc x86/pc/olpc/via

repository service svn at openfirmware.info
Wed Apr 4 08:25:06 CEST 2012


Author: quozl
Date: Wed Apr  4 08:25:06 2012
New Revision: 2937
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/2937

Log:
OLPC XO-1.5 XO-1.75 XO-3 - fs-save, for image copy of internal storage to a single large file on USB, SD, NFS, or CIFS.  #11753

Added:
   cpu/x86/pc/olpc/via/fssave.fth
Modified:
   cpu/arm/olpc/build-fw.fth
   cpu/x86/pc/olpc/via/fw.bth

Modified: cpu/arm/olpc/build-fw.fth
==============================================================================
--- cpu/arm/olpc/build-fw.fth	Wed Apr  4 02:57:51 2012	(r2936)
+++ cpu/arm/olpc/build-fw.fth	Wed Apr  4 08:25:06 2012	(r2937)
@@ -823,6 +823,7 @@
 alias fast-hash crypto-hash   \ fast-hash uses acceleration when available
 fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth
 fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth
+fload ${BP}/cpu/x86/pc/olpc/via/fssave.fth
 devalias fsdisk int:0
 
 \ create pong-use-touchscreen

Added: cpu/x86/pc/olpc/via/fssave.fth
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ cpu/x86/pc/olpc/via/fssave.fth	Wed Apr  4 08:25:06 2012	(r2937)
@@ -0,0 +1,50 @@
+\ Write blocks to a file
+[ifndef] fs-save
+vocabulary fs-save-commands
+also fs-save-commands definitions
+
+0 value data-buffer
+
+h# ff 0 0 rgb>565 constant saved-color          \ red
+
+: (fs-save-chunk)  ( #bytes -- )
+   data-buffer over " read" $call-nand          ( #bytes #read )
+   over <> " Read failure" ?nand-abort          ( #bytes )
+   data-buffer swap filefd fputs                ( )
+;
+
+: (fs-save)  ( -- )
+   load-base to data-buffer
+   " size" $call-nand /nand-block um/mod        ( #left-over-bytes #blocks )
+   dup show-init
+   0 do
+      /nand-block (fs-save-chunk)               ( #left-over-bytes )
+      i dup show-eblock# saved-color show-state ( #left-over-bytes )
+   loop                                         ( #left-over-bytes )
+   ?dup if                                      ( #left-over-bytes )
+      (fs-save-chunk)                           ( )
+   then                                         ( )
+;
+
+previous definitions
+
+: $fs-save  ( file$ -- )
+   open-nand                           ( file$ )
+   r/w open-file                       ( fd error? )
+   " Can't open file"  ?nand-abort     ( fd )
+   to filefd                           ( )
+   t-hms(
+   [ also fs-save-commands ]
+   ['] (fs-save) catch                 ( 0 | x error# )
+   [ previous ]
+   show-done
+   close-nand-ihs
+   )t-hms
+   throw                               ( )
+;
+
+: fs-save  ( "fs.img" -- )  \ write blocks to a file
+   safe-parse-word $fs-save
+;
+
+[then]

Modified: cpu/x86/pc/olpc/via/fw.bth
==============================================================================
--- cpu/x86/pc/olpc/via/fw.bth	Wed Apr  4 02:57:51 2012	(r2936)
+++ cpu/x86/pc/olpc/via/fw.bth	Wed Apr  4 08:25:06 2012	(r2937)
@@ -522,6 +522,7 @@
 ;
 fload ${BP}/cpu/x86/pc/olpc/via/fsupdate.fth
 fload ${BP}/cpu/x86/pc/olpc/via/fsverify.fth
+fload ${BP}/cpu/x86/pc/olpc/via/fssave.fth
 devalias fsdisk int:0
 
 fload ${BP}/ofw/inet/sntp.fth



More information about the openfirmware mailing list