Order it now! Amazon prioritizes orders on a first come, first served basis.


View Full Version : Kindle 2 fried, please help!


Osen
03-16-2009, 12:27 AM
Short version:

How can I update my Kindle 2 under recovery mode? I tried the official 2.0.1 update and updates made by igor's tool. None of them worked. Basically after I press 1 in the recovery mode, the firmware update screen was just briefly appeared (<1/2 second), with no advances in the progress bar. And the kindle went back to reboot again. And then it tried to update the firmware and fell into a infinitely reboot loop. The only way out is by forcing into the recovery mode and delete the update bin file.


Long version:

So I was using igor's script to play with my kindle 2. Then I made a bad modification of /usr/java/lib/font.properties. After the update/reboot, it seems that the mobireader app/front GUI kept crashing and reloading, probably due to the bad font.properties definition. I had access to the kindle's disk via usb during all this. So I figured that the main os was still working fine.

Then I thought, no big deal, I'll just update it with another script to roll back the font.properties. Then I was bumped into the aforementioned question. I found that I couldn't update my firmware, despite that I have access to the recovery mode.

Many thanks for any of your input!! :thanks:

superzhou
03-16-2009, 04:03 PM
How did you modify your font.properties file?

I am still playing with that. want to know where is the trap...

I only modify serif so far and keep others unchanged.

jesse
03-16-2009, 06:23 PM
Osen,

It might be interesting (if you're willing) for you to be our Amazon test case. Ring up the 800 number listed on the recovery screen and ask for help. I _assume_ they'll hand you a "start from 0" .bin file. But I don't know...

Osen
03-16-2009, 06:49 PM
To jesse,

I will do that, but not until you guys give up on me. :p. I assume there exists a complete flasher for the recovery mode too. I am just a bit concerned about my warranty if I contact them... I know I should have prepared for this when I messed with my kindle!

To superzhou

The mod I made to font.properties was
serif.0 = Caecilia_LT_65_Medium.ttf,ANSI_CHARSET
serif.1 = Droid.ttf
I was hoping that I can then use Droid font for non ANSI glyphs. I guess Kindle's JVM failed to parse the "ANSI_CHARSET" part.

superzhou
03-16-2009, 07:36 PM
I remember the ANSI_CHARSET is for windows platform only.
I have tried to put my font to serif.1, no luck to pick up the unicode font I want it to display.

jesse
03-16-2009, 07:37 PM
Really, if a recovery mode firmware update doesn't dtrt, I don't know what will. But I've only been at this kindle hacking thing a couple weeks.

Osen
03-16-2009, 07:47 PM
I remember the ANSI_CHARSET is for windows platform only.
I have tried to put my font to serif.1, no luck to pick up the unicode font I want it to display.
Yeah, I realized that after my k kicked bucket. :smack:

I tried the other way you described too and it didn't work. that's why I ventured with ansi_charset.

Osen
03-16-2009, 08:01 PM
Really, if a recovery mode firmware update doesn't dtrt, I don't know what will. But I've only been at this kindle hacking thing a couple weeks.

Can you try to run the update bin under recovery mode? There must be some unknown tricks so that the ones made by igor's script didn't run properly under recovery mode.

Correction to my first post: running bin's made by igor's script under recovery mode will make the machine fell into an infinite update/reboot loop. On the other hand, under recovery mode, office 2.0.1 update bin and clarknova's screensaver mod were simply ignored and the machine went on to boot the regular kernel.

superzhou
03-16-2009, 08:35 PM
hmm, the official bin and screen saver mod are using "ffs" instead of .sh, will it make some difference?

I was in this infinite loop before, but not for the same reason. Basically if you put your update.bin in the root directory and incorrectly select "Restart" instead of "Update your Kindle", you will get the same behavior, the only way out is delete the update bin let it boot up normally and start it again.

igorsk
03-16-2009, 08:45 PM
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:
make_bin("update_"+name, filelist, 1, kver)
I cannot test it as I don't have a K2 but it should work.

superzhou
03-16-2009, 08:48 PM
Just a thought, after your boot up into the screen shown in your photo, can you type in the update key sequence? If Kindle still accept your keybroad input, you might still go back to normal update?

Osen
03-16-2009, 09:34 PM
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:
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.
#!/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.
#!/bin/sh

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

return 0

superzhou
03-17-2009, 10:28 AM
Try to put in a dumy ls command without output to a file to see if the update "success"?

Osen
03-17-2009, 02:03 PM
Try to put in a dumy ls command without output to a file to see if the update "success"?
Nope. I even tried with a blank script and all of them failed, with error code 3. As for your previous suggestion, I tried as well. I think it is " home, menu, 3 downs, enter, menu, 2 downs, enter" to hit update. But apparently it was handled by the mobireader app so nothing happened it seemed.

wz2b
03-20-2009, 12:48 PM
The bootloader doesn't check for any held-down key that forces some kind of recovery mode?

Blog Kindle
03-23-2009, 01:16 PM
Osen,

I'm in the same boat as you are. Also tried to fiddle with fonts file and got burned.

How do you enter recovery mode on K2?

igorsk
03-23-2009, 05:50 PM
Rebooting with R held down AFAIR.

wz2b
03-23-2009, 05:51 PM
Rebooting with R held down AFAIR.

Let us know if that works please

Osen
03-23-2009, 10:00 PM
Rebooting with home key held.

HOwever the recovery mode is not helpful. At least not until we can get igor one and plead him to figure out how to construct a recovery update properly...

Blog Kindle
03-23-2009, 11:17 PM
Ok.
I'm at the same point. In recovery mode it doesn't recognize the FC02 updates, when I rolled FB01 update it tries to install it and immediately fails with error 003. I tried putting ls > /mnt/us/ls1.txt at the very start of the script and nothing happens - when I reboot the Kindle drive doesn't have ls1.txt and update bin is gone as well.

This leads to 3 possibilities:
1) /mnt/us is not mounted when the update runs, is mounted elsewhere or is not writable when the update runs (although the update itself does get deleted somehow) - LIKELY
2) ls is not available when the update runs - NOT LIKELY
3) updater refuses to run the shell script with the code. either it expects some additional metadata, checksums, etc or specific name for the script.

