# Unpacking initramfs



## JonK (Dec 4, 2011)

I am trying to learn how to build a kernel and I am stuck at trying to extract initramfs from the stock zImage. I have tried the scripts here and here but neither work. Is there a script that works on the stratosphere zImage? Is the cpio archive gzipped in the stock kernel? The first script seems to think it is, but after unzipping it the resulting cpio.img is zero bytes. The second script fails by saying it cant find a gzip header which is weird because the first script finds the header just fine.

I also have a general question. I see that root was obtained by compiling initramfs as insecure but I dont understand how that helps. My understanding is that all initramfs does is find and load the root filesystem. After that it is erased from memory (right? or does it stay in memory?). What does making it insecure do? I would think that what you really want to do is give adb root privileges. Couldnt that be done just by changing a filesystem flag on the adb executable which I assume is in the root file system (or is it part of the kernel?)? Or just by flashing a rootfs that has the su and busybox executables added in with root privileges. Please help me understand this.


----------



## poontab (Jun 7, 2011)

Moved to general. Please use development sections for releases only.


----------

