yashsingh1/xdaforums huggingface dataset:
[Galaxy S I9000 Android Development] Bejda:
@asder00: shhh...men at work..:) (same for me,look who's talking ;) )

If happens again you should try too cm7 initial .tar

http://db.tt/Dd1sgMFg

For me most of the time it's just that with odin auto-reboot unticked,pull off battery,back to recovery,flash any ics kernel,reboot system now and that's it,(almost) as if nothing happened.
[Galaxy S I9000 Android Development] krarvind:
the question is not whether you have had it or not but why does it happen and is there a clear reason and solution for it. if you have ideas or found a solution post here for others benefit.
[Galaxy S I9000 Android Development] mialwe:
Jep, and I think the binary one is started by this script (last line, "exec /init").

Just noticed that this script creates a logfile ("/boot.txt") -> booted (as I tested this other charge_animation issue while searching) -> it's there:

cywhale@HAL:~/android/system/bootable/recovery$ adb shell cat /boot.txt
Tue May 1 21:02:49 GMT 2012
No bad blocks.
Partition info: Total 11534336, Erase 262144, write 4096
Bad block 43 in reservoir area, skipping.
Found mapping block mark at 0xa00000 (block 40).
Found start of mapping table.
Found raw block mapping 1315 -> 2042
Successfully dumped partition to /stage1/boot.bin
umount: can't umount /sdcard: Invalid argument
cpio: . not created: newer or same age file exists
333+0 records in
333+0 records out
170496 bytes (166.5KB) copied, 0.015708 seconds, 10.4MB/s
616 blocks
Tue May 1 21:02:52 GMT 2012

So this script contained in the kernel source itself seems to route to booting system, recovery or charging via creating a CPIO file and in case of charging mode switching *.rc scripts.
[Galaxy S I9000 Android Development] lownoise:
Some info about the kernel

Stratosk ,Mialwe,

Where you refer to is the init script from the "preload" kernel.

When the phone boots, at first the preload init will be loaded and checks whether or not to boot in recovery or normal mode. It will then load the correct init.

The original idea of this kernel is from ATINM he was/is a member of the original team who developed cm7 for the Galaxy S.

Back in the days he was also a member of xda i don't know if he still is.

May bee you can contact him by irc cyanogenmod on freenode , or by twitter @atinm.

In the old days they had a logger on the team irc channel, you can find some old logs on github. https://github.com/cmsgs/cmsgs-team-irc-logs

I know that in the one of the log's atinm and koush discuss this working of this kernel
[Galaxy S I9000 Android Development] stratosk:
Thanks again mate!

You are right.

Of course, I'm totally stupid: We declare this file in usr/galaxysmtd_initramfs.list at the initramfs option in the kernel.

It's more clear to me know.

Thanks for the info lownoise! I will check it.
[Galaxy S I9000 Android Development] mialwe:
Just in case someone experiences the loop again, after flashing a safety kernel with working recovery the logfile /sdcard/bml_over_mtd.log would be interesting *before* re-flashing the ICS kernel (shortened example without loop):

root@android:/ # cat /sdcard/bml_over_mtd.log
+ export PATH=/:/sbin:/system/xbin:/system/bin:/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin
+ busybox cat
+ busybox date
########################################################################################
#
# Flashing boot image with bml_over_mtd on Tue May 1 21:46:16 GMT 2012
#
########################################################################################
+ /tmp/bml_over_mtd scan boot
No bad blocks.
+ status=0
+ test 0 -eq 15
+ echo Running flash_image...
Running flash_image...
+ /sbin/flash_image boot /tmp/boot.img
mtd: successfully wrote block at 0
mtd: successfully wrote block at 40000
mtd: successfully wrote block at 80000
...
...
mtd: successfully wrote block at 440000
wrote boot partition
+ exit

Maybe we can find out if its the flash process itself...
[Galaxy S I9000 Android Development] mygmy:
i did that and got into a bootloop tried removing the battery and still can't get into cwm :s wut should i do now :s plz help
[Galaxy S I9000 Android Development] lownoise:
Flash boot.img with heimdalll
[Galaxy S I9000 Android Development] Abyv:
Have bootloop everytime when on non stock..kernel(when trying to flash nightly on)then all the way back to download mode and to JVU..via odin..then...root and flash CM9 ..kinda used to this now..

But hopefully someone will solve this ongoing issue..
[Galaxy S I9000 Android Development] Christophe86:
just want to share my experience: re-flashed everything starting from stock sammy rom, tried some different kernels and ics roms. all flashed without wiping dalvik cache. result: not a single bootloop or lost of recovery.

so, my only advice I can give to users who had bootloops in the past after flashing is NOT to wipe dalvik cache for now, until devs find a solution.

PS. it's great to see you devs work so actively together to find a solution for this issue :thumbup:
[Galaxy S I9000 Android Development] saphirrot:
Got the same problem. I'm on onecosmics 4.2 with latest devil kernel. Since the 0.7x release I got the problem : when wiping dalvik cache I'm losing recovery and getting a boot loop.
[Galaxy S I9000 Android Development] Bejda:
Unfortunately i had this too when just reboot without any wipe dalvik-cache or any configuration change.

When i talked about dalvik it was cause think it gives more "chances" to produce what seems to be the closest and maybe exact same process...so,you're right in telling people to avoid dalvik-cache cleaning as possible if it's not to reproduce and get the bml_over_mtd file Mialwe asked for.

I don't even see the point of making dalvik-cache myself,i noticed the correlation when flashed some rom that includes dalvik wipe if i don't flash another kernel before first boot (once again,not always...can't see any rule behind).
[Galaxy S I9000 Android Development] pbecks1963:
save logfile /sdcard/bml_over_mtd.log

Hello people,

Is it an idea for the dev's of roms/kernels to include a "copy logfile /sdcard/bml_over_mtd.log to /sdcard/bml_over_mtd.old" IN a recue-kernel/cwm??

right now i've got fixcwm.tar.md5 and cm7-galaxys-initial-kernel.tar to come to the rescue when i've got bootloops. Perhaps someone can add the above extra "command" in cm7-galaxys-initial-kernel.tar?

Haven't tested cm7-galaxys-initial-kernel.tar yet. Perhaps it is possible to mount sdcard on the pc from this cwm?
[Galaxy S I9000 Android Development] Bejda:
Yes we can mount sdcard from initial cm7 kernel recovery menu,i was on it and adb connected the last time bootlps without recovery access happened to me but didn't think about the bml_over_mtd file...

Waiting for next occasion...
[Galaxy S I9000 Android Development] deadgamer:
Just happened to me.

Just pressed reboot to recovery button and it started bootlooping with no recovery. Other than bootlooping a few times it just froze on the i9000 black screen and then the picture got all messed up with blue-ish lines across the screen.

I'm actually running the same rom/kernel for like a month now. Didn't install new software for a while either.

I was running the 20120402 nightly of CM9 with Glitch kernel(v6 without bigmem mods or anything) OCed to 1.3ghz with no UV and no LiveOC or deep idle or anything like that.

Flashing boot.img with heimdall didn't help at all.

Had to flash FixRecovery.tar and then flash Glitch from CWM. Seems to be working fine now.

If you guys need any more info tell me.
[Galaxy S I9000 Android Development] Bejda:
Thinking it twice...isn't this a great idea?

Provide a rescue .tar version of any ics kernel with commands in it that could grab the most informations needed?

Perhaps including commands is somehow different with an odin .tar flash than a cwm one?Dunno...
[Galaxy S I9000 Android Development] franklin01:
From my own experience:

I think there are 2 kind of bootloop, first is rom related, second is kernel related, if there is some kind of fail during the flash (doesnt matter if it is odin/heimdal/cwm) there can be a bootloop.

Now the tricky thing is that with the exact same rom you can have a bootloop 1/100, meaning that in reality bootloop comes from bad write on the partition. (except in case of crappy rom and buggy kernel)

It seems that some file may be not properly flashed during the flash part, a quick fix to that was to flash twice in a row.

It could be BML related as our phone in partitionned in 10 (not exact number, need to check) BML partition with an important role, as we know that even smallest and emptiest partition if not flashed will cause a soft/hard brick.

What can we do to erase these bootloops?

Flash twice in a row or find a solution to check files after you flashed.

Hope it can help you.
[Galaxy S I9000 Android Development] Bejda:
It seems no bml_over_mtd file is created,i deleted the one lying on my sd,had bootloops,mounted sd in cm7 recovery and didn't found any.

Same goes for kernel user.log and last_kmsg.txt in /data,only the previous ones are there.
[Galaxy S I9000 Android Development] d0nald01:
This is also happening to me.

Every time I flash aokp roms I have to use Odin to flash ez base 3.0 then I can flash the new rom without bootloop
[Galaxy S I9000 Android Development] stratosk:
Let me write down findings about boot process so far. Forgive me, if they are already known but maybe can help us to find the reason about the issue.

1) We build normal initramfs and recovery initramfs in the boot.img that packed after the kernel build procedure.

2) We use a tiny initramfs (which is bundled in zImage) with only an init script (that Mialwe pointed out).