I assume that if we could take a look at the recovery mode image which is not part of the sources as far as I can tell we could figure out what is missing and what error 003 means.

Another thing that surfaced - is that in normal boot mode the Kindle drive is not accessible anymore - I can see the drive letter but there is no filesystem. Sometimes it would appear after several minutes - sometimes not. It's almost as if process running it is deprived of CPU.

Everything works fine in recovery mode.

I called Amazon and replacement unit is already on it's way. It's actually cool that their warranty has cross-shipping and overnight shipping.

So if I don't get anywhere by tomorrow morning I'll pack it up and ship it away. As much as I like to mess with technology I miss my books and need them for my work.

Osen
03-23-2009, 11:32 PM
Ok.
This leads to 3 possibilities:
1) /mnt/us is not mounted when the update runs, is mounted elsewhere or is not writable when the update runs (although the update itself does get deleted somehow) - LIKELY
2) ls is not available when the update runs - NOT LIKELY
3) updater refuses to run the shell script with the code. either it expects some additional metadata, checksums, etc or specific name for the script.

It has to be case 3. Just try it with a blank script and you still get Error 003.

daffy4u
03-23-2009, 11:37 PM
Everything works fine in recovery mode.

I called Amazon and replacement unit is already on it's way. It's actually cool that their warranty has cross-shipping and overnight shipping.

So if I don't get anywhere by tomorrow morning I'll pack it up and ship it away. As much as I like to mess with technology I miss my books and need them for my work.

What the did you tell them to get them to send a replacement (you don't really have to answer that :))? Maybe Osen can get a new one as well.

Blog Kindle
03-23-2009, 11:55 PM
I've tried unpacking 2.0.2 update and repacking it as FB01 update - it also fails with error 003.

There should be something special that recovery updates must have...

Will keep digging a little more...

clarknova
03-24-2009, 12:43 PM
I've tried unpacking 2.0.2 update and repacking it as FB01 update - it also fails with error 003.

There should be something special that recovery updates must have...

Will keep digging a little more...

It seems to me that there are at least three processes involved in performing the updates:

powerd - the Amazon written power management daemon (not open source), besides handling part of the screen saver implementation I suspect it's what is responsible for "Recovery mode" when it is started and the home key is held.
The Java GUI - again no source code.
Shell/Init scripts - these are the only things we can be certain of what they do without going through reams of ARM machine code, or poorly disassembled Java.


A couple things:

Can you try it with FB02 as well. The java side seems to be looking for either FB02, FC02, or FD03. Maybe that'll at least get you past the 0003 error, but probably not. For that matter, try FD03 as well.
The shell script side shows us that the FC/FD are OTA updates and cause the system to launch into runlevel 3 to perform the update, runlevel 3 is the update script which unpacks the update and runs the scripts. However, FB is noted as being a "full update" and the system simply reboots. I would wager a guess then that the FB "full update" bins are probably supposed to contain filesystem images (See Igorsk's blog about the 6 and 7 id in the original K1 update files) however I can't say for sure -- the shell scripts only work for the FC02/FD03 bundles.