[openfirmware] r1714 - cpu/x86/pc/olpc/via
svn at openfirmware.info
svn at openfirmware.info
Wed Jan 27 07:21:05 CET 2010
Author: rsmith
Date: 2010-01-27 07:21:04 +0100 (Wed, 27 Jan 2010)
New Revision: 1714
Modified:
cpu/x86/pc/olpc/via/assy.fth
Log:
OLPC 1.5: Add >= firmware upgrade check to assy
Modified: cpu/x86/pc/olpc/via/assy.fth
===================================================================
--- cpu/x86/pc/olpc/via/assy.fth 2010-01-27 05:42:50 UTC (rev 1713)
+++ cpu/x86/pc/olpc/via/assy.fth 2010-01-27 06:21:04 UTC (rev 1714)
@@ -2,6 +2,14 @@
visible
+\ Does a base 36 compare on the firmware versions
+\ true if $2 <= $1
+: fw-$compare ( $1 $2 -- $2>$1 )
+ base @ >r d# 36 base ! ( $1 $2 )
+ $number if exit then ( $1 n2 )
+ -rot $number if exit then ( n2 n1 )
+ pop-base u<=
+;
\ If the firmware file is on a CIFS share on the factory server, it
\ should be read-only so multiple clients can read it simultaneously.
@@ -28,9 +36,11 @@
;
: ?update-firmware ( -- )
- update-firmware? 0= if exit then
\ Exit if the existing firmware and the wanted firmware are the same
- fw-version$ wanted-fw$ nocase-$= if exit then
+ fw-version$ wanted-fw$ fw-$compare if
+ fw-version$ type ." >= " wanted-fw$ type cr
+ ." Not updating fimware" cr exit
+ then
." Updating firmware to version " fw-version$ type cr
d# 2000 ms
?enough-power
More information about the openfirmware
mailing list