View Single Post
Old 07-30-2016, 05:45 PM   #261
aharonium
Junior Member
aharonium began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jul 2016
Device: Kindle DX
Success updating Kindle DX from 3.4 to 3.4.2

I updated my Kindle DX from version 3.4 to 3.4.2 this evening. (I used newman's guide at the top of this thread to successfully get to 3.4.). I've noticed a couple issues: 1) the Kindle freezes up sometimes coming out of sleep, and 2) it freezes everytime I try and run the browser. These issues may be due to the two patches whose updating proved problematic for me: libwebkit-1.0.so.2.5.0 and firmware.md5

I documented my steps in the hope that others have an easier time with this. They differ just a little from what newman already wrote. Please let me know if I could have done anything different or better (especially at steps 6-10). For those wanting to follow these steps, you'll need to have the USBNetwork hack functioning. I also found it super helpful to use cygwin and winscp (from my Windows environment). Thanks to everyone whose helpful write-ups and hacks made this possible!

1. I extracted the TGZ from the BIN.
Code:
kindle_update_tool.py e Update_kindle_3.4_3.4.2_B006.bin
2. I unpacked the TGZ and removed all *.sig and *.dat files

3. I renamed all the FFS extensions to SH.



4. I added the code snippet to 1725970040-2687240004.sh in my text editor (ANSI format). Reading that others had success with the swap workaround, I've also added the additional code snippet for using Busybox to create a swapfile.

Code:
#!/bin/sh
set -x
exec > /mnt/us/my-upgrade.out
exec 2> /mnt/us/my-upgrade.err
dd if=/dev/zero of=/mnt/base-us/swapfile bs=1M count=64
chmod +x /mnt/base-us/busybox
/mnt/us/busybox mkswap /mnt/base-us/swapfile
/mnt/us/busybox swapon /mnt/base-us/swapfile
5. I verified 1725970040-2687240004.sh

Code:
bash -n 1725970040-2687240004.sh
6. (OPTIONAL?) I didn't need to change the MD5 hash for /etc/fb.modes in the "rootfs_md5_list" in "rootfs_md5_list.tar.gz" from 645ec280a0ac85ac6c4672d614d7388d (on line 1244). (Thankfully!)

7. I repacked the BIN, signing it and using my kindle type (DX). Warning to folk like me who like to copy and paste long command lines: the command here is a little different from the update to 3.4. Here it is though:

Code:
kindle_update_tool.py m --dx --sign kindle_3.4.2_B006-my-log 1725970040-2687240004.sh 999999999-reboot.sh rootfs_md5_list.tar.gz update-certs.tar.gz update-patches.tar.gz
8. At some point in the past I installed Busybox from the busybox.bz2 file that newman attached to his guide. I already added the code snippet to 1725970040-2687240004.sh in STEP 4, but I saw this other piece and was curious what the output would be. (Not sure whether this is important or interesting, but I'm copying it here since it might contain useful information for other Kindle DX users.) This was the output:

Code:
[root@kindle root]# dd if=/dev/zero of=/mnt/base-us/swapfile bs=1M count=64
64+0 records in
64+0 records out
[root@kindle root]# touch /mnt/base-us/swapfile
[root@kindle root]# /mnt/us/busybox mkswap /mnt/base-us/swapfile
Setting up swapspace version 1, size = 67104768 bytes
[root@kindle root]# /mnt/us/busybox swapon /mnt/base-us/swapfile
[root@kindle root]# /mnt/us/busybox swapoff /mnt/base-us/swapfile
[root@kindle root]# dmesg | tail
arcotg_udc: I def:usi::suspend_irq - suspend_irq: usb_slave_regs->usbintr:157
arcotg_udc: I def:ubr::reset_irq - UDC Bus Reset
arcotg_udc: I def:uri::resume_irq - resume_irq: usb_slave_regs->usbintr:157
arcotg_udc: I def:upc::port_change_irq - UDC port change, speed=3
arcotg_udc: I def:mA::arcotg_vbus_draw - (mA=500)
usb0: high speed config #2: 500 mA, Ethernet Gadget, using RNDIS
mxc_keyb: I def:locked2:status=locked:
fiveway: I def:locked2:status=locked:
accelerometer: I def:lock::status=locked
Adding 65436k swap on /mnt/base-us/swapfile.  Priority:-1 extents:24 across:1432    48k
[root@kindle root]# free -m
Unknown HZ value! (92) Assume 100.
             total       used       free     shared    buffers     cached
Mem:           124        121          2          0         21         35
-/+ buffers/cache:         63         60
Swap:            0          0          0
9. I ran the update and experienced my first setback: a failure in patching mt-3/firmware.md5. There doesn't appear to be any mt-3 firmware to patch in the DX. See line 2108 of my-upgrade.err. (And here's my-upgrade.out for what it's worth.) The error:
Code:
bspatch: /opt/wan/firmware/mt-3/firmware.md5: No such file or directory
I wasn't clear on why it failed at this step. (Lack of memory? I increased the swapfile size from 64 to 256 and saw that the update failed in exactly the same place.) I commented out the firmware.md5 patching lines from 1725970040-2687240004.sh not feeling terribly confident that I was doing the right thing. (Any harm to commenting out those lines?)

10. I ran the update again and it failed at libwebkit-1.0.so.2.5.0. Per newman's guide, I performed the following steps:

A. copied out /usr/lib/libwebkit-1.0.so.2.5.0 from Kindle to my computer.

B. patched libwebkit-1.0.so.2.5.0 with bspatch using the relevant patch (no. 135) in update-patches.tar.gz
Code:
bspatch libwebkit-1.0.so.2.5.0 libwebkit-1.0.so.2.5.0.NEW 135.libwebkit-1.0.so.2.5.0.patch
C. determined what the new md5sum was for the newly patched libwebkit-1.0.so.2.5.0
Code:
md5sum libwebkit-1.0.so.2.5.0.patch.NEW
D. edited 1725970040-2687240004.sh to replace the old md5sum with the new md5sum for libwebkit-1.0.so.2.5.0 in the couple of lines it shows up there.

E. replaced the broken bspatch line in 1725970040-2687240004.sh with the following:

Code:
cp /mnt/us/libwebkit-1.0.so.2.5.0.NEW patch/usr/lib/libwebkit-1.0.so.2.5.0
F. as in STEP 5, verified 1725970040-2687240004.sh

G. copied the file to the Kindle's USB root (/mnt/base-us) and ran the update. Success!!

---
So I just want to thank newman for their initial write-up and their busybox attachment. I hope what I've detailed here is useful and not too pedantic -- please offer any corrections or improvements that you might see that might help others reading this.
Attached Thumbnails
Click image for larger version

Name:	Kindle-DX-3.4.2.jpg
Views:	668
Size:	301.9 KB
ID:	150600  

Last edited by aharonium; 07-31-2016 at 02:14 PM.
aharonium is offline   Reply With Quote