Just yesterday nikholtus told me
"you cannot repack a ramdisk twice. you always have to use a kernel.sin as source. a ramdisk extracted from kernel.elf will not work"
now ^^ that was strange, because if we can pack once we should be able to repack over and over again. So i went about trying to find what the problem was.
The problem as i understand is, the people over here at Xperia 2012 forum seem to use 7zip to extract the ramdisk from kernel.elf as explained in atarii's thread here
But we need to understand, that the proper method to unpack a ramdisk is
Code:
mkdir ramdisk-contents
cd ramdisk-contents
guncip -c ../ramdisk.img | cpio -i
using the 7zip method will destroy all symlinks and will NOT retain file permissions in the ramdisk
Thus such an extracted ramdisk will NOT be able to be reused by repacking it.
U might just have made alot of people do a tactical facepalm.
lol, that i didn't know this
now i have touch recovery (on my P)
very happy
btw lazy bummers (or even lazy developers) can use my kernel kitchen (link in my sig)
it can unpack and repack a kernel.elf for you as many times as you wish to make it do so
championswimmer said:
Just yesterday nikholtus told me
"you cannot repack a ramdisk twice. you always have to use a kernel.sin as source. a ramdisk extracted from kernel.elf will not work"
Click to expand...
Click to collapse
blame atarii
(i joke of course!)
nice one champ!!
Reviving old threads here, but alas, you are the only ones who know.
So if I unpack a ramdisk with 7zip and repack it later on, I won't be able to boot?
someone755 said:
Reviving old threads here, but alas, you are the only ones who know.
So if I unpack a ramdisk with 7zip and repack it later on, I won't be able to boot?
Click to expand...
Click to collapse
Sure,it will f))ck up the system!!
so unpacking a ramdisk should type the line like you post? so that it can be repack,right?
i can't access the third line command
is all of the step3 in unpack elf should change to the strings like you post?
and what is guncip?
gunzip
slsamg7112 said:
i can't access the third line command
is all of the step3 in unpack elf should change to the strings like you post?
and what is guncip?
Click to expand...
Click to collapse
gunzip as knows as
Linux Command - Unix Command.
Sent from Xperia Sola
but how it works? should i need anything else?
and it always says cpio is not a executable or bat file
how to solve it? thanks
I've heard from a very good source that our kernels don't in fact have symlinks. That same source has also said that the OP here is wrong and the ramdisk may be used as many times as we wish. And that we may use 7zip for unpacking it.
So yeah, I'll be using 7zip...
Related
I just need a simple script and or a command line to decompile and recompile the kernel.img from the zImage for ubuntu. I have looked everywhere and could not find anything about the kernel.img that is inside of the zImage. Thanks in advanced!
anthony062991 said:
I just need a simple script and or a command line to decompile and recompile the kernel.img from the zImage for ubuntu. I have looked everywhere and could not find anything about the kernel.img that is inside of the zImage. Thanks in advanced!
Click to expand...
Click to collapse
Not. you can't decompile a zImage. only compiling a new kernel from the sources is possible.
[size=+2]PLEASE USE THIS THREAD (LINK) FROM NOW ON. I WILL NOT MONITOR THIS THREAD ANYMORE [/size]
INTRODUCTION
So we all know dsixda's XDA ROM Kitchen
Then how about a kitchen for Kernels ??
What started out just as my personal directory where I kept all my kernel and ramdisk tinkering scripts, has now turned into a project (which is far from finished right now )
This does NOT enable you to compile the kernel binary (aka zImage).
This enables you to edit ramdisk and change bootsplash images and helps kernel developers to deploy their compiled kernel in a usable form.
FEATURES
As of now what we can do with the Kernel Kitchen is
Fully menu driven interface (like dsixda kitchen)
Extract zImage and ramdisk from boot.img file
Create boot.img from zImage and ramdisk
Extract zImage and ramdisk from any ftf file that contains kernel.sin (Xperia 2010, 2011, 2012)
Create flashable ftf from zImage and ramdisk (Xperia 2010 only)
Create compressed ramdisk binary from ramdisk folder
Extract ramdisk files from ramdisk binary
Convert png image to rle format (used in android boot splash images)
Convert rle boot splash to png file (so that you can edit it)
Proposed upcoming features
Automatic script to change boot splash in a kernel with your favourite png file
STYLE CODE :
bold are supported only in linux
italics are supported in linux and windows+cygwin
underline are supported in windows native (without cygwin)
(if more than one style is used, it supports all respective platforms)
REQUIREMENTS
This tool is primarily meant for linux users (preferably Uubuntu).
But it works perfectly well on windows+cygwin too
Some portions of the kitchen have support for native windows (without even cygwin)
Rest all requirements are mentioned in the readme
WHAT ARE ITS USES ?
1.The primary purpose (for which this project started out in the first place) is to provide a easy kernel deployment tool for wannabe kernel devs.
A lot of us can compile a kernel from source but that is just the zImage and cannot be used as such on the phone. We need to package it with a ramdisk ad deploy it thorough a proper method (flashtool for Xperia, ODIN for samsund, and fastboot for other phones)
2.You canedit ramdisk properties (by editing default.prop)
Changing ro.secure=1 to ro.secure=0 makes your ramdisk insecure and enables easy root access 3.The most immediate and popular use that i can see right now is changing the boot logo to your liking
the boot logo is called logo.rle or initlogo.rle and is placed in the root of ramdisk folder.
When you split kernel, you can find the rle file which you can convert into png, do necessary editing and convert back into rle and pack up the ramdisk and create a new kernel
4.Other than that, you can change the recovery system
for eg. you can include Doom's Touch recovery system inside your favourite kernel
or you can include the xRecovery inside CM7 kernel so that you can flash amend zips.
Changing the recovery is ofcourse a little more complicated for average users, and i'll write a short tuto for that soon enough DOWNLOAD AND USAGE
The sources can be found on www.github.com/championswimmer/kernel-tools
For linux (and cygwin) users I recommend the install git and run this command to get a copy of my repository
Code:
git clone https://github.com/championswimmer/kernel-tools.git
Or in general, all linux and windows users can just get a zipball of my repo here
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
All usage information can be found on this elaborate readme
In short all you have to do is cd to the appropriate folder and run this
Code:
./menu
CREDITS
None of this was possible without the helps and works of DoomLord, Azuzu, bin4ry, FXP, defer, blagus, nobodyAtall, the_laser, Androxyde
These works are directly included in my project
DoomLord's kernel.sin and ftf creator (windows version)
These works are used in their modified/repackaged form
DoomLord's png and rle interconversion tool (windows version)
DoomLord's perl script to split kerel.sin
And big thanks to nobodyAtall for pointing me the appropriate linux binaries (or i would have kept pouring wine over windows exe files)
Thanks to ImageMagick developers for the awesome tool
SOURCES USED
1. to565 and from565 source code (part of Android Open Source Project)
2. mkbootimg and mkbootfs standalone sources (part of AOSP)
3. abootimg sources (by Gilles Grandou)
Hello!
Thanks for your great work.
I've done all stage and when i try to flash kernel i modify, it stucks on flashing loader 14%.
What's the problem? thanks.
fxdRoiD said:
Hello!
Thanks for your great work.
I've done all stage and when i try to flash kernel i modify, it stucks on flashing loader 14%.
What's the problem? thanks.
Click to expand...
Click to collapse
Read the first part of this post and ask your question in the link provided
fxdRoiD said:
Hello!
Thanks for your great work.
I've done all stage and when i try to flash kernel i modify, it stucks on flashing loader 14%.
What's the problem? thanks.
Click to expand...
Click to collapse
do you have "jar" installed??
(jar comes with java or you can install 'fastjar' )
and when making kernel did you chose option 2??
option 1 is for X10, option 2 is for your phone
championswimmer said:
do you have "jar" installed??
(jar comes with java or you can install 'fastjar' )
and when making kernel did you chose option 2??
option 1 is for X10, option 2 is for your phone
Click to expand...
Click to collapse
Hello!
I'm on ubuntu 12.04 and i have jar installed. I can run x10flasher well.
Yes i have chosen option 2.
I've just modified boot logo in res -> image -> logo into Ramdisk. I've repacked ramdisk and copy zImage into kernel-files and paste both into input folder after renamed them properly. Is it the good process?
You can see my log attached.
After flashing loader, i must wait 5 min before starting "flashing kernel.sin". After that, 3 min waiting, flashing aborted...
fxdRoiD said:
You can see my log attached.
After flashing loader, i must wait 5 min before starting "flashing kernel.sin". After that, 3 min waiting, flashing aborted...
Click to expand...
Click to collapse
could you send me the ftf file you created?
Sent from my X10S using xda premium
btw the process is simple
extract from ftf
copy the ramdisk-contents as ramdisk-folder into input folder.
make changes as necessary
repack the ramdisk
put the zimage as "image" and compressed ramdisk as "ramdisk" into input folder
create ftf
flash it
Sent from my X10S using xda premium
championswimmer said:
btw the process is simple
extract from ftf
copy the ramdisk-contents as ramdisk-folder into input folder.
make changes as necessary
repack the ramdisk
put the zimage as "image" and compressed ramdisk as "ramdisk" into input folder
create ftf
flash it
Sent from my X10S using xda premium
Click to expand...
Click to collapse
I did it completly. Here's Kernel. I just want to put sony ericsson logo. Thanks if you can made it works properly.
I did all stages correctly! Please, make it works...
fxdRoiD said:
I did it completly. Here's Kernel. I just want to put sony ericsson logo. Thanks if you can made it works properly.
I did all stages correctly! Please, make it works...
Click to expand...
Click to collapse
oops ****!!!!
i know what the problem is ... damn
it's using the x10 loader.sin for all phones... wtf!!
please send me the original nAa kernel
Sent from my X10S using xda premium
fixed loader sin problem and updated menu based interface
championswimmer said:
oops ****!!!!
i know what the problem is ... damn
it's using the x10 loader.sin for all phones... wtf!!
please send me the original nAa kernel
Sent from my X10S using xda premium
Click to expand...
Click to collapse
Original nAa Kernel, you can find it here: http://minicm.googlecode.com/files/E10_nAa-11_2.6.29.6-nAa-11.ftf
or
jump to threat forum:
http://forum.xda-developers.com/showthread.php?t=1256739
---------- Post added at 01:16 PM ---------- Previous post was at 01:14 PM ----------
championswimmer said:
fixed loader sin problem and updated menu based interface
Click to expand...
Click to collapse
Thanks. Try it now.
Tell me, if i want to change bootsplash, i just want to modify logo in ramdisk -> res -> images -> logo?
ramdisk > initlogo.rle
or
ramdisk > logo.rle
if any of this file is not present then i think the ramdisk does not have a logo.
(you can down load one of my kernels (from my devhost or ftp mirror in my sig), they are for x10 but you can extract them and see where the logo image is supposed to go)
it SHOULD be a <filename>.rle file. android logos are always rle files
championswimmer said:
ramdisk > initlogo.rle
or
ramdisk > logo.rle
if any of this file is not present then i think the ramdisk does not have a logo.
(you can down load one of my kernels (from my devhost or ftp mirror in my sig), they are for x10 but you can extract them and see where the logo image is supposed to go)
it SHOULD be a <filename>.rle file. android logos are always rle files
Click to expand...
Click to collapse
Can't see .rle file. Ramdisk contents a file "init" without extension. Please, can you download kernel and tell me where is rle file? Thanks!
---------- Post added at 01:50 PM ---------- Previous post was at 01:43 PM ----------
What's the link i can use to update without restart downloading? I try "Update [link]" but command "update" not found.
fxdRoiD said:
Can't see .rle file. Ramdisk contents a file "init" without extension. Please, can you download kernel and tell me where is rle file? Thanks!
---------- Post added at 01:50 PM ---------- Previous post was at 01:43 PM ----------
What's the link i can use to update without restart downloading? I try "Update [link]" but command "update" not found.
Click to expand...
Click to collapse
update what?
and about rle,
umm when you boot nAa kernel what bootimage you see? is there any bootimage?
Sent from my X10S using xda premium
Yes there's a boot image. In the kernel contents any rle file. Have you downloaded kernel?
Sent from my E10i using XDA
please move to this thread
http://forum.xda-developers.com/showthread.php?t=1659584
i'll not monitor this thread anymore
I have met some problem with boot.img and need some help if there's somebody know it.
I used unmkbootimg and mkbootimg, I unpacked a boot.img then got zimage and initramfs.cpio.gz, I repacked it without any edit but the new boot.img becames smaller, it changed from 13M to 7.9M, and the phone couldn't boot from new boot.img,
and there is no question if I use a boot.img extracted from an android3.x-version rom, but if the android version changes to 4.x, the unpack-repack process would lose much size...I tested on mi2s' rom......I don't know if there are some files that will be lost in unpack process, or say the process just ignore files other than zimage and initramfs...
does anybody knows why?
binghemoye said:
I have met some problem with boot.img and need some help if there's somebody know it.
I used unmkbootimg and mkbootimg, I unpacked a boot.img then got zimage and initramfs.cpio.gz, I repacked it without any edit but the new boot.img becames smaller, it changed from 13M to 7.9M, and the phone couldn't boot from new boot.img, does anybody knows why?
Click to expand...
Click to collapse
It could be because of incorrect settings for mkbootimg or there more files,than zImage and initramfs, needed for proper work. Hard to say without more information.
Sorry for my bad English.
B.B.N. said:
It could be because of incorrect settings for mkbootimg or there more files,than zImage and initramfs, needed for proper work. Hard to say without more information.
Sorry for my bad English.
Click to expand...
Click to collapse
There is no question if I use a boot.img extracted from an android3.x version rom, but if the android version changes to 4.x, the unpack-repack would lose much size...I tested on mi2s' rom......I don't know if there are some files that will be lost in unpack process, or say the process just ignore files other than zimage and initramfs...
So i have extracted the boot.img file from my favourite ROM using abootimg and got the following:
bootimg.cfg
intird.img
zImage
Now i can see that the bulk of the kernel is in the zImage file though for the life of me i can't work out how to extract it.. Can it even be done?
I want to add overclocking to my old Grouper device i have the commits. if i could just see the file structure i can replace the files needed within the arch/arm folder and recompile i'd be done! i've searched everywhere though no one seems to advise on how to do it.
Thanking you in advance.
Some htc devices are having issues with touch working in recovery and recently @Captain_Throwback made a hack for that.Sir can you explain it to me or refer a post by others. Here's my scenario, I'm having nothing but my stock rom and of course a device tree and vendor blobs but No twrp due to this issue and there is no kernel source for my device so can you explain it to me sir.
Have you checked for kernel source here? https://www.htcdev.com/devcenter/downloads
tys0n said:
Have you checked for kernel source here? https://www.htcdev.com/devcenter/downloads
Click to expand...
Click to collapse
Yeah it is not available my device is htc desire 620g
I already posted instructions for you. It's not a process for a novice. It sounds like you don't even know how to unpack a boot.img, so you should start by searching (XDA, Google) for how to do that.
Captain_Throwback said:
I already posted instructions for you. It's not a process for a novice. It sounds like you don't even know how to unpack a boot.img, so you should start by searching (XDA, Google) for how to do that.
Click to expand...
Click to collapse
I do know how to unpack boot.img and I even built other recoveries from source by making a device tree for my device I don't know that enable touch in recovery thing.
M.A.P said:
I do know how to unpack boot.img and I even built other recoveries from source by making a device tree for my device I don't know that enable touch in recovery thing.
Click to expand...
Click to collapse
I gave you instructions for patching the kernel already. It's the procedure that I follow. I'm not sure what else you want.
Captain_Throwback said:
I gave you instructions for patching the kernel already. It's the procedure that I follow. I'm not sure what else you want.
Click to expand...
Click to collapse
You mean to do this sir Patch the uncompressed kernel binary for touch as indicated below:
Code:
# Replaces string 'recovery' with 'rec0very' so htc_get_bootmode() doesn't know we're in recovery
sed -i -E -e 's/recovery\x00/rec0very\x00/g' <name-of-kernel-file>
You'll then have a patched, uncompressed kernel binary. To compress it, you'll have to find some similar kernel source, and compile it, but replace the "Image" (uncompressed kernel) with your patched one (and make sure it doesn't get overwritten on change), so that you have a kernel binary that's similar in size to the one you started with. Alternatively, you can just leave the kernel uncompressed and repack it back into the image (which will be much larger since the kernel is uncompressed). If it doesn't fit on the partition due to size, you will have to find a way to compress it.
M.A.P said:
You mean to do this sir Patch the uncompressed kernel binary for touch as indicated below:
Code:
# Replaces string 'recovery' with 'rec0very' so htc_get_bootmode() doesn't know we're in recovery
sed -i -E -e 's/recovery\x00/rec0very\x00/g' <name-of-kernel-file>
You'll then have a patched, uncompressed kernel binary. To compress it, you'll have to find some similar kernel source, and compile it, but replace the "Image" (uncompressed kernel) with your patched one (and make sure it doesn't get overwritten on change), so that you have a kernel binary that's similar in size to the one you started with. Alternatively, you can just leave the kernel uncompressed and repack it back into the image (which will be much larger since the kernel is uncompressed). If it doesn't fit on the partition due to size, you will have to find a way to compress it.
Click to expand...
Click to collapse
Yes, isn't that what you're asking for? If your kernel binary is gzipped with an appended dtb, then these are the complete instructions: https://forum.xda-developers.com/ht...ery-twrp-touch-recovery-t3358139/post71574833
Captain_Throwback said:
Yes, isn't that what you're asking for? If your kernel binary is gzipped with an appended dtb, then these are the complete instructions: https://forum.xda-developers.com/ht...ery-twrp-touch-recovery-t3358139/post71574833
Click to expand...
Click to collapse
My device is mtk based sir so I don't have dt.img can you tell me how to do this on mtk devices.
M.A.P said:
My device is mtk based sir so I don't have dt.img can you tell me how to do this on mtk devices.
Click to expand...
Click to collapse
The original method I posted *may* still work. Did you even try it?
Until you try it, why do you keep asking the same question?
Try it. If it doesn't work, then I can't help you.
Captain_Throwback said:
The original method I posted *may* still work. Did you even try it?
Until you try it, why do you keep asking the same question?
Click to expand...
Click to collapse
I think I did it I applied this command to kernel or zimage in terminal thats what I'm supposed to do right? sed -i -E -e 's/recovery\x00/rec0very\x00/g' <name-of-kernel-file>.
M.A.P said:
I think I did it I applied this command to kernel or zimage in terminal thats what I'm supposed to do right? sed -i -E -e 's/recovery\x00/rec0very\x00/g' <name-of-kernel-file>.
Click to expand...
Click to collapse
After you decompress it, yes. Did you decompress it first?
Captain_Throwback said:
After you decompress it, yes. Did you decompress it first?
Click to expand...
Click to collapse
I unpacked it sir and I tried it as it is and also decompressed it with 7zip well if its not to be uncompressed with 7zip then can you suggest me any other method sir.
M.A.P said:
I unpacked it sir and I tried it as it is and also decompressed it with 7zip well if its not to be uncompressed with 7zip then can you suggest me any other method sir.
Click to expand...
Click to collapse
Again, the link I gave you describes that already...extract-vmlinux. I'm not posting back here until you actually read what I already posted for you. I don't know how/if you're kernel is compressed, so you have to figure that out.
I've given you all the tools and information I have; I'm done here.
Captain_Throwback said:
Again, the link I gave you describes that already...extract-vmlinux. I'm not posting back here until you actually read what I already posted for you. I don't know how/if you're kernel is compressed, so you have to figure that out.
I've given you all the tools and information I have; I'm done here.
Click to expand...
Click to collapse
Ok got it
Captain_Throwback said:
Again, the link I gave you describes that already...extract-vmlinux. I'm not posting back here until you actually read what I already posted for you. I don't know how/if you're kernel is compressed, so you have to figure that out.
I've given you all the tools and information I have; I'm done here.
Click to expand...
Click to collapse
Sir, I modified the kernel and now I want to compress it so I got the similar device kernel source to compile and zImage , Image and kernel.bin files are made now can you explain how to compress my kernel.
M.A.P said:
Sir, I modified the kernel and now I want to compress it so I got the similar device kernel source to compile and zImage , Image and kernel.bin files are made now can you explain how to compress my kernel.
Click to expand...
Click to collapse
Read the original instructions I gave you...I will not repeat myself. You'll have to figure the rest out on your own.