|
|
#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. |
|
|
|
|
|
#2 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 382
Karma: 1942
Join Date: Aug 2007
Location: Elda - Alicante (Spain)
Device: PB903, K2, K3, K2i, KDX,KDXG,Nook,DR1000S, Boox6, iPad, Q1U, X51v, TM2
|
Forgive my ignorance of Linux. And what is it for?
|
|
|
|
|
Enthusiast
|
|
|
|
#3 |
|
Member
![]() Posts: 14
Karma: 84
Join Date: Sep 2006
Device: iliad Kindle DX
|
Kindle dx kernel embedded initramfs filesystem.just for developer
|
|
|
|
|
|
#4 |
|
Zealot
![]() ![]() ![]() ![]() ![]() ![]() Posts: 100
Karma: 627
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.
|
|
|
|
|
|
#5 |
|
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 382
Karma: 1942
Join Date: Aug 2007
Location: Elda - Alicante (Spain)
Device: PB903, K2, K3, K2i, KDX,KDXG,Nook,DR1000S, Boox6, iPad, Q1U, X51v, TM2
|
Thank you, ebs!
|
|
|
|
|
|
#6 | |
|
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Sep 2009
Device: none
|
How did you figure out the offsets?
Quote:
Thanks! |
|
|
|
|
|
|
#7 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 95594
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. |
|
|
|
|
|
#8 |
|
Kindle Dissector
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 662
Karma: 170549
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.
|
|
|
|
|
|
#9 | |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 95594
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. |
|
|
|
|
|
|
#10 |
|
Member
![]() Posts: 22
Karma: 12
Join Date: Jul 2010
Device: Kindle 3
|
|
|
|
|
|
|
#11 | |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5329011
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|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
Quote:
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
|
|
|
#12 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,255
Karma: 3921779
Join Date: Feb 2012
Device: K0
|
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.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan - -> JB on BD |
|
|
|
|
|
#13 | |
|
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,143
Karma: 5329011
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|Ematic E6+E8|Rooted Nook Touch|NO K2!!
|
Quote:
__________________
Audiophile and electron bully. My tunes (for free) soundcloud.com/twobob. DONATE TO KUAL BY CLICKING THIS SIMPLE LINK Kung-Fu. Hard work over time to accomplish skill. A painter can have kung-fu... The musician can have kung-fu, or the poet who paints pictures with words and makes emperors weep. This, too, is kung-fu. Formless, nameless, the true master dwells within. Only you can free him. The album I'm headlining on at the moment: s.beatport.com/OCp9dT - FREE: 2012 Award winning set |
|
|
|
|
|
|
#14 |
|
Embedded Cheerleader
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,255
Karma: 3921779
Join Date: Feb 2012
Device: K0
|
Three?
OK, here is the third: http://minimodding.com/FirmwareComparison - - - - It has been years since I had a real life.
__________________
"Hack is just a four letter word." - - With apologies to B. Dylan - -> JB on BD |
|
|
|
|
|
#15 |
|
Member
![]() Posts: 15
Karma: 10
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?
|
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Compiling Kindle kernel? | yifanlu | Kindle Developer's Corner | 47 | 12-09-2012 08:20 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 | |