[To Kernel Devs]Custom kernel|Zimage/boot.img issues at stock ROMs with stock kernel - HTC EVO 3D

I noticed for myself with custom ROMs there is no problem to flash a kernel zip
with Zimage or boot.img inside via recovery.Tried all available kernels and all works.
But if I do a restore to my rooted and S-Off stock ROM with stock kernel,
nothing works.First I flashed kernel zip with Zimage,then I got
Code:
Flashing New boot.img ...
assert failed: write_raw_image ("/tmp/newboot.img". "boot")
(Status 7)
Installation aborted
After this,I tried to flash a kernel zip with boot.img inside.This works,but
phone stuck at HTC splash image.
Also,after flashed the kernel zip with boot.img inside,the kernel zips with
Zimage inside works too,but also stucks at HTC splash image.
Phone details:
EVO 3D GSM, rooted by:
HBOOT 1.49.1107
revolutionary s-off
CWM 5.0.2.0
Any answers/solutions for this from the devs,why custom kernels don`t
work with rooted/S-Off stock ROM and stock kernel?

This should go to Q&A Section...
Stock ROM's have secured Boot Images, custom ROM Dev's unsecure the Boot Image to allow Root ADB commands.

Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

harpss1ngh said:
This should go to Q&A Section...
Stock ROM's have secured Boot Images, custom ROM Dev's unsecure the Boot Image to allow Root ADB commands.
Click to expand...
Click to collapse
So no solution to get a custom kernel working on rooted/S-Off stock ROM
with stock kernel?

harpss1ngh said:
This should go to Q&A Section...
Stock ROM's have secured Boot Images, custom ROM Dev's unsecure the Boot Image to allow Root ADB commands.
Click to expand...
Click to collapse
I could be wrong, but as far as I know this is partly true, although I might have misread.
I agree, completely 100% stock kernels from the manufacturer have secured kernels (boot images).
Ganii said:
So no solution to get a custom kernel working on rooted/S-Off stock ROM
with stock kernel?
Click to expand...
Click to collapse
The first 256 bytes of the kernel/boot.img are the signature/encryption on 100% stock kernels for this device. Since the first 256 bytes are encrypted, the standard Anykernel (zImage in .zip file with dd, etc.) method does not work. It will successfully dump the kernel from the boot partition but it will fail when parsing out the pieces due to the 256 bytes at the beginning, at least in previous/current state.
The only way I've seen to bypass this is by flashing an unsigned kernel. I've had success removing the first 256 bytes of the dumped/RUU kernel file and flashing. Once the user has an unsigned/unsecured kernel loaded in the boot partition, the Anykernel style (zImage, dd, mkbootimg.sh, etc) type kernel usually works.
These unsigned kernel files can be found in ROMs or separately in kernel .zip files, but they have to always be in the boot.img form the first time.
Some of this is my personal theory but it is based on my experiences. Welcome anybody else with experience to chime in, especially other kernel developers.
Hope my ideas make sense!

I also tried to flash boot.img,but doesn`t work.
http://forum.xda-developers.com/showpost.php?p=18686747&postcount=166

I think you might be typing the commands wrong. Have you tried
fastboot flash zimage??? Also did you unpack/unzip the .img to the correct directory??? Also did you do fastboot reboot boot loader???
Locked & Loaded
""Shooter on Deck""

