[Q] Files in Firmware <-> Odin/Heimdall fields - Galaxy S II Q&A, Help & Troubleshooting

Hello,
I'm quite new to Android, so please forgive me if my question has been already asked a lot of times (I've searched with no luck btw).
If i unpack a stock FW I see the files listed below. It's unclear to me what some of these are; I'll make my questions inline, please also correct me if I state something wrong. One thing before the questions: I know I don't need to flash most of these files most of the times, I just want to learn what they are I'm familiar with tar archives, unix and so on, I just don't know android.
boot.bin -> Bootloader, listed as "BOOTLOADER" in Odin and "Primary Bootloader" in Heimdall. Heimdall takes the file directly, should I put it alone in a .tar to flash it in Odin?
cache.img -> What is that? Is it flashed with "CSC" (inside a .tar) in Odin? Heimdall has the "cache" field for this one.
factoryfs.img -> User software, flashed in a .tar through the "PDA" field in Odin, heimdall has a field for this one.
hidden.img -> What is that? Which field flashes it?
modem.bin -> Phone firmware/baseband etc. "Phone" field in Odin (inside .tar), "Modem" in heimdall
param.lfs -> what is that? I think it's flashed with PDA (inside .tar) in odin, heimdall has the field
Sbl.bin -> What is that? Which field flashes it?
zImage -> Kernel, i know that one and how to flash it.
Other heimdall fields : secondary bootloader, database data: what are these?
Finally, if I'm not wrong, PIT is the partition scheme (usually it doesn't change) and Recovery is the recovery software (i.e. separate boot partition where you do hard reset)
I know it's a lot of questions the most of you already know well, links to sites describing the firmware structure could do too. I'm a developer at work, so I shouldn't have problems with technical documentation.
Many thanks and sorry for my poor english.
edit: of course I have a galaxy S2 and I'm referring to the files in its firmware. I have a mac and no space to install windows so I really need to understand heimdall

All files are packed in a tarball. If I am not wrong the .img files and the kernel are packed for PDA. PDA is the firmware/rom.
I don't know param.lfs but it looks like it just contains some pictures used for boot etc. (See here)
I would not touch the bootloader, if you screw something up, the device is bricked. Looks like Sbl.bin is familiar with the bootloader (Maybe Heimdall Seconday Bootloader?)

zxz0O0 said:
All files are packed in a tarball. If I am not wrong the .img files and the kernel are packed for PDA. PDA is the firmware/rom.
I don't know param.lfs but it looks like it just contains some pictures used for boot etc. )
I would not touch the bootloader, if you screw something up, the device is bricked. Looks like Sbl.bin is familiar with the bootloader (Maybe Heimdall Seconday Bootloader?)
Click to expand...
Click to collapse
Sbl is an acronym for Secondary Boot Loader! I was blind
I'm looking now for an architectural view of the software, I don't know why there are 2 boot loaders.
Thanks

Related

[Q] Clarification req'd for flashing rom using Heimdall

I'd like to flash to this rom GT-I9100_CPW_I9100XWKI4_I9100CPWKH1_I9100XXKI1.tar which I got from Intratech's thread as I want the older bootloader. I cannot use Odin as I run Linux and don't have access to a MS machine so want to use Heimdall.
Heimdall is installed and I've got as far as extracting the files from the above tar and have the following files.
Sbl.bin
boot.bin
cache.img
factoryfs.img
hidden.img
modem.bin
param.lfs
zImage
My questions are:
Whether I need to flash all the files in that list? I assume yes.
Heimdall offer the option of flashing primary and secondary boot loaders spl1 and spl2). Is Spl.bin above the primary or secondary bootloader?
Heimdall also requires a PIT file. I assume I should use the PIT file that I saved off my device?
I did do a search on here and google but found nothing that really answered all my questions so would appreciate a more knowledgeable person offering their advice.

[Q] Could CWM be installed via an ADB-script?