3) We don't use recovery partition (Samsung's bootloader does not support it)

4) During boot the init script from initramfs of 2) is used to identify if the recovery mode is selected.

a) The init scripts scans the kernel command line and if it finds the string 'bootmode=2' then it unpacks the recovery initramfs from boot.img and continues the boot process. The bootmode=2 is passed as command line argument either by the 3 key combination or by the aries_inject_cmdline function located in mach-aries.c file. If the string 'recovery' is passed as argument in reboot command the kernel injects the 'bootmode=2' in the command line.

b) It may also boot in recovery if it finds the file /cache/.startrecovery.

c) If a) or b) are not true there is a possibility (I don't know if it is still in use) to boot in emergency trying to install the zip that is placed in /sdcard/cyanogenmod.cfg

d) if none of a), b) ,c) are true it checks if the charging mode to start the kernel in lpm.

e) Else it unpacks the normal initramfs and boots normally.

What can go wrong in the above procedure and recovery is not started (it's only theory, I don't know the actual reason)?

1) The boot partition is bad flashed or corrupted. The only cure is reflashing (not only a GB kernel)

2) 'bootmode=2' is not passed in the kernel command line AND /cache/.startrecovery file does not exist.

3) Init script in the bundled initramfs cannot dump the boot partition to scan the load offsets.

