08-14-2009, 07:53 AM | #1 |
Member
Posts: 14
Karma: 84
Join Date: Sep 2006
Device: iliad Kindle DX
|
extract initramfs from kindle dx kernel image
Code:
dd if=/dev/mtd1ro of=uImage bs=1024 count=3584 dd if=uImage of=img.gz bs=1 skip=$((0x32a0)) gunzip img.gz dd if=img of=initramfs.cpio.gz bs=1 skip=$((0x14a40)) Last edited by chinaet; 08-23-2009 at 06:12 PM. |
08-15-2009, 03:36 AM | #2 |
Guru
Posts: 695
Karma: 2383012
Join Date: Aug 2007
Location: Schiedam (The Netherlands)
Device: Lots of eInk devices and iOS stuff
|
Forgive my ignorance of Linux. And what is it for?
|
Advert | |
|
08-15-2009, 09:07 AM | #3 |
Member
Posts: 14
Karma: 84
Join Date: Sep 2006
Device: iliad Kindle DX
|
Kindle dx kernel embedded initramfs filesystem.just for developer
|
08-16-2009, 04:08 AM | #4 |
Zealot
Posts: 100
Karma: 629
Join Date: Jun 2009
Location: California, USA
Device: Kindle DX
|
initramfs is a very basic filesystem which is embedded in kernel image itself. In this particular case it's used as a bootstrap to boot full fs off the NAND flash and the main purpose for this two stage boot is recovery and full update when main fs in NAND gets hosed.
|
08-18-2009, 09:15 AM | #5 |
Guru
Posts: 695
Karma: 2383012
Join Date: Aug 2007
Location: Schiedam (The Netherlands)
Device: Lots of eInk devices and iOS stuff
|
Thank you, ebs!
|
Advert | |
|
09-23-2009, 01:05 PM | #6 | |
Junior Member
Posts: 1
Karma: 10
Join Date: Sep 2009
Device: none
|
How did you figure out the offsets?
Quote:
Thanks! |
|
08-20-2010, 04:48 AM | #7 |
Member
Posts: 12
Karma: 152738
Join Date: Jul 2010
Device: Kindle DXG
|
initramfs from uImage
As chinaet already implied, the newer Kindles use an initramfs instead of an initrd. The Kindle's initramfs is linked statically into the Kernel image.
In this post I will describe how I managed to get the uImage from the device and extracted the initramfs from it. Part 1: Get uImage from device There are multiple ways to do this. chinaet use /dev/mtd1ro, but you can also fetch a memory dump from U-Boot if you have a serial connection to your Kindle(which will give you bootloader access). Here are the instructions for fetching the uImage from the boot loader:
Part 2: Extract initramfs from uImage
Last edited by choff; 03-21-2012 at 01:07 PM. |
08-22-2010, 11:00 PM | #8 |
Kindle Dissector
Posts: 662
Karma: 475607
Join Date: Jul 2010
Device: Amazon Kindle 3
|
I don't know which kindle version you're working with, but for extracting The uImage, all I had to do was download a fw upgrade from amazon, extract it, open the firmware upgrade script in a text editor and look at how it backs up the script (offsets are given in script). Or even easier (if you know how to use dd, view /test/firmware-tools/flash-kernel-1.sh (or something), get the offsets, and use dd from SSH.
|
08-23-2010, 04:34 AM | #9 | |
Member
Posts: 12
Karma: 152738
Join Date: Jul 2010
Device: Kindle DXG
|
Quote:
I fiddled with the root filesystem until all of a sudden my Kindle wouldn't boot any more. Since there are no firmware updates for the DXG out yet, all I could do was get the uImage from U-Boot directly. I modified the initramfs a bit in order to mount a filesystem image on the large 3Gb USB-accessible partition and was able to get a regular Debian Linux to run, but I will blog about that later when everything is up and running. |
|
08-23-2010, 01:57 PM | #10 |
Member
Posts: 22
Karma: 12
Join Date: Jul 2010
Device: Kindle 3
|
|
10-24-2012, 08:04 PM | #11 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
|
|
10-24-2012, 08:11 PM | #12 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Looks very familar:
http://minimodding.com/BinaryDecomposition With minor changes in the choice of binary search commands. But that is *nix in general, there are always multiple ways to do the same thing. |
10-24-2012, 08:38 PM | #13 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Quote:
|
|
10-24-2012, 08:51 PM | #14 |
Going Viral
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Three?
OK, here is the third: http://minimodding.com/FirmwareComparison - - - - It has been years since I had a real life. |
04-19-2013, 02:28 AM | #15 |
Connoisseur
Posts: 97
Karma: 28464
Join Date: Dec 2006
|
Has anyone edited the cpio initramfs file directly and then embed it back into the kernel and have it still work?
|
|
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 09:35 PM |
Image sizes in Kindle | chrisborg | Amazon Kindle | 2 | 05-17-2010 01:49 AM |
Image optimization for Kindle 2 | thelostemperor | Amazon Kindle | 10 | 03-13-2009 05:34 PM |
Observations from Kindle 2 kernel sources | TadW | Kindle Developer's Corner | 3 | 03-13-2009 05:29 PM |
[REQ] Extract the first PDF page as image | Format C: | 2 | 02-09-2009 10:53 AM |