I've see the amazingly simple rooting method by DooMLoRD (ZergRush) listed here:
http://forum.xda-developers.com/showthread.php?t=1321582
And I'm wondering if something like that could be done for, once you have root, install CWM.
This would be interesting as it would add a new way to get CWM other than flashing some CWM-containing kernel or using the terrifying Rom manager app...
I am not sure if it would be so simple as DooMLoRD's script since CWM doesn't seem to be an "app" like su / busybox...
What do you think?
Genrauser said:
I've see the amazingly simple rooting method by DooMLoRD (ZergRush) listed here:
http://forum.xda-developers.com/showthread.php?t=1321582
And I'm wondering if something like that could be done for, once you have root, install CWM.
This would be interesting as it would add a new way to get CWM other than flashing some CWM-containing kernel or using the terrifying Rom manager app...
I am not sure if it would be so simple as DooMLoRD's script since CWM doesn't seem to be an "app" like su / busybox...
What do you think?
Click to expand...
Click to collapse
Your best bet at attempting this would be using Heimdall. From the help file:
Code:
7. Use the instructions to manually enter a command with all the files you want to flash.
Here is an example that does a full flash and repartition on a GT-I9000:
heimdall flash --repartition --pit s1_odin_20100512.pit --factoryfs factoryfs.rfs --cache cache.rfs --dbdata dbdata.rfs --primary-boot boot.bin --secondary-boot Sbl.bin --param param.lfs --kernel zImage --modem modem.bin
NOTE: The above command assumes the files specified are installed in the same directory as Heimdall.
Simply grab a CWM kernel, extract so you have the zimage then heimdall flash --kernel zImage. It would be easy enough to setup a .bat file to give you a few options/menus like the one in your link. Note that this requires the device to be in download mode and I can't imagine any other safe or even possible ways apart from download mode using odin/heimdall or flashing a zip via a custom recovery. Considering that you either have to be in download mode/recovery it seems a little counter productive to go to the extra effort of extracting images or using a command prompt but the above should work.
Genrauser said:
This would be interesting as it would add a new way to get CWM other than flashing some CWM-containing kernel
Click to expand...
Click to collapse
As the recovery mode is part of the kernel, you HAVE TO flash a kernel that contains CWM if you want to use CWM.
THAT however can be done via ADB, yes.
Code:
adb push zImage /sdcard/zImage
adb shell su -c dd if=/sdcard/zImage of=/dev/block/mmcblk0p5 bs=4096
I see.. so what I was thinging is not possible
As you both says, you need to flash a kernel whatsoever.. so the stardart way is much faster than having to extract the zimage and then flash it via adb on download mode (this is the problem, if it could be done on normal mode like that rooting method via adb, getting the zimage and then applying it whenever would be awesome.. but as far as you say it is not ).
Well, really a shame. Thanks both for your help on this!
For what I posted above, you do not need to go into download mode.
If your phone is rooted it works from "normal" mode (i.e. the system running).
You could also check out my little kTool (see sig), that allows you to dump the current kernel or flash a zImage from /sdcard (and a few more things).
The choice of kernels containing is huge for our beloved S2, from ones being very close to original stock down to totally custom ones.
Okay, my bad then, since you didn't elaborate more I implyied you agreed with Hollow.Droid on the "only download mode" subject.
So you actually can change the entire zImage for the CWM with the phone on normal mode... it woud be from the CWM only, not the entire kernel right? Because if a new entire kernel is needed we are on the same stuff again, then its faster to just flash the file via odin and go on.
Otherwise, it would be as simple as getting the CWM's zImage from somewhere and then add it to the phone via adb whenever..
CWM is part of the kernel, the zImage contains the kernel that contains the CWM.
You can not "install CWM" without flashing a whole kernel zImage, the "zImage" *is* the kernel, not only some CWM files.
Okay thanks, sorry for the late answering.
Then I have to flash a new kernel anyway, so it's just faster to do it via odin rather than extracting a zimage and then having to connect, config adb incase you didn't before, etc.
Thanks a lot for your time!

