FORUMS
Remove All Ads from XDA

[HOWTO] Modify stock kernels' initramfs / Repack it

104 posts
Thanks Meter: 427
 
By dkcldark, Senior Member on 22nd September 2010, 09:28 PM
Post Reply Email Thread
1. Usage

./editor.sh [place where the kernel is] [ place where your ramdisk is]

### you must let editor.sh know where your cross compiler is.
open "editor.sh" and edit COMPILER

2. Example

./editor.sh /home/zero/Desktop/test/zImage /home/zero/Desktop/test/my_initramfs.cpio

3. Info

- can not use an initramfs which is bigger than the stock initramfs.cpio's size

>> for instance, stock JM8's got an "initramfs.cpio" which is 3.4MB.
you can use reasonably bigger initramfs by gzipping the initramfs.cpio ->> initramfs.cpio.gz
this process reduces the initramfs.cpio's size but still can't use if initramfs.cpio.gz is bigger than 3.4MB
(this means that if a kernel already has gzipped initramfs, it is difficult to make it. you may want to remove something in order to have more room.)

- you can choose either your_initramfs.cpio or your_initramfs.cpio.gz
(this script compresses the ***.cpio if this is bigger than the stock.)

4. how to extract an initramfs from a kernel?

go to here

http://forum.xda-developers.com/wiki...fs_from_zImage

Thanks gshklover!
Attached Files
File Type: zip kernel_repacker.zip - [Click for QR Code] (290.0 KB, 2210 views)
The Following 2 Users Say Thank You to dkcldark For This Useful Post: [ View ] Gift dkcldark Ad-Free
 
 
22nd September 2010, 09:50 PM |#2  
Senior Member
Thanks Meter: 8
 
More
Thanks for this! I really appreciate the work you are doing :)

Sent from my GT-I9000 using Tapatalk
22nd September 2010, 10:06 PM |#3  
Senior Member
Flag JHB
Thanks Meter: 773
 
More
Sweet! Awesome work.
23rd September 2010, 12:02 AM |#4  
Chainfire's Avatar
Senior Moderator / Senior Recognized Developer - Where is my shirt?
Thanks Meter: 85,361
 
Donate to Me
More
Any reason you now have TWO threads about this subject ? (Or: why not edit / add to your other thread about this ?)

Also, I have a toolset to do all this on Windoze without Linux and compilers... I used it to build the JPH root, but haven't tested it on enough kernels yet to consider it stable and publicly release it.
4th November 2010, 10:35 PM |#5  
_JKay_'s Avatar
Retired Recognized Developer
Thanks Meter: 14,812
 
Donate to Me
More
Hi,

I have tried these scripts on i9000WXJPA and '070701' is found 60 times and 'TRAILER!!!' is found 2 times! I find it a bit risky to assume that the first match is the right one!! z4ziggy's script doesn't even contain the -m 1 so I guess he believes there will always just be one entry!! There must be a safer way to extract initramfs from a zImage. Doesn't the header contain the exact entries where to find the partitions?

Thanks
JKay
29th December 2010, 08:32 AM |#6  
Senior Member
Thanks Meter: 22
 
More
Great script, thanks.

I'm trying to port this for use with the Galaxy 3.. uses s5p6442 processor.

Any idea what the mcpu and other flags/values would be when it's rebuilding the image?

Thanks
3rd January 2011, 06:58 PM |#7  
Junior Member
Thanks Meter: 0
 
More
The eclair kernel compilation comes up with
Quote:

-D__LINUX_ARM_ARCH__=6 -march=armv6k -mtune=arm1136j-s

apparently s5p6442 is s5p6440's poorer cousin (the latter has at least a better CPU, arm1176jzf-s), but there's no information to be found on Samsung's website about it

good luck in making it boot and please share if you make it work, I didn't manage to get it working yet (I'm using z4mod and so far it's generating an invalid zImage)
13th January 2011, 03:36 AM |#8  
Senior Member
Thanks Meter: 46
 
More
Quote:
Originally Posted by Chainfire

Any reason you now have TWO threads about this subject ? (Or: why not edit / add to your other thread about this ?)

Also, I have a toolset to do all this on Windoze without Linux and compilers... I used it to build the JPH root, but haven't tested it on enough kernels yet to consider it stable and publicly release it.

Anyone mind to explain what the "compiling" is doing in a few words? It seems start and end are not changeable anyway.. checksums maybe? wild guess. Just curious. It works fine anyway.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes