[oe-issues] [Bug 1526] One updater.sh to rule all PXA Zaurus models

bugzilla-daemon at tinman.treke.net bugzilla-daemon at tinman.treke.net
Sun Nov 18 18:13:03 UTC 2007


http://bugs.openembedded.org/show_bug.cgi?id=1526





--- Comment #9 from Koen Kooi <koen at openembedded.org>  2007-11-18 10:13:03 ---
The diff:

Powerbook-2:tmp koen$ diff -Nurd attachment.cgi\?id\=3186
attachment.cgi\?id\=3332 
--- attachment.cgi?id=3186      2007-11-18 19:11:18.000000000 +0100
+++ attachment.cgi?id=3332      2007-11-18 19:11:17.000000000 +0100
@@ -7,14 +7,13 @@
 # 2007.10.08 Marcin 'Hrw' Juszkiewicz
 # - do not allow to flash files bigger then partition size
 # - created functions for common stuff
+# 2007.11.18 Dmitry 'Lumag' Baryshkov
+# - fixes
 #
 # Totally untested!!!
 # 

-/bin/sh
-
 DATAPATH=$1
-
 TMPPATH=/tmp/update
 TMPDATA=$TMPPATH/tmpdata.bin
 TMPHEAD=$TMPPATH/tmphead.bin
@@ -135,12 +134,21 @@

 do_flashing()
 {
-    if [ $DATASIZE > $MTD_PART_SIZE ]
+    if [ $DATASIZE -gt $MTD_PART_SIZE ]
     then
        echo "ERROR: File is too big to flash!"
        return
     fi

+    #check version
+    /sbin/bcut -s 6 -o $TMPDATA $TMPHEAD
+    if [ `cat $TMPDATA` != "SHARP!" ] > /dev/null 2>&1
+    then
+       #no version info...
+       rm -f $TMPHEAD > /dev/null 2>&1
+       DATAPOS=0
+    fi
+
     if [ $ISFORMATTED = 0 ]
     then
        echo -n 'Flash erasing...'
@@ -275,14 +283,14 @@
     if [ ! -e $TARGETFILE ]
     then
        continue
-    done
+    fi

     rm -f $TMPPATH/*.bin > /dev/null 2>&1
     DATASIZE=`wc -c $TARGETFILE`
     DATASIZE=`echo $DATASIZE | cut -d' ' -f1`

     # make TARGETFILE lowercase
-    TARGETFILE=`echo $TERGETFILE|tr A-Z a-z`
+    TARGETFILE=`echo $TARGETFILE|tr A-Z a-z`

     case "$TARGETFILE" in

@@ -318,9 +326,8 @@
         ADDR=0
         ISFORMATTED=0
         TARGET_MTD=$RO_MTD
-        DATAPOS=0
-        ONESIZE=1048576
         DATAPOS=16
+        ONESIZE=1048576
         /sbin/bcut -s 16 -o $TMPHEAD $TARGETFILE
         do_flashing


-- 
Configure bugmail: http://bugs.openembedded.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.




More information about the Openembedded-issues mailing list