flashing stock rom on i9300 using heimdall and linux

hello guys!
Could you please help me to flash stock rom on my i9300 with heimdall?
i downloaded stock firmware for croatia(tmobile) from sammobile and tried to flash rom with mobile odin lite. it worked. kinda. csc was broken and i was not sure shich csc to choose so i rooted my phone back to cm10.
now i'd like to try with heimdall. after unzipping and untaring downloaded file i got following files:
boot.img
cache.img
hidden.img
modem.bin
recovery.img
system.img
How should i flash it?
i'd try by myself but i'm not so sure.
i guess using something like heimdall --primary-boot boot.img --system system.img --modem modem.bin --recovery recovery.img --hidden hidden.img --cache cache.img
is order ok? should i try with different order? and I'm not so sure about boot.img switch because there is --primary-boot and --secondary-boot
Thanks in advance!
devil_kc said:
hello guys!
Could you please help me to flash stock rom on my i9300 with heimdall?
i downloaded stock firmware for croatia(tmobile) from sammobile and tried to flash rom with mobile odin lite. it worked. kinda. csc was broken and i was not sure shich csc to choose so i rooted my phone back to cm10.
now i'd like to try with heimdall. after unzipping and untaring downloaded file i got following files:
boot.img
cache.img
hidden.img
modem.bin
recovery.img
system.img
How should i flash it?
i'd try by myself but i'm not so sure.
i guess using something like heimdall --primary-boot boot.img --system system.img --modem modem.bin --recovery recovery.img --hidden hidden.img --cache cache.img
is order ok? should i try with different order? and I'm not so sure about boot.img switch because there is --primary-boot and --secondary-boot
Thanks in advance!
Click to expand...
Click to collapse
Hi, did you try it? I had the same problem with my italian firmware some days ago. I tried and unfortunately I failed! My phone freezed in "Samsung".
I flashed via CWM that firmware and so now it's working.
But it seems that Heimdall isn't so popular...
devil_kc said:
hello guys!
Could you please help me to flash stock rom on my i9300 with heimdall?
i downloaded stock firmware for croatia(tmobile) from sammobile and tried to flash rom with mobile odin lite. it worked. kinda. csc was broken and i was not sure shich csc to choose so i rooted my phone back to cm10.
now i'd like to try with heimdall. after unzipping and untaring downloaded file i got following files:
boot.img
cache.img
hidden.img
modem.bin
recovery.img
system.img
How should i flash it?
i'd try by myself but i'm not so sure.
i guess using something like heimdall --primary-boot boot.img --system system.img --modem modem.bin --recovery recovery.img --hidden hidden.img --cache cache.img
is order ok? should i try with different order? and I'm not so sure about boot.img switch because there is --primary-boot and --secondary-boot
Thanks in advance!
Click to expand...
Click to collapse
Start with Hiemdall --print-pit>tmp.txt.
Then open tmp.txt in a text editor, You will see the proper names of the partitions. Then you have to match the partition names from the phone to the file names in your rom image. The command you typed seems mostly correct, but you need to check these partition names to make sure your current rom matches up, for instance,"--primary-boot" might be "--boot", and "--modem" might be "--radio" but don't quote me on that.
skeptonomicon said:
Start with Hiemdall --print-pit>tmp.txt.
Then open tmp.txt in a text editor, You will see the proper names of the partitions. Then you have to match the partition names from the phone to the file names in your rom image. The command you typed seems mostly correct, but you need to check these partition names to make sure your current rom matches up, for instance,"--primary-boot" might be "--boot", and "--modem" might be "--radio" but don't quote me on that.
Click to expand...
Click to collapse
Thanks man! but unfortunately my i9300 died of sds and i'm trying to get it fixed by samsung. with no luck so far.
sending it back to service tomorrow and we'll see. but this is good to know, thanks!

Can't boot into recovery after flashing the recovery image