I found also that pawitp enabled the /cache/.startrecovery check for compatibility with ROM manager 4 months ago. In all my tests I couldn't find any application (not even ROM manager) that use .startrecovery file to boot in recovery.

Once, during my tests, I managed to get my phone in bootloops but I couldn't reproduce this again. When this happened, I couldn't recover my phone (even with fixrecovery.tar I couldn't flash an ICS kernel). It seemed that the mtd 'boot' partition was corrupted.

My next steps:

1) I will try to reproduce again the bootloop to find a specific pattern when this is happening.

2) I think I will try to simplify the boot process dropping the .startrevovery and emergency boot checks.

3) Maybe I will try to combine normal and recovery initramfs in a single one that is bundled in zImage.
[Galaxy S I9000 Android Development] lownoise:
Emergency boot happens after the first boot when converted from rfs to yaffs2

Verstuurd van mijn GT-I9000 met Tapatalk
[Galaxy S I9000 Android Development] shaarky:
Stratosk, you may try to play with this ROM - http://xdaforums.com/showthread.php?p=25667467#post25667467 - I'm getting never ending boot loops pretty often, however It's anyway best ICS rom for me. It's a pity that I don't know how to investigate it, because the only usable way is to recover somehow via FixRecovery.tar.md5 and sometimes even JVU stock reflash don't work. Yesterday it took me 2 hours to recover from this state, although I did it previously several times already.

