View Full Version : Kindle firmware update tool


igorsk
03-09-2009, 09:43 PM
I noticed that I forgot to release a script to extract Kindle firmware updates. So I decided to combine it with update maker, make it a bit more flexible and add support for K2 (though I can't test this part). The result is this script (http://skochinsky.googlepages.com/k_tool-0.1.zip).
The simplest usage is to convert a shell script to an "update" to run it on the device. For example, to add a custom screensaver (http://www.mobileread.com/forums/showpost.php?p=380345&postcount=53).
Usage:
kindle_update_tool.py e update_mmm.bin
Extract a Kindle or Kindle 2 firmware update file. Outputs a .tgz file with decrypted content.
kindle_update_tool.py m [-k2] name file1 [file2 ...]
Makes a Kindle or Kindle 2 (if -k2 specified) OTA firmware update file from the list of files.
"name" is the update file suffix (final file will be called update_name.bin).
Any file with .sh extension will be marked as a shell script to be executed.

Nate the great
03-09-2009, 10:15 PM
If anyone needs a copy of the BIN file, just ask. I'll send you a pm with the link. I won't post the link becuase we have several members who work for Amazon. I don't want Amazon to disable it.

Nate the great
03-09-2009, 10:47 PM
What is the extractor supposed to give me when I run it on the 1.2 update? I though I would get a tar.gz containing a lot of files. All that I see in it is the BIN file. Did I misunderstand your post, or did I find a bug?

igorsk
03-09-2009, 11:04 PM
1.x updates are two-stage. The OTA update extracts a "full" update which is processed after reboot. Run the script on the second bin again.
E.g. here's what is inside tgz of 1.0.4 update:

update-018-MR1-014475.bin
update-fullota.dat
update-fullota.ffs

After extracting update-018-MR1-014475.bin in turn:

bootloader
eink
ioc
scripts
utils
uImage
update-018-MR1-014475.dat
content_fs.img
initrd_fs.img
initrd-recover_fs.img
root_fs.img
list.txt

stevenmoy
03-10-2009, 01:28 AM
Cool tool. Thx.

jesse
03-10-2009, 11:26 AM
Excellent. For those who want to play around, the arm-none-linux-gnueabi toolchain from codesourcery + igorsk's update maker could be a lot of fun :)

goldfinger
03-10-2009, 10:12 PM
I have been searching for an arm compiled dropbear so that we could use ssh instead of busybox. Anyone find one or can help?

jesse
03-11-2009, 10:10 AM
I have been searching for an arm compiled dropbear so that we could use ssh instead of busybox. Anyone find one or can help?

Give me a day or two. I'll tar up my init script and compiled dropbear. :)

goldfinger
03-11-2009, 11:55 AM
Sweet. Thanks.

superzhou
03-11-2009, 08:48 PM
Hi igorsk, I have several questions about the your tools.
1, What is the ffs file? It looks like a shell script, but I remember you use .sh file before.
2, How should I set the update version? Is it created from the "name"?
3, Do I need at least two files to create the bin?(I saw a foo.bar from the screen saver example.

Thanks

clarknova
03-11-2009, 09:35 PM
1, What is the ffs file? It looks like a shell script, but I remember you use .sh file before.
Scripts (and all files) may have whatever extension you want. However, Igor's script checks for a ".sh" extension to know to set the correct permissions in the tarball. (so use .sh)
2, How should I set the update version? Is it created from the "name"?It doesn't matter. The script will set a minimum version of 0, and a maximum version of something higher than the real versions will ever see. This version is only used for the update to run, not for setting the actual software version of the Kindle.
3, Do I need at least two files to create the bin?(I saw a foo.bar from the screen saver example.That was just because I'm totally lazy and didn't feel like looking up the correct way to force the array/list type in python so that the for loop would work with a single entity. This new script works fine with a single file.

Oh, and thanks for the new script, Igor.

scotty1024
03-11-2009, 10:20 PM
I have been searching for an arm compiled dropbear so that we could use ssh instead of busybox. Anyone find one or can help?

You'll find complete arm dropbear's, key generators and scripts to setup the works over in the iLiad group here on Mobileread.

superzhou
03-12-2009, 07:45 AM
Thanks clarknova,
Now I know why my ffs file did not run last night, I guess you had changed your ffs file to 755 yourself.

I was trying to replace the font like you did. Where is the font directory now? Are they still in /usr/java/lib/fonts/ like Kindle1?
I don't remember there is a Serif font in the kindle 1 directory.

goldfinger
03-13-2009, 10:45 AM
/usr/java/lib/fonts/Caecilia_LT_66_Medium_Italic.ttf
/usr/java/lib/fonts/KindleBlackboxItalic.ttf
/usr/java/lib/fonts/Helvetica_LT_75_Bold.ttf
/usr/java/lib/fonts/KindleBlackboxBoldItalic.ttf
/usr/java/lib/fonts/KindleBlackboxRegular.ttf
/usr/java/lib/fonts/Helvetica_LT_76_Bold_Italic.ttf
/usr/java/lib/fonts/Kindle_Symbol.ttf
/usr/java/lib/fonts/Helvetica_LT_66_Medium_Italic.ttf
/usr/java/lib/fonts/Caecilia_LT_76_Bold_Italic.ttf
/usr/java/lib/fonts/Caecilia_LT_75_Bold.ttf
/usr/java/lib/fonts/Caecilia_LT_65_Medium.ttf
/usr/java/lib/fonts/Helvetica_LT_65_Medium.ttf
/usr/java/lib/fonts/Kindle_MonospacedSymbol.ttf
/usr/java/lib/fonts/KindleBlackboxBold.ttf

JSWolf
03-13-2009, 10:48 AM
And get it now before Amazon says it's illegal too.

porkupan
06-15-2009, 09:25 PM
Here is the igorsk Kindle Update Tool version with support for Kindle DX (http://projects.mobileread.com/reader/users/porkupan/kindle_update_tool.zip) (-k3). Took me about an hour to mod and test it. I know the two lines I added are a bit of ugly code, but I don't know enough Python to make it prettier. :)

If anyone is interested in the Blog Kindle (http://www.blogkindle.com/)'s Unicode Fonts hack, I have made a version for Kindle DX (http://projects.mobileread.com/reader/users/porkupan/kindle_liberation_fonts_install.zip). Personally, I am not very happy with the Kindle Unicode Fonts hacks (adding fonts in addition to native fonts and replacing entries in config files for browser and reader. I believe the Sony Reader approach was better (will see if it can be pursued for the Kindle), as it totally replaced the native fonts with the appropriate Unicode set.

Happy hacking!

sirbruce
06-15-2009, 10:03 PM
How does this work, when currently no DX version .bin file exists?

porkupan
06-15-2009, 10:23 PM
How does this work, when currently no DX version .bin file exists?
Sorry, I don't understand the question. What "DX version .bin" file need to exist for you to create your own Kinlde DX update bins? You create the updates in exactly the same manner as you did for Kindle 2. Use the -k3 option, that's all.

However, if you do brick your Kindle, it's your fault, not mine.

sirbruce
06-15-2009, 11:44 PM
I was thinking actually of extracting an existing .bin. But nevermind; you'd done a great job and it should enable clarknova to make a screensaver .bin update for the DX. :)

porkupan
06-17-2009, 02:15 PM
It was brought to my attention that the Droid Serif fonts in the distribution package from BlogKindle were invalid/broken. Kindle reader software replaced the broken fonts with the default font, which was SansSerif-Regular. To fix this issue, I replaced the bad Serif fonts with valid Android Droid fonts (http://damieng.com/blog/2007/11/14/droid-font-family-courtesy-of-google-ascender), but I could not find complete Unicode set, so I used the ones with Unicode sets up to Cyrillics (which is more or less all I needed anyway). You can download the package (http://projects.mobileread.com/reader/users/porkupan/kindle_droid_fonts_install.zip) again. I tested it with Russian Mobi texts, works fine.

I converted the Liberation fonts package into KDX as well, so it can be downloaded (http://projects.mobileread.com/reader/users/porkupan/kindle_liberation_fonts_install.zip) and tested. I believe all the Liberation fonts are valid, and they may have more Unicode sets, though they don't seem to have Chinese and Japanese characters either.

For those who need Far Eastern characters I would recommend finding a decent complete set of Serif fonts (Regular, Italic, Bold and BoldItalic) and rebuilding the Droid package with those fonts.

sungeng1
06-17-2009, 05:38 PM
[QUOTE=porkupan;495173] You can download the package (http://projects.mobileread.com/reader/users/porkupan/kindle_droid_fonts_install.zip) again. I tested it with Russian Mobi texts, works fine.

Hello porkupan,

Is the android fonts "bolder" and "darker" than Kindle DX's original fonts?

Thank you.

porkupan
06-17-2009, 08:33 PM
Is the android fonts "bolder" and "darker" than Kindle DX's original fonts?
I don't think so. But they look very nice on screen, and they've got Cyrillics and some additional character sets as well. So they are worth installing at least for some of us. :)

sungeng1
06-17-2009, 10:27 PM
hi porkupan,

I am a computer illiterate, so forgive me if I ask a silly question.

I found that the contrast ratio on my Kindle DX pretty low, and Kindle's default fonts blurry. Several websites talk about replacing the default fonts with a bolder and darker font type, for example (https://sites.google.com/a/etccreations.com/kdesignworks/).

Is it possible that you provide a package with bolder fonts? Thanks.

ted-san
06-18-2009, 07:44 AM
hi porkupan,

I am a computer illiterate, so forgive me if I ask a silly question.

I found that the contrast ratio on my Kindle DX pretty low, and Kindle's default fonts blurry. Several websites talk about replacing the default fonts with a bolder and darker font type, for example (https://sites.google.com/a/etccreations.com/kdesignworks/).

Is it possible that you provide a package with bolder fonts? Thanks.


If anyone who is experimenting with DX hacks wants to try adapting one of the fonts I optimized for the K2, drop me a note off-line. I'll send you the TTF files. This may be particularly useful for vision impaired readers as the combination of large, bold fonts and the large screen of the DX would make an ideal big-print reader.

porkupan
06-18-2009, 12:28 PM
I am a computer illiterate, so forgive me if I ask a silly question.

I found that the contrast ratio on my Kindle DX pretty low, and Kindle's default fonts blurry. Several websites talk about replacing the default fonts with a bolder and darker font type, for example (https://sites.google.com/a/etccreations.com/kdesignworks/).

Is it possible that you provide a package with bolder fonts? Thanks.
Well, I didn't find a link to any font package on K Design Works (https://sites.google.com/a/etccreations.com/kdesignworks/), only a discussion of fonts improvement techniques. I guess, the articles are addressed to Amazon - advice on how to make the fonts look better on eInk. Perhaps it will not fall on deaf ears...:rolleyes2:

I am certainly not going to design my own fonts, I don't have time for that. If someone sends me a set of fonts (Serif, Sans Serif, Monospace, each in Regular, Italic, Bold and BoldItalic), I can make an update package and put it out for everyone to download.

You can send me the link to download the TTF fonts via a PM.

porkupan
06-19-2009, 12:33 AM
Here is the update with Georgia fonts (http://projects.mobileread.com/reader/users/porkupan/kindle_georgia_fonts_install.zip) for Serif. Looks pretty nice on my KDX, I am just not sure it looks better than Droid.

sungeng1
06-19-2009, 12:57 AM
Hi,

I think this page has the font installation files (I may be wrong):

https://sites.google.com/a/etccreations.com/kdesignworks/Home/font-install-files

glyph
06-19-2009, 10:43 AM
Every script I try booting with says it fails. The .bin file is deleted when it comes back up but no changes were made. I've installed the screensaver bin which worked. Then I just put a .sh file with nothing between 2 and 100% complete except for stuff like:

cp /etc/prettyversion.txt /mnt/us/prettyversion.txt
or
ln -s / /mnt/us/rootdir
or
ls -R / > /mnt/us/dirlisting.txt

but it always fails, can someone point a noob in the right direction? I guess an SSH is where I'm headed but for now I'd settle for being able to see a snapshot of the file system. I've got 2.0.3 updated installed if that matters.

The projects I had in mind (and are maybe in work by some of you) is automounting a thumbdrive to /mnt/us on reboot if detected, and digging in to see if the location can be obtained from the 3g card.

porkupan
06-19-2009, 11:59 AM
Every script I try booting with says it fails.

but it always fails, can someone point a noob in the right direction?
Well, if you are really a noob, maybe you shouldn't be playing with the device you can rather easily brick? :rofl:

Make sure the scripts follow a certain convention (I pretty sure not all of it is needed, perhaps only the first and the last lines, but it's better to be on the safe side, right?):

#!/bin/sh

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

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

update_percent_complete 2

<do your stuff here>

update_progressbar 100

return 0

The first line tells the OS this script has to be run by shell. Make sure you save the file as a UNIX text (with UNIX line feeds, not Windows/DOS CR/LF). If you don't, the shell script will not be executed.

glyph
06-19-2009, 09:25 PM
it was the carriage returns.