Hi!
I have a problem with a I9100. I follow the instructions on CyanogenMod wiki for flashing the recovery, but something went wrong.
I used heimdall 1.4.0 in GNU/Linux and execute
Code:
sudo heimdall flash --kernel zImage --no-reboot
All worked well and the blue progress bar appears on the screen. When it finished, I tried to enter recovery using the VolUp+Home+PowerUp buttons combination, the Samsung Galaxy S2 logo appears on the screen but it is stuck on this screen.
I tried to re-download the zImage file (using another link, different from the CM wiki one, but the same happened.
Is there an easy way to reboot into recovery from Heimdall, like with fastboot on other devices?
Is possible to install a recovery in another way?
Best regards and thanks in advance
Lk2 said:
Hi!
I have a problem with a I9100. I follow the instructions on CyanogenMod wiki for flashing the recovery, but something went wrong.
I used heimdall 1.4.0 in GNU/Linux and execute
Code:
sudo heimdall flash --kernel zImage --no-reboot
All worked well and the blue progress bar appears on the screen. When it finished, I tried to enter recovery using the VolUp+Home+PowerUp buttons combination, the Samsung Galaxy S2 logo appears on the screen but it is stuck on this screen.
I tried to re-download the zImage file (using another link, different from the CM wiki one, but the same happened.
Is there an easy way to reboot into recovery from Heimdall, like with fastboot on other devices?
Is possible to install a recovery in another way?
Best regards and thanks in advance
Click to expand...
Click to collapse
try 'Odin flash' of a recovery file from a windows Pc and see
Thanks for your answer.
I tried to flash the TAR package with zImage inside from Odin, and same result.
I tried to flash a stock ROM with Odin, and it gives me a non-readable error (a lot of []).
I tried to decompress the stock ROM and flashing with heimdall:
Code:
sudo heimdall flash --primary-boot boot.bin --cache cache.img --factoryfs factoryfs.img --hidden hidden.img --modem modem.bin --param param.lfs --secondary-boot Sbl.bin --kernel zImage --no-reboot
And it fails (primary-boot not recognized):
Beginning session...
Session begun.
Downloading device's PIT file...
PIT file download successful.
ERROR: Partition name for "primary-boot" could not be located
Ending session...
Releasing device interface...
Re-attaching kernel driver...
Click to expand...
Click to collapse
Any idea?
Type this in android terminal emulator:
Su
Reboot recovery
Send from my SGS2 I9100 with HassanROM and latest DorimanX 8.xx kernel
I can't do "reboot recovery" from Android Terminal because I have another issue (read bellow)
Something went wrong with Heimdall. After all, using Odin I was able to boot into recovery mode and flash the ROMs, but when I tried to reboot in "normal mode" I got a "kernel panic upload mode rst_stat=0x200000000" screen.
I did a little research and it appears to be mandatory to flash a stock ROM and begin again with all the process.
I tried it, with the latest stock ROM for my country and company, but Odin return an extrange error when I press in "Start" button. The popup Windows puts the filename and a lot of "squares" (character with a different encoding, like chinese).
EDITED: I was able to flash the stock ROM, but the phone still doesn't boot. The yellow triangle disappeared but it cannot but
What can I try next?

ND7 Boot loop

odin'd ND7 for the correct model i605 from a site other than sammobile (download was really slow), everything went through fine when it went to reboot it does a quick boot loop
cannot go to recovery mode, but can go to odin.
cannot flash full tar back to it, it fails on sboot
So I downloaded the file from sammobile and extracted it
thinking maybe I have to make a flash file without the bootloader if possible?
extracted the tar
boot.img
cache.img
hidden.img
modem.bin
recovery.img
sboot.bin
system.img
tz.img
edit. used pit file with odin (read in other threads after the fact) and all seems clear, very noob of me -.-
normally don't have to use it...
anyways still want to know if possible to make without bootloader and/or make something like this:
http://forum.xda-developers.com/showpost.php?p=24278264&postcount=9

Categories

Resources