btw - you will not like it, but looks like Devil2 kernel recovers from this situation better then Semaphore ;-( (http://xdaforums.com/showpost.php?p=25667467&postcount=217)
[Galaxy S I9000 Android Development] rtfpessoa:
I don't know if this will help but will say it anyway.

I had that problem some time ago and i think it happend just when i used one updater-script that has the code to flash the boot.img on it.

Since i started using updater.sh from teamhacksung to flash boot.img i never got that problem again.
[Galaxy S I9000 Android Development] stratosk:
Can you please post some more details?

It's a little bit difficult to change ROM just for this test. I also need my phone for daily use.

Thanks anyway for your suggestion.

No problem. I don't bother if Devil's recovers better. My point is to find a solution for every kernel. But please define 'better'. Do you mean Devil2 always recover and Semaphore not? It maybe useful to examine it.
[Galaxy S I9000 Android Development] stratosk:
Could you please clarify if you always get a bootloop with "adb reboot recovery"? Any specific procedure? I mean do you flash a kernel in recovery and then try a normal restart?
[Galaxy S I9000 Android Development] Zatta:
Does anyone have the link to the oldest cm7 thread, the one before the nightlies thread, the thread that started in februari 2011 until april 2011? I am sure there is is a interesting link in it from the pre bml-over-mtd-era. When was that script introduced, does someone know an approximate date? I have started to read through this new cm7 nightlies thread,I know what I am looking for but until now I cant find it.

Taptalked u see
[Galaxy S I9000 Android Development] shaarky:
I mean when I flash using ODIN the FixRecovery.tar.md5 and after Semaphore, I never get then next just to Semaphore boot logo. But with Devil2 I'm able to recover it usually just using the method I described in the Elite rom thread.

Just now I'm stucked again, but this time is "never-ending" booting - just looking on the booting logo for 10mins. It happened right after I flashed Inverted Gapps and reboot (was cleaning cache and dalvik before flashing inverted gapps) - then I got boot loop, I flashed FixRecovery and then Devil2, but I think it has nothing to do with Inverted apps. In 9 cases out of ten I get bootloop usually when playing with CWM or/and the probability seems increasing when the phone is also connected to the charger, but this could be just feeling.

One more thing - If I remember correctly, just the Devil2 0.79 version seems to be so successful, even previous versions of Devil2 were really not successful, but it's not the case anymore with 0.79. Unortunatelly I had to wipe also internal memory card and I don't remember which previous versions were not good (0.66,0.74 test? ?? ...really don't know )

**update** so this time, I cleaned init.d (devil has this built in) and phone booted. Before I backuped init.d and logs to sdcard, let's see if there will be something. Not sure, but is semaphore cleaning init.d before flashing ?
[Galaxy S I9000 Android Development] stratosk:
I think you are right. I have the same feeling that the issue is somewhere in CWM. As you said playing with it. Maybe, In conjunction with the way that the init script that handles the boot procedure.

Can you please post the link to this zip (gapps)? Can you remember if you clear cache and then dalvik or the opposite?

No, Semaphore does not automatically clear init.d
[Galaxy S I9000 Android Development] shaarky:
It's always CACHE and then DALVIK cache, never vice versa.

Inverted Gapps are here - http://rootzwiki.com/topic/15092-invertedtotally-inverted-apps-4-22-contacts-and-mms-updated/ - but really I think it's very low probability it's linked with it.
[Galaxy S I9000 Android Development] stratosk:
I know, I don't blame the specific app or zip. I just want to check something.

Edit:

One more question. How do you get in into recovery? From power menu?

And one last: the link is for Nexus. Did you flash a zip from there?
[Galaxy S I9000 Android Development] BRSG:
For me, bootloop occurs when I try to change LCD Density in SlimICS from the default 182dpi to 220dpi... I don't think it's kernel related, because it happened not only with Slim's stock kernel, but with MNICS also...

I know this question it's not for me, but I'll also answer to it: I always rebooted, normally and to recovery, from power menu! I've also flashed those zip's, and every thing is running smooth, no problems at all!
[Galaxy S I9000 Android Development] shaarky:
Yes, usually from power menu (80%), but sometimes I'm using also function of Widgetsoid widgets - restart - recovery.

*update* for the previous boot loops it's clear it was caused by Init.D scripts in EliteV11.2 ROM, so it's OT for this thread. After I removed them, phone booted.

But it does not explain why I got previously to boot loop.

I tried to save some logs - but I'm afraid there were not generated during the time phone was in bootloop.

For the links - yes, I'm using combination those ZIPs (but there were also some older versions which are/were working for me) : http://www.2shared.com/file/A1-1W6WR/InvertedGContacts.html and http://www.2shared.com/file/RS-kUkwR/InvertedGCalendarParts1-2_extr.html etc...

But to prevent some misunderstanding - boot loops (Samsung logo --> Kernel logo (Samsung/Devil) --> Samsung logo + and plus it's not possible to get to the CWM) appeared very often also accidentally and not JUST during flashing of gapps.
[Galaxy S I9000 Android Development] stratosk:
Thanks guys.

OT: be aware what you flash. The zip contains those lines:

mount("ext3", "Data", "/dev/block/mmcblk1p25", "/data");
run_program("/system/xbin", "rm", "-rf", "/data/dalvik-cache/*");
show_progress(0.4, 0);
format("yaffs2","MTD", "cache");
format("yaffs2","MTD", "data");

I don't know why it tries to mount /data as ext3.

Then tries to format /data partition. Fortunately for you the mounting of data fails because there is no /dev/block/mmcblk1p25 device in our phone.

(Or it's too late for me!?!? :) )

EDIT: I guess the format of data fails because data is not and MTD partition.
[Galaxy S I9000 Android Development] mialwe:
No, not always (would be a very bad thing for working on a kernel :) ). I experienced only a few loops or freezes while flashing kernels 20-30 times a day sometimes so maybe I'm lucky here. The procedure(s):

1)

- adb reboot recovery

- flash test kernel

- reboot from CWM => loop, trying to reach CWM again => frozen charging animation

2)

- adb reboot recovery

- flash test kernel

- reboot to recovery from CWM => frozen charging animation

I *never* got a loop after wiping dalvik-cache and/or cache.

Setup:

- 4.0.4 ROM (CM9, ICS333,...)

- MNICS test kernels

- no init.d scripts

- no other tweaks

I'm waiting for the next loop/issue to get some logs since the day you started this thread (had the last one just before your OP if I remember right) but it seems the loops don't like me anymore (although I kept flashing test kernels and different 4.0.4 ROMs) - no more loop/issue since that day.
[Galaxy S I9000 Android Development] shaarky:
Last OT to this : Yep, never got wiped by those... but you are right, looks dangerous ;-)

Stratosk, I don't know how difficult it is, but can't you do Semaphore Kernel - ODIN flashable ? Then maybe more can be done. Also it's pity ADB is not working for Semaphore in CWM, but for \FixRecovery.tar.md5 it is (without ROOT)
[Galaxy S I9000 Android Development] stratosk:
Thanks Mialwe.

I had yesterday the first case your described.

Today, I smashed my phone (I want SGS3 :) ) doing adb reboot recovery - clean cache - dalvik cache - flashing kernel - reboot normal or reboot recovery again combinations with no luck.

