View Single Post
Old 03-16-2009, 08:34 PM   #12
Osen
Member
Osen began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Mar 2009
Device: kindle 2
Quote:
Originally Posted by igorsk View Post
To make a recovery update (as opposed to OTA update) you need to create an "FB01" file. For that, change the third parameter in the make_bin() call to 1:
Code:
make_bin("update_"+name, filelist, 1, kver)
I cannot test it as I don't have a K2 but it should work.
igor, thank you for being here!

Now the bin generated was running under recovery mode. However the update was not successful. On the screen, there's a big "!". Under it it said the update was not successful and the error code is 0003. From there I can press "R" to get back to regular bootloader.

I tried your recovery bin generator with two scripts

One tried to copy the original font.properties back. The bin generated was about 128k and I enclosed it in the end.
Code:
#!/bin/sh

# diff OTA patch script 

_FUNCTIONS=/etc/rc.d/functions
[ -f ${_FUNCTIONS} ] && . ${_FUNCTIONS}


MSG_SLLVL_D="debug"
MSG_SLLVL_I="info"
MSG_SLLVL_W="warn"
MSG_SLLVL_E="err"
MSG_SLLVL_C="crit"
MSG_SLNUM_D=0
MSG_SLNUM_I=1
MSG_SLNUM_W=2
MSG_SLNUM_E=3
MSG_SLNUM_C=4
MSG_CUR_LVL=/var/local/system/syslog_level

logmsg()
{
    local _NVPAIRS
    local _FREETEXT
    local _MSG_SLLVL
    local _MSG_SLNUM

    _MSG_LEVEL=$1
    _MSG_COMP=$2

    { [ $# -ge 4 ] && _NVPAIRS=$3 && shift ; }

    _FREETEXT=$3

    eval _MSG_SLLVL=\${MSG_SLLVL_$_MSG_LEVEL}
    eval _MSG_SLNUM=\${MSG_SLNUM_$_MSG_LEVEL}

    local _CURLVL

    { [ -f $MSG_CUR_LVL ] && _CURLVL=`cat $MSG_CUR_LVL` ; } || _CURLVL=1

    if [ $_MSG_SLNUM -ge $_CURLVL ]; then
        /usr/bin/logger -p local4.$_MSG_SLLVL -t "ota_install" "$_MSG_LEVEL def:$_MSG_COMP:$_NVPAIRS:$_FREETEXT"
    fi

    [ "$_MSG_LEVEL" != "D" ] && echo "ota_install: $_MSG_LEVEL def:$_MSG_COMP:$_NVPAIRS:$_FREETEXT"
}

if [ -z "${_PERCENT_COMPLETE}" ]; then
    export _PERCENT_COMPLETE=0
fi

update_percent_complete()
{
    _PERCENT_COMPLETE=$((${_PERCENT_COMPLETE} + $1))
    update_progressbar ${_PERCENT_COMPLETE}
}

update_percent_complete 2

cp -f /mnt/us/font.properties /usr/java/lib/font.properties
ls -al /usr/java/lib > /mnt/us/ls.txt

echo "===Done==="

update_percent_complete 30


update_progressbar 100

return 0
Another is much shorter, coz I am not sure if the mounting position is the same under recovery mode.
Code:
#!/bin/sh

sed -i -e "s/,ANSI_CHARSET//g" /usr/java/lib/font.properties

return 0
Attached Thumbnails
Click image for larger version

Name:	[image-upload-109-721822.jpg].jpg
Views:	750
Size:	40.7 KB
ID:	25792  
Attached Files
File Type: bin update_fontmodrecovery.bin (128.8 KB, 542 views)

Last edited by Osen; 03-16-2009 at 08:39 PM.
Osen is offline   Reply With Quote