06-26-2011, 01:27 AM | #1 |
Kindle Dissector
Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Custom kernel for Kindle 3
When I made the 3.1 updater for K2/DX, I included a custom kernel that allows people to recover from potential bad flashes. Some people asked me for a similar thing for the Kindle 3, so I made one. The patches are the same as described here, but the offsets and stuff are different.
Basically, this kernel adds the following recovery features: -Export entire filesystem (including linux rootfs) to the USB from the recovery menu with Alt+E -Install custom recovery packages signed with the jailbreak keys (to make a custom recovery package, copy the Kindle rootfs using "dd if=/dev/mmcblk0p1 of=/mnt/us/rootfs.img", then you can mount the image and modify it on your computer (if you want). After your done, gzip rootfs.img, sign it using the jailbreak key and package rootfs.img.gz and rootfs.img.gz.sig into an update. Change the first 4 bytes of the header from "FC02" to "FB02" and you're done. If you don't know what this is or how it's useful, it's not for you. This is for people who want to mess with the kindle filesystem, but are afraid of bricking. A safety net for those people. With this kernel, you can pretty much recover from most "bricks" (bad fonts, deleted system files, etc) in the future without the need to access the serial port. The only exceptions are if you broke the bootloader or the kernel. Also if you somehow wiped the rootfs clean, you can upload this kernel via recovery serial and make a recovery package with a backup rootfs.img. I may also add additional linux features if I have time and if there are any that people want. The kindle comes with a pretty bare linux kernel. Oh, and so far, it's only for Kindle 3.1. I don't have a KSO, so I can't test 3.2/3.2.1. Download http://yifan.lu/p/kindle-custom-kernel EDIT: seaniko7 has modified this to work with the 3.3 kernel: https://www.mobileread.com/forums/sho...1&postcount=45 Last edited by yifanlu; 10-30-2011 at 09:40 PM. |
06-26-2011, 05:28 AM | #2 |
Time Waster
Posts: 422
Karma: 289160
Join Date: May 2011
Device: Kobo Glo and Aura HD
|
Great idea. Where can I find the source code? You should create a project on github so if people want to help it becomes really easier...
|
Advert | |
|
06-26-2011, 06:56 AM | #3 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,011
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
Thank you so much yifanlu. And also, nicely documented on your blog. |
|
06-26-2011, 01:08 PM | #4 |
Kindle Dissector
Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
|
06-28-2011, 05:13 PM | #5 | |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,011
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
Spoiler:
and now have a update_k3w-restore-rootfs-v3.1.bin for the future.
But it is the first time that I prepare an update package and I have (too many) questions. The bin file has the expected FB02 header -- thanks to the fb parameter of the python update tool -- with 00 padding up to hex 20000, so it appears to be using the expected block size of decimal 131072 Does that look correct to you for an manual update? The package only consists of an image with its jailkey signed file. I am afraid to test it and not quite ready to risk bricking my Kindle. When I go to the Recovery menu pressing ENTER at Boot time (per version 3.1 of my Kindle 3 WiFi) I get the recovery screen: but even after installing the recovery kernel, pressing E did not seem to do anything. And when plugging the USB to the computer, Windows did not see a file system (and foolishly asked me if I wanted to format the device) so I am wondering if pressing U will give me the chance in the future to copy the restore-rootfs.bin file before rebooting by pressing R to exit from recovery. I also read ALT+E was rather required, I tried it with the same results. How long should one wait for the export to complete? And where will the file be created if I can't connect the USB to the computer. Finaly, I am not reassured by the description of option U which suggests that both the file system *and* the kernel will be updated... since my package only contains the file system. |
|
Advert | |
|
06-28-2011, 05:58 PM | #6 |
Time Waster
Posts: 422
Karma: 289160
Join Date: May 2011
Device: Kobo Glo and Aura HD
|
rootfs is an ext2 filesystem, maybe you can't see it because windows doesn't recognize it? just a guess though... try under an ubuntu livecd...
|
06-28-2011, 06:07 PM | #7 | |
Kindle Dissector
Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Quote:
You need an ext2 compatible OS to see the filesystem exported by Alt+E. Pressing "U" will only update the kernel if it finds it in the .bin package. |
|
06-28-2011, 09:30 PM | #8 | |||
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
Posts: 3,011
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
Quote:
Quote:
Quote:
Thanks to you both. |
|||
06-28-2011, 10:42 PM | #9 | |
Kindle Dissector
Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Quote:
|
|
07-08-2011, 04:11 AM | #10 |
Junior Member
Posts: 8
Karma: 10
Join Date: Mar 2011
Device: kindle 3 3g
|
hello yifanlu:
my k3g is brick,rootfs is bad .How can I apply to your program?i have a img "mmcblk0p1",You can make a tutorial?Thank you very much.my English is a google translation. ************************************************** * Menu ==== 3. Load MMC0 over USB storage 4. Erase MMC0 I. Initialize Partition Table (fdisk) and format FAT O. Format and overwrite FAT partition E. Export FAT partition U. Update using update*.bin file on FAT partition M. Update using update*.bin file on FAT partition of second MMC port D. dmesg / kernel printk ring buffer. Q. quit Choose: 8 \ # my choose "U" /dev/mmcblk0p4: CHS=4/16/101575 size=3328409600 bytes flag type first last lba first lba size Partition p1: 0x00 0x0b 24072 <large> 7688 6493112 CHS: 376/0/9 - <large> Partition p2: Partition p3: Partition p4: INFO:Setup loop device /dev/loop0 for /dev/mmcblk0p4 + 3936256 INFO:Found update_kindle_3.1_custom_kernel_k3g.bin INFO:Skipping battery charge check INFO:Found bundle /mnt-us/update_kindle_3.1_custom_kernel_k3g.bin INFO:*** NORMAL MODE *** CHECKING /mnt-us/update_kindle_3.1_custom_kernel_k3g.bin *** INFO:do_unbundle: filename=/mnt-us/update_kindle_3.1_custom_kernel_k3g.bin, new_file=0x0000db70 ERROR:OTA bundles are not supported.ERROR:do_unbundle: parse_sysbundle_header failed with error code 22 ERROR:Could not unbundle /mnt-us/update_kindle_3.1_custom_kernel_k3g.bin INFO:removing /mnt-us/update_kindle_3.1_custom_kernel_k3g.bin ************************************************** * Last edited by zrenyi; 07-08-2011 at 09:23 AM. |
07-11-2011, 02:16 AM | #11 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Mar 2011
Device: kindle 3 3g
|
Quote:
I do not see how this map? How to access to / dev/sdc1? Last edited by zrenyi; 07-11-2011 at 02:19 AM. |
|
07-11-2011, 02:29 AM | #12 | |
Kindle Dissector
Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
Quote:
|
|
07-15-2011, 03:12 AM | #13 |
Hardware Tweaker
Posts: 43
Karma: 28
Join Date: Oct 2010
Device: K3-Wifi
|
@yifanlu
As one of the people requested the K3 Kernel: Thanks!! This is awesome! |
07-19-2011, 01:10 AM | #14 |
Zealot
Posts: 135
Karma: 5555611
Join Date: Jul 2011
Device: Kindle Keyboard 3G, Nexus 7
|
|
07-19-2011, 01:30 AM | #15 |
Kindle Dissector
Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Compiling the Linux Kernel for the Kindle | yifanlu | Kindle Developer's Corner | 82 | 12-12-2016 10:35 PM |
extract initramfs from kindle dx kernel image | chinaet | Kindle Developer's Corner | 16 | 04-19-2013 01:16 PM |
Can custom book data be displayed in a custom column? | kiwidude | Development | 9 | 03-02-2011 06:35 AM |
Observations from Kindle 2 kernel sources | TadW | Kindle Developer's Corner | 3 | 03-13-2009 06:29 PM |
iLiad Kernel 2.6 | Jaapjan | iRex Developer's Corner | 6 | 09-01-2008 07:17 AM |