BTW, what do you think about the combination of the 2 initramfs in one?

We can do it like GB. We will use a simplified init script that will check the command line for bootmode=2.

If it find it, it will use the recovery.rc or else it will use the init.rc.

Doing this we will avoid dump the boot partition to scan for loadoffsets (we will also gain few seconds boot time) and we will also simplify the bundling of initramfs's.
[Galaxy S I9000 Android Development] shaarky:
One more thing I'm experiencing all the time - when flashing "FixRecovery.tar.md5" and then Semaphore, after restart it's still "FixRecovery.tar.md5". But with Devil2, it's always Devil after flash ..?? Is there some difference ? Interesting thing is that now I have phone in the state when flashing Elite 11.2 RC I get always boot loops after this. Tried CM9 nightly -the same. Question is if we can use this "benefit" ?

However soon I'm going to recover phone, I need if for tomorrow.
[Galaxy S I9000 Android Development] stratosk:
I'm not really sure if this is possible.

Maybe, I could try. But for sure we need the changes I described to my post to Mialwe.

Just remember the step you do. Maybe, its a reproducible issue.

EDIT: Please allow me not to answer Semaphore specific questions in this thread (about the adb).
[Galaxy S I9000 Android Development] lownoise:
Let me try to explain.

When your come from a stock rom the device are rfs partitions. you know that for sure.

When you install the update*.zip from clockworkmod recovery the package will be extracted.

If you look in the updater script you see

package_extract_file("updater.sh", "/tmp/updater.sh");
set_perm(0, 0, 0777, "/tmp/updater.sh");

In the updater.sh you see the IF loop witch checks the current file system. If you come from stock the following condetion met

if /tmp/busybox test -e /dev/block/bml7

It will backup efs, writes the cyanogenmod.cfg en write for the first time the cm9 kernel and reboots

# write new kernel to boot partition
/tmp/flash_image boot /tmp/boot.img
if [ "$?" != "0" ] ; then
exit 3
fi
/tmp/busybox sync

/sbin/reboot now

When the first boot occurs the new partition info which is stored in the kernel will format the partitions to MTD.

I'm sorry i can't find now where the configuration is stored:(

On that moment the partitions doesn't contain any data anymore. And when the init executes

this rule applies

elif ! busybox test -e /system/build.prop ; then

Hopes this make sense to you:)
[Galaxy S I9000 Android Development] stratosk:
Yes, I know this procedure.

But the strange for me is (that's why I asked for details) that whenever flash CM9 over stock GB I always get bootloops after the first kernel flashing. Then I need to reboot to recovery (with the 3 button combo) and reflash the update* for CM9.

So, I thought that this check (for build.prop) is never true.
[Galaxy S I9000 Android Development] lownoise:
I had that also:) if i remember correct this is because it can't find the file specified in The cyanogenmod.cfg file. This happend to me when the update*.zip wasn't in the external_sd directory by The initial flash.
[Galaxy S I9000 Android Development] stratosk:
OK, I made some tests. I couldn't reproduce bootloops.

But I just flashed Semaphore via heimdall (zImage). Of course, it needs some extra work to be OK with combined initramfs. But I think a flashable kernel via ODIN is possible.

Testing this I also build a Semaphore version with ONLY recovery initramfs included.

The attached (I only tested with heimdall) kernel will ALWAYS boot in recovery.

If someone wants to test it when in bootloops...
[Galaxy S I9000 Android Development] shaarky:
Just tested (because of another bootloop after I cleaned init.d directory from Devil2's CWM 0.79 (this happened first time for this combination)... it flashed successfully, however bootloop continues afterwards as well. Flashed back FlashRecovery.tar, installed Kernel - phone is again up and running.