Ganii said:
I also tried to flash boot.img,but doesn`t work.
http://forum.xda-developers.com/showpost.php?p=18686747&postcount=166
Click to expand...
Click to collapse
If the kernel is compiled and verifed working properly, flashing the boot.img should work as it completely overwrites the stock kernel image.
In comparison to the Anykernel method, where they dump the stock signed kernel and attempt to split out the ramdisk, cmdline and base, which will fail due to the 256 byte signature at the front of the kernel.
As a side note, I'm fairly certain it would be simple to modify the current tools, somebody might have already, to ignore the first 256 bytes of the kernel partition, and then use the rest of the image to split out the correct information. On a mass scale, the only hard part would be determining which kernels had 256 bytes of encryption/signed or which don't. The easiest solution would be to provide a flag to pass to the binary which splits out the imagine ... probably getting off topic.
Hope the extra details help clarify the process as far as I understand it!

Whats the fastest kernel out for the EXT3? And how about EXT4?

Related

Please help can't load any rom

I bought this 3D used but like new and wanted to flash it to Boost so I was doing some preliminary pre-flash things like rooting and loading a custom recovery and rom. I used the HTC unlock method for the bootloader and flashed Eternity and it stuck at Beats screen (boot animation). I downloaded a different rom to see if it was the rom but that one froze at the animation screen as well. I attempted to do an RUU stock reset on my PC from bootloader but it returned an error saying update failed. I'm basically locked out of this phone. I read everything it said about flashing custom kernels and how you are supposed to flash them from bootloader. I know Eternity has a stock kernel don't know about the other one. My last resort is to download a zip of a stock rom and flash that from recovery. If it freezes on me I'm not sure what I'll do next. Any help is appreciated...
xlxcrossing said:
I bought this 3D used but like new and wanted to flash it to Boost so I was doing some preliminary pre-flash things like rooting and loading a custom recovery and rom. I used the HTC unlock method for the bootloader and flashed Eternity and it stuck at Beats screen (boot animation). I downloaded a different rom to see if it was the rom but that one froze at the animation screen as well. I attempted to do an RUU stock reset on my PC from bootloader but it returned an error saying update failed. I'm basically locked out of this phone. I read everything it said about flashing custom kernels and how you are supposed to flash them from bootloader. I know Eternity has a stock kernel don't know about the other one. My last resort is to download a zip of a stock rom and flash that from recovery. If it freezes on me I'm not sure what I'll do next. Any help is appreciated...
Click to expand...
Click to collapse
Did you follow the root instructions all the way through to install Superuser and the recovery? If so, did you boot into fastboot, connect usb, then do the fastboot boot recovery.img before flashing the rom?
Sent from my PG86100 using XDA App
JayDaKissEP said:
Did you follow the root instructions all the way through to install Superuser and the recovery? If so, did you boot into fastboot, connect usb, then do the fastboot boot recovery.img before flashing the rom?
Sent from my PG86100 using XDA App
Click to expand...
Click to collapse
I did not use that method to flash, no. I'm assuming you mean from my PC execute the command. I did follow the instructions to install TWRP which is a custom recovery and I flashed a ZIP from TWRP for Superuser and checked it to be working which it was. (I tested Root Explorer and Terminal Emulator for root)
I was operating off the assumption that custom roms with a STOCK kernel could be flashed by booting into recovery. I went to bootloader then recovery then flashed the rom. Obviously I did something wrong since both roms wouldn't load. I will use your method of PC commands from fastboot into recovery and see where that gets me....pease let me know if this is correct or anything else I need to do....thanks a bunch.
UPDATE : I tried the method of loading recovery from fastboot usb - it worked thank you. The rom loaded. I'm wondering why since it was a custom rom with a stock kernel why I couldn't flash it from recovery.
xlxcrossing said:
UPDATE : I tried the method of loading recovery from fastboot usb - it worked thank you. The rom loaded. I'm wondering why since it was a custom rom with a stock kernel why I couldn't flash it from recovery.
Click to expand...
Click to collapse
While the kernel is stock, Virus has a bunch of binaries and such that will be mismatched without flashing the boot.img properly ... So while some of his builds say "stock" not always completely stock.
ifly4vamerica said:
While the kernel is stock, Virus has a bunch of binaries and such that will be mismatched without flashing the boot.img properly ... So while some of his builds say "stock" not always completely stock.
Click to expand...
Click to collapse
cool cool thanks for the info. So I need to load the recovery.img file from usb fastboot EVERY time I want to flash a rom? Any way to eliminate this hassle....I just assume flash less often if not...thanks
xlxcrossing said:
cool cool thanks for the info. So I need to load the recovery.img file from usb fastboot EVERY time I want to flash a rom? Any way to eliminate this hassle....I just assume flash less often if not...thanks
Click to expand...
Click to collapse
With hboot 1.5, the ONLY way to flash a ROM correctly is with fastboot>recovery.
Twolazyg said:
With hboot 1.5, the ONLY way to flash a ROM correctly is with fastboot>recovery.
Click to expand...
Click to collapse
Not true. You can flash a ROM but if you don't use fastboot it won't touch the kernel. I always change roms with the stock kernel. He must have done something wrong
Sent from my PG86100 using XDA App
JayDaKissEP said:
Not true. You can flash a ROM but if you don't use fastboot it won't touch the kernel. I always change roms with the stock kernel. He must have done something wrong
Sent from my PG86100 using XDA App
Click to expand...
Click to collapse
If the kernel is pure stock with no added binaries or stuff it will work. Virus puts lots of little tweaks in that require it. Now if you can load a completely stock kernel and ramdisk then load Eternity (of course some eternity builds did have a completely stock kernel) then you may be onto something.
As far as flashing with hboot 1.50 easiest way to do that without the computer is with joeykrm's flash image gui. I don't have 1.50 but I have used his gui to do partial updates on svn builds in tandem with adb sync and it works great. His post with the apk is in development section. just read the instructions and flash away.
ifly4vamerica said:
If the kernel is pure stock with no added binaries or stuff it will work. Virus puts lots of little tweaks in that require it. Now if you can load a completely stock kernel and ramdisk then load Eternity (of course some eternity builds did have a completely stock kernel) then you may be onto something.
As far as flashing with hboot 1.50 easiest way to do that without the computer is with joeykrm's flash image gui. I don't have 1.50 but I have used his gui to do partial updates on svn builds in tandem with adb sync and it works great. His post with the apk is in development section. just read the instructions and flash away.
Click to expand...
Click to collapse
Yeah I read all about it I'm still stuck on why if I had a stock kernel installed with a stock rom and I do a custom rom flash and as stated it doesn't touch the kernel why the rom wouldn't simply run off the stock kernel - that's what confuses me. I understand the issue of the kernel not being flashed which is obviously what happened with me. I just don't really know where I stand with what kernel to ALWAYS have loaded since if that's the thing with the issue I would want to for purposes of not doing tons of work stay away from flashing kernels and stick to flashing roms when I want to change it up. But if the STOCK kernel won't load with a custom rom which technically it should I guess I'll just have to flash a universal custom kernel and assume any rom I flash will simply use that kernel. Kind of a nightmare compared to my 4G....welcome to the world of the 3D I guess.
I guess going into recovery from hboot with the volume and power buttons wouldn't count - I have to stick with PC commands?

[FAQ]S-ON Users with Wifi errors or problems Booting please read

I'm writing this as these questions commonly get asked in the development threads, taking them off topic.
S-ON users commonly run into these problems, which are quite simple to solve with the right information.
When your device is S-ON and unlocked via the HTC Method, the boot partition is mounted read-only in recovery mode, which causes these problems flashing custom kernels or custom roms.
a) Flashing a custom kernel through recovery mode breaks wifi:
Android uses the linux kernel, and the wifi drivers are compiled as kernel modules. The kernel modules are located in /system/lib/modules, and the linux kernel is located on the boot partition. When you flash the kernel zip file through recovery, the updated kernel modules get successfully written to the system partition however the linux kernel cannot get written to the boot partition. The result of this is that the kernel now cannot load the wifi kernel modules. This is what causes the WIFI error.
Solution: Download FlashImgGui from the market, and use that to install the kernel. This program can successfully write the new kernel to the boot partition eliminating the mismatch between the kernel and wifi modules.
b) Flashing a custom rom through recovery breaks wifi.
This problem is basically the same as a). The boot partition cannot be written so the kernel that came with the rom isn't written to it. This causes a mismatch between the kernel modules in the custom rom and the kernel.
Solution: You can either flash a custom kernel with FlashImgGui, or extract the boot.img file from the custom rom's zip file and copy to your computer. Then use the fastboot binary to flash the boot.img to the boot partition. This will copy the kernel that is packaged with the rom to your phone, which will fix the mismatch between the kernel and wifi modules.
C) Flashing a custom rom through recovery causes boot loops or the phone hanging at the HTC screen.
Some custom roms need a different initrd.gz file to the standard one. The initrd.gz file is located on the boot partition. When you flash the custom rom through recovery, the boot partition cannot get written and so the new initrd.gz isn't written to it. This is what causes the problems booting.
Solution: Same as above. Extract the boot.img from the zip file and flash with fastboot. This will copy the correct initrd.gz file to your phone and allow the rom to function correctly.
MODS: If you feel this is in the wrong section please move it. I'm only posting here as these questions always pop up in the development threads.
exactly what i have discovered
i can provide the testimony that the above are correct !
THANKS FOR CONFIRMING IT
actually it can be solved by
1. booting into bootloader (or via cmd :adb reboot bootloader)
2. flash boot "cwm.img" <<<name of the cwm file
3. flash via cwm
4. wifi will back on
ilovemeow said:
actually it can be solved by
1. booting into bootloader (or via cmd :adb reboot bootloader)
2. flash boot "cwm.img" <<<name of the cwm file
3. flash via cwm
4. wifi will back on
Click to expand...
Click to collapse
That method is useful for avoiding the problems in the first place, but its easier to flash the boot.img than flash recovery and reinstall the ROM for users who already have the problem.
doesnt it has any thing to do with the RADIO ???
because my phone came with another radio than the widely used one
and hboot 1.18
and I had tons of problems with wifi with every single rom
so I downgraded it to hboot 1.07 by flashing the EU 1.20 rom which came with the radio used here and achieved s-off using revolutionary
and all wifi problems were gone for good
s_superman said:
doesnt it has any thing to do with the RADIO ???
because my phone came with another radio than the widely used one
and hboot 1.18
and I had tons of problems with wifi with every single rom
so I downgraded it to hboot 1.07 by flashing the EU 1.20 rom which came with the radio used here and achieved s-off using revolutionary
and all wifi problems were gone for good
Click to expand...
Click to collapse
Absolutely nothing to do with the radio. Your wifi problems were solved once you got S-OFF . S-OFF means the boot partitions is mounted read-write in recovery mode so you do not have any of the problems I listed in the OP.
Where exactly do you flash the boot.img to when you need the custom rom's initrd? I.e. for 'fastboot flash xyz "boot.img"', what's the xyz?
Sent from my HTC EVO 3D X515m using XDA App
waltibaba said:
Where exactly do you flash the boot.img to when you need the custom rom's initrd? I.e. for 'fastboot flash xyz "boot.img"', what's the xyz?
Sent from my HTC EVO 3D X515m using XDA App
Click to expand...
Click to collapse
"fastboot flash boot boot.img"
I guessed as much, but wasnt gonna risk my phone without asking. Thank you!
Sent from my HTC EVO 3D X515m using XDA App
hi i have no access to market and i dont find the link to download out of market plz any one can upload the apk or zip and put the link ????
sahandv1989 said:
hi i have no access to market and i dont find the link to download out of market plz any one can upload the apk or zip and put the link ????
Click to expand...
Click to collapse
Here's a link to the thread:
http://forum.xda-developers.com/showthread.php?t=1192527&highlight=flash+image+gui
Please try the search button next time, it is usually the best place to start here
Two days working and the solution was under my nose!
THANK YOU!
Thanks for the information, but I don't think it's entirely accurate. Those with older phones (that haven't taken updates from HTC) will possibly have the old radio firmware. And if you are S-ON and HBOOT1.5, there's no way to 'get' the new firmware on the phone if you are unlocked.
So you must get the updated radio firmware (1216), put in in the root, relock the phone, and do a bootloader boot to flash the radio firmware. Unlock again, and then you are good to go. I had the 8xx version radio firmware and couldn't run any newer ROMS with working wifi until I got the updated firmware.
Be advised that lock/unlocking wipes your phone.
I followed the instructions but it doesn't work
What I did is:
1) Installed the custom ROM
2) installed the boot.img from fastboot
3) rebooted -> but stuck at htc logo
My friend's EVO 3D GSM has:
HBOOT 1.49.0018
S-ON
Unlocked
Can someone help me??
thanks in advance

Maybe someone can figure this one out?

Okay, so I was having a hell of a time trying to install Roms after unlocking. All the usual ways didn't work. Flat out.
What I found out:
I have to use Clockwork Mod 4.0.1.4 (TWR can't restore the nand it creates and Flash_Utility GUI doesn't work)
I have to flash a kernal within Clockwork after flashing the Rom (flashing a boot.img in fastboot doesn't work even though it says it was successful)
I have NO clue why my phone doesn't play nice with boot image like other phones. Luckily Tiamat writes good kernels
Mes3 said:
Okay, so I was having a hell of a time trying to install Roms after unlocking. All the usual ways didn't work. Flat out.
What I found out:
I have to use Clockwork Mod 4.0.1.4 (TWR can't restore the nand it creates and Flash_Utility GUI doesn't work)
I have to flash a kernal within Clockwork after flashing the Rom (flashing a boot.img in fastboot doesn't work even though it says it was successful)
I have NO clue why my phone doesn't play nice with boot image like other phones. Luckily Tiamat writes good kernels
Click to expand...
Click to collapse
You have to add superuser to the ROM and give necessary permissions to Flash image GUI to flash kernels with it.
Which ROM are you trying to flash? Do you GSM or CDMA Evo 3D?
Flashing boot.img in fastboot should work.It does say not successful as you stated.
Make sure you bootloader says unlocked and flash kernels/ROMs based on 2.3.4 if your phone came with 2.3.4.
@Mes3 ,
Does this sound similar to your problem?
[help]HTC Unlocked ROM/Recovery install Problems (fastboot/FlashimageGui/RomMgr)
http://forum.xda-developers.com/showthread.php?t=1450466

[Q] Kernel Update Possible Questions

I been searching around all over the place and I am just hitting my head against the wall. Any help would be appreciated.
This is my setup: hboot 1.5 S-ON, I have unlocked using the HTC method. I have Revolutionary CWM recovery installed.
I am looking to update the Kernel and Radio/PRI of the phone to the latest versions. (I haven't done it in a very long time.)
By what I read, since I have hboot 1.5 updating the kernel seems close to impossible. I did read that I may have to go to a Stock Rom and update via sprint OTA to get the latest updates then unlock again? That doesnt sound right to me.
I am all types of confused. Part of this was started because I wanted to try the MeanROM (link:http://forum.xda-developers.com/showthread.php?t=1466362) and also update my phone. Everything I try to do fails or I cant do because of the 1.5 or the S-ON.
Hopefully i am making some sense. I dont know what I have to do to get the latest kernel or if it even is possible.
If you are rooted already the only thing you need to do is install flash GUI app (you can get it in the market) and flash the kernel (boot.img) file before you flash the ROM and you should be OK
There is a myth that if your on 1.5 s-on your doomed, that's not true. It does mean that you'll need an extra step to do things but you'll be able to get things done without issues.
Sent from my Xoom using Tapatalk
megabiteg said:
If you are rooted already the only thing you need to do is install flash GUI app (you can get it in the market) and flash the kernel (boot.img) file before you flash the ROM and you should be OK
There is a myth that if your on 1.5 s-on your doomed, that's not true. It does mean that you'll need an extra step to do things but you'll be able to get things done without issues.
Sent from my Xoom using Tapatalk
Click to expand...
Click to collapse
Thank you for the reply, so I understand I can load that application, unzip the rom I want which will have the boot.img. Then flash that boot.img and then install that rom, is that correct? Lastly, does this also update the radio and pri?
spiderz13 said:
Thank you for the reply, so I understand I can load that application, unzip the rom I want which will have the boot.img. Then flash that boot.img and then install that rom, is that correct? Lastly, does this also update the radio and pri?
Click to expand...
Click to collapse
If your firmware is compatible with the Rom and kernel yes. If not, you will brick your phone or features will not work as they have to do. After you install flash GUI go to browse button and you will be advertised that file is too large for a kernel or recovery image, then asks if it is a valid Rom zip file. Tap yes and it will search the kernel inside the Rom. After it finishes tap flash and after reboot in recovery(you have to have recovery.img in root of your SD card), next wipe dalvik and cache, install zip and wait until the phone finishes. It is also recommended to you to make a nandroid backup before install anything.
spiderz13 said:
Thank you for the reply, so I understand I can load that application, unzip the rom I want which will have the boot.img. Then flash that boot.img and then install that rom, is that correct? Lastly, does this also update the radio and pri?
Click to expand...
Click to collapse
For the EVO 3D, much like the EVO 4G, the custom ROMs generally do not contain the radio or pri images.
There are some different reasons for this, but one of the common reasons being some users claim to experience different radio performance based on their geographic loation in relation to different versions of the radio and pri images.
luis4ever said:
If your firmware is compatible with the Rom and kernel yes. If not, you will brick your phone or features will not work as they have to do. After you install flash GUI go to browse button and you will be advertised that file is too large for a kernel or recovery image, then asks if it is a valid Rom zip file. Tap yes and it will search the kernel inside the Rom. After it finishes tap flash and after reboot in recovery(you have to have recovery.img in root of your SD card), next wipe dalvik and cache, install zip and wait until the phone finishes. It is also recommended to you to make a nandroid backup before install anything.
Click to expand...
Click to collapse
The only clarification to this post would be having recovery.img in the root of your SD card is not required for rebooting into recovery mode. In order for a custom recovery to load, when rebooting into recovery mode, the recovery.img has to have been flashed previously. Flash Image GUI can also flash the recovery.img to the recovery partition so when you reboot into recovery, the proper custom recovery loads. Most users flash custom recoveries infrequently when compared to how often they flash ROMs so the process for flashing the recovery process isn't covered as often.
In general, regarding the OP's original question of flashing the "MeanROM", the Flash Image GUI thread provides a great beginner step by step guide I wrote to help walk thru the general overview and process. I've quoted it below for easy reference.
Appreciate all the support of Flash Image GUI! I'll echo the optimism for hboot 1.5 s-on unlocked users, most everything is still possible. HTC just requires an extra few steps which can be frustrating, but once they are learned, the process is fairly smooth.
Hope the clarification helps iron out any confusion on the details!
HTC Unlock - Hboot 1.5 Users Guide for ROMs with a Kernel (boot.img file):
1) Unlock using HTC method for Hboot 1.5 users
2) Load this application, Flash Image GUI, onto the device, either through the Market or the link provided in this OP.
3) Download ROM .zip file to the sdcard on the device.
4) Open up Flash Image GUI, select Browse and select the ROM .zip file, downloaded to /sdcard in the previous step.
5) Flash Image GUI will provide a warning, reminding that the ROM .zip file will *need* to be flashed in the custom recovery afterward.
6) Flash Image GUI will index the full ROM .zip file searching for the kernel and kernel modules. Once located, the Flash Image button should be enabled.
7) Select the Flash Image button and Flash Image GUI will load the kernel modules and kernel from inside the ROM zip file.
8) Select reboot recovery.
9) Inside the custom recovery, load/flash the ROM zip file.
10) Reboot to normal Android mode and all should work including Wifi!
Click to expand...
Click to collapse

The boot image

Hi.
I my self are using and building for the HTC Desire and similar devices. However I have a friend who has the Galaxy s2 and wanted an ICS ROM on he's device. I found a ROM from in here, but I needed to change something in ramdisk to get UMS working.
I found that unlike my own phone, this one had 3 parts in the boot.img. The kernel, ramdisk and something else.
Does anyone have any idea what this something else is? How to split the boot.img and of cause how to put it assemble it again?
I search google and found someone saying that I should ignore this 3 part. I tried that and broke not only the ROM, but also the recovery.
This takes me to the second question. Where does the S2 store the recovery? When flashing a new ROM on any Samsung device, I end up with a different recovery to? Last time I made a nandroid backup, flashed a ROM that did not work, could not recover because the backup was made with a newer recovery version than the one flashed along with the ROM.
dk_zero-cool said:
Hi.
I my self are using and building for the HTC Desire and similar devices. However I have a friend who has the Galaxy s2 and wanted an ICS ROM on he's device. I found a ROM from in here, but I needed to change something in ramdisk to get UMS working.
I found that unlike my own phone, this one had 3 parts in the boot.img. The kernel, ramdisk and something else.
Does anyone have any idea what this something else is? How to split the boot.img and of cause how to put it assemble it again?
I search google and found someone saying that I should ignore this 3 part. I tried that and broke not only the ROM, but also the recovery.
This takes me to the second question. Where does the S2 store the recovery? When flashing a new ROM on any Samsung device, I end up with a different recovery to? Last time I made a nandroid backup, flashed a ROM that did not work, could not recover because the backup was made with a newer recovery version than the one flashed along with the ROM.
Click to expand...
Click to collapse
The recovery (mode) is part of the kernel.
If you have issues with a broken recovery, just flash another kernel containing a (CWM) recovery, such as CF-Root, Siyah, SpeedMod, N.E.A.K., etc.
P.S.: You can use Mobile Odin app from Chainfire to flash new (stock) ROMs, kernels, modems, CSCs, etc.
Good luck !
dk_zero-cool said:
Hi.
I my self are using and building for the HTC Desire and similar devices. However I have a friend who has the Galaxy s2 and wanted an ICS ROM on he's device. I found a ROM from in here, but I needed to change something in ramdisk to get UMS working.
I found that unlike my own phone, this one had 3 parts in the boot.img. The kernel, ramdisk and something else.
Does anyone have any idea what this something else is? How to split the boot.img and of cause how to put it assemble it again?
I search google and found someone saying that I should ignore this 3 part. I tried that and broke not only the ROM, but also the recovery.
This takes me to the second question. Where does the S2 store the recovery? When flashing a new ROM on any Samsung device, I end up with a different recovery to? Last time I made a nandroid backup, flashed a ROM that did not work, could not recover because the backup was made with a newer recovery version than the one flashed along with the ROM.
Click to expand...
Click to collapse
recovery is in sdcard/clockworkmod/backup or sdcard/external_sd/clockworkmod/backup .. if you did a backup with CWM
UMS is already supported in ICS, and with LP4 and Siyah kernel (newest) usb mass storage is supported in recovery mode also
Eudemony said:
recovery is in sdcard/clockworkmod/backup or sdcard/external_sd/clockworkmod/backup .. if you did a backup with CWM
UMS is already supported in ICS, and with LP4 and Siyah kernel (newest) usb mass storage is supported in recovery mode also
Click to expand...
Click to collapse
UMS is supported yes, but not always enabled. The ROM's I tried had MTP set instead. The newest CM9 has UMS as default now, but right now I'm just interested in how the boot.img works on these devices.
I use recoveries as backup system when the other fails. Having recovery depend o the regular boot.img is not very useful. Having the recovery console change on regular ROM flash is not helpful either.
The recovery and regular ROM should not have anything to do with one another.
But about the boot.img
How do I split an re-essamble it?
dk_zero-cool said:
UMS is supported yes, but not always enabled. The ROM's I tried had MTP set instead. The newest CM9 has UMS as default now, but right now I'm just interested in how the boot.img works on these devices.
I use recoveries as backup system when the other fails. Having recovery depend o the regular boot.img is not very useful. Having the recovery console change on regular ROM flash is not helpful either.
The recovery and regular ROM should not have anything to do with one another.
But about the boot.img
How do I split an re-essamble it?
Click to expand...
Click to collapse
ok think i am starting to understand .. here are the facts
1. to activate UMS instead of MTP go to settings > more... >USB utilites >connect mass storage to PC
2. Use clockwork recovery not stock recovery for backup purposes .. even if you cant restore because of a different recovery (which I havent found yet! but heard of) you can always flash the original insecure kernel and recover as that will have the version of clockwork recovery you used .. even if the phone doesnt boot up (boot loops) as you can still get into recovery mode using the 3 button method
3 ok this is what you want to know about .. but problem is i dont think you are using the right terminology maybe?
are you talking about a stock rom tar?
this comes with these files
boot.bin
cache.img
factoryfs.img
hidden.img
modem.bin
param.lfs
sbl.bin
zimage
or a clockwork recovery image zip
which comes with these files
modem.bin
zimage
edit: ok i found the boot.img in the clockwork recovery backup i have
this has the files
boot.img
nandroid.md5
cache.ext4.tar
data.ext4.tar
system.ext4.tar
if you chanage the boot.img then i assume the md5 will fail therefore not restore
you will need to generate a new md5 for the boot.img then insert that line into nandroid.md5 with notepad++ then it "should" work
dk_zero-cool said:
UMS is supported yes, but not always enabled. The ROM's I tried had MTP set instead. The newest CM9 has UMS as default now, but right now I'm just interested in how the boot.img works on these devices.
I use recoveries as backup system when the other fails. Having recovery depend o the regular boot.img is not very useful. Having the recovery console change on regular ROM flash is not helpful either.
The recovery and regular ROM should not have anything to do with one another.
But about the boot.img
How do I split an re-essamble it?
Click to expand...
Click to collapse
Ok. I do not know everything about boot.img but i will share what i know maybe somebody else will help us
All. kernel ramdisk and recovery mode is in the same partition mmcblk0p5 witch is not good at all but it is how it is then we have mmcblk0p6
what is called recovery partition and i9100 seems to not use this partition never ever. So when you flash new kernel you have new recovery as well and when you mess up with this kernel you do not have recovery mode as well lol
The first boot i tried to figure out was Siyah kernel i found in my phone very interesting script /sbin/ext/install.sh
[email protected]: # read_boot_headers /dev/mmcblk0p5
boot_offset=9397;boot_len=2480;recovery_offset=11877;recovery_len=2114;
we have something whats called 'boot offset' and its lenght. And then install.sh gets it out and save its as a payload
in /res/misc folder. Thats how it looks like
[email protected]: # dd skip=9397 count=2480 if=/dev/mmcblk0p5 of=boot.img.tar <--why tar? i know that from install.sh
then unpack the file and we have some apps and su file
res/misc/payload/CWMManager.apk.xz
res/misc/payload/Superuser.apk.xz
res/misc/payload/su.xz
res/misc/payload/ntfs-3g.xz
zcat'ed files but it is not a boot ramdisk and kernel what i was looking for
then i did the same with recovery offset
[email protected]: # dd skip=11877 count=2114 if=/dev/mmcblk0p5 of=recovery.img.xz <--why .zx? again from install.sh
xzcat recovery.img.xz > recovery.tar
and what inside? This
res/images/icon_installing_overlay01.png
res/images/icon_installing_overlay05.png
....
res/images/progress_fill.png
res/images/icon_installing_overlay06.png
sbin/e2fsck
sbin/killrecovery.sh
sbin/sdparted
sbin/recovery-samsung
sbin/fota.png
sbin/tune2fs
sbin/redbend_ua
sbin/parted
sbin/fix_permissions
sbin/mke2fs
not recovery. just some images and files. Then i started think what is before that boot offset its almost 5MB of data?
So there is a kernel and ramdisk all packed by LZMA offset 8400 up to this phrase:
BOOT_IMAGE_OFFSETSboot_offset=9397;boot_len=2480;recovery_offset=11877;recovery_len=2114
witch is end offset = 4810754 This is not a real end its mor than but im sure for now it is all length of file. Nothing is missing. Enough to unpack, Then we are able to extract it using my favourite dd
[email protected]: # dd if=/dev/mmcblk0p5 of=ramdisk.cpio.lzma skip=8400 count=4810754 bs=1
[email protected]: # unlzma ramdisk.cpio.lzma and this is not ramdisk yet lol
file what we have now is call ramdisk.cpio and thats what is there:
on a very begining ofsett 00000 D3 F0 21 E3 <---that i a kernel i think up to begining of CPIO
CPIO offset 30554 <-- 07070
TRAILER!!! + 00 00 00 00 offset 5,691,619
[email protected]: # dd if=ramdisk.cpio of=real-rd.cpio skip=30554 count=5691619 bs=1
And now we have ramdisk
There is one more gziped file offset 11339924 it is the same what is in /proc somewhere
Then i gave up cos im not able to repack this ramdisk by LZMA original is starting of 5D 00 00 00 04
but my its always ends with different digit but never 4

Categories

Resources