yashsingh1/xdaforums huggingface dataset:
[Galaxy Note GT-N7000 General] Chainfire:
Confirmed, found this line in updater-script:

format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0");

That's the cause of your brick right there, PARANOIDANDROID ...

EDIT #1:

(MIDNOTE doesn't seem to have anything to do with this, but to be certain, I'm also checking that one ...)

EDIT #2:

MIDNOTE seems to be clean. Adjusting thread title to stop giving MIDNOTE a bad name :)

None of this is surprising, btw ...

Don't flash ParanoidAndroid for the time being !
[Galaxy Note GT-N7000 General] metalcerb:
Thanks, i'm gonna keep MIDNOTE 1.6.
[Galaxy Note GT-N7000 General] zylor:
Well well.. And Imilka knows this... he is a respected developer and still he made a tremendous error on this!

:mad:
[Galaxy Note GT-N7000 General] Aldrick75:
I guess I was lucky. I flashed paranoid android a few days ago and used it for a couple of days. Just got off it to try another rom. I was just considering reflashing it back.

Now I have a quick question, IF you are say on ParanoidAndroid or any other ROM that has something like that on it's code BUT you are on a kernel with the command disabled... is there still a risk of bricking the phone?
[Galaxy Note GT-N7000 General] zylor:
Already contacted Imilka on this issue!! What a tremendous error!

I am starting to develop Midnote and even i, yes i am an amateur compared to all you senior devs out here, even i know that using format command triggers the bug!

:mad:

Chainfire thanks for reading my PM :D

And thanks Entropy for all your hard work on this bug!

Thank you both for all :D
[Galaxy Note GT-N7000 General] Chainfire:
If you are running a kernel that has the ERASE command disabled in the kernel itself, I believe you are safe.

But many kernels are not safe, and thus we should avoid using the format command altogether.

This is not imilka's fault, or my fault, or zylor's fault, or anything. It's a combination of factors that creates a dangerous situation, a combination of factors that we hope Samsung will fix soon in their kernels !
[Galaxy Note GT-N7000 General] zylor:
I am waiting for Samsung to fix it... but damn... in a full week i had my Note bricked twice! What a damn record..

Next time i'll make sure that i review the updater-script before flashing a rom!
[Galaxy Note GT-N7000 General] sam.wilder:
So the error will occur when flashing the affected ROM and not when flashing another ROM from it. Just double checking.

Can a script be developed to check for this line in a ROM.
[Galaxy Note GT-N7000 General] Aldrick75:
Thank you for the clarification. And thank you to all the devs who works on our wonderful device. IMO you guys do better work than samsung devs. :D

We all know the risks going into rooting and flashing. I myself bricked my note trying to flash a rom during the early days of this bug. Kudos to Samsung for replacing the mother board without cost but I do hope they resolve this issue asap.
[Galaxy Note GT-N7000 General] praetorius:
i think the OP flashed from ICS-based kernel to a CM9 firmware. the 'standard' procedure as with all CM9 threads i read is to flash from a GB kernel.
[Galaxy Note GT-N7000 General] M3TALLICA:
ROMs are not affected.

Meaning of that code is the rom you are flashing is wipe rom. It will auto format your data and/or cache partition which triggers the bug if erase command is not disabled within the kernel.
[Galaxy Note GT-N7000 General] :
Actually you are right and wrong!

You can flash from CF Root 5.6 ICS!

But if the updater-script contains a format command instead of delete_recursive you will brick just like i did!

The safest way is to flash from GB kernel

but you can flash from ICS also BUT if the line above is present prepare to have a brick! :o

Paranoidandroid thread is temporary closed and the link of the rom was removed by precaution :p
[Galaxy Note GT-N7000 General] nickshertzer:
delete_recursive

Interesting. When I flashed PA (from Abyss 3.9 kernel) it formatted my SD Card. I wondered why the hell it did that. I imagine it has something to do with the EMMC / SDCard mount switcharoo that happens in some kernels.

So just for posterity's sake, what is the delete_recursive command one could use in the updater-script to replace:

format("ext4", "EMMC", "/dev/block/mmcblk0p9");
format("ext4", "EMMC", "/dev/block/mmcblk0p7");
[Galaxy Note GT-N7000 General] :
Something like:

delete_recursive("/system")

If this case it would be:

delete_recursive("/cache");
delete_recursive("/data/cache")

To make a full wipe updater-script:

delete_recursive("/system");
delete_recursive("/cache");
delete_recursive("/data/cache");
delete_recursive("/data");

Like this it won't trigger the emmc bug!
[Galaxy Note GT-N7000 General] nickshertzer:
Whoa whoa whoa there Zylor,

we just had more of a dev chat than the last 10 pages (or more) of the PA thread in the developement section...

There should definitely be more *****ing, moaning, and requests for ETA's going on here in General.

:o
[Galaxy Note GT-N7000 General] :
What do you mean with the " whoa whoa whoa? "
[Galaxy Note GT-N7000 General] nickshertzer:
I guess the /sarcasm did not come through in translation ;)

What I meant was you one post here has been more helpful than the drivel posted in the PA thread (that was recently cleaned by thread mods).
[Galaxy Note GT-N7000 General] :
Sorry i read in the wrong way!

Well at least someone was able to see positive stuff thru this :D

Thanks for your support and sorry for my answer! Will edit it :p
[Galaxy Note GT-N7000 General] metalcerb:
I make a hard brick only in 6 hours using a note, but you win me, 2 hard bricks in one week is something to much bad.

Zylor, i am Jorge Teixeira from Porto :)
[Galaxy Note GT-N7000 General] ~BSOD~:
What i'm not getting here is i flashed PA 0.1 <-> CM9 <-> PA 0.2 <-> AOKP interchangeably numerous times even without switching to GB rom between them. Although worth mentioning that i always used Abyss 4.2 Red Pill to clear caches or data/factory reset or even formatting system. I think all these are ICS roms only, so am i from that lucky breed of peoples here or is there a calm before the thunderstorm is waiting for me in my Note. :confused:
[Galaxy Note GT-N7000 General] :
Because between the flashes you always used safe kernels :D

CM9 based kernels are safe to use!

That's why!

I know ehheh :D
[Galaxy Note GT-N7000 General] andreww88:
Kinda confused, zylor. What kernel did you wipe with that caused your brick? The ParanoidAndroid kernel? Isn't that the CM9 kernel? I've read through everything, but just isn't making much sense and want to clarify it for myself.
[Galaxy Note GT-N7000 General] :
If you read the OP i flashed from CF Root 5.6!

It did trigger the bug because paranoidandroid updater-script had a format command on it!
[Galaxy Note GT-N7000 General] Dissaor:
emmm :confused: sorry i need to ask maybe its really obvious but im really just making my way into android, question.... So i flashed Paranoid with thor, am i safe or should go back to stock ICS :S please let me know!
[Galaxy Note GT-N7000 General] :
My answer to that is:

The safest way is:

Flash always from gingerbread kernel like abyss 4.2!

Simple as that :D

Stock ics kernels also have the bug so always flash abyss 4.2, reboot recovery and flash whatever you want :)
[Galaxy Note GT-N7000 General] Dissaor:
I flashed coming from 2.3.5, with what i said, so i was lucky nothing happened :S, and now it is stable right?.. so if there is an update with that little (BIG) bug it should be safe flashing from where i am now to the update or still you recommend flashing from abyss 4.2 sorry if that is redundant!! and thanks again!
[Galaxy Note GT-N7000 General] :
Always play for the safest way:

Flash abyss 4.2

Reboot recovery

Flash whatever you want

This is the safest way :D
[Galaxy Note GT-N7000 General] LordManhattan:
Interesting. I've been running ParanoidAndroid for a month now. I'm not using the stock kernel that comes with it anymore, but i flashed at least 5-10 times using it. When i think about it i've also flashed countless times (yes, dangerous is my middle name) with the LP kernels without getting bricked.
[Galaxy Note GT-N7000 General] Dissaor:
Got it my friend thank you very much!!!! :D
[Galaxy Note GT-N7000 General] sujal:
You got a SGN for free, got the motherboard replaced twice for free and what not. Mind buying me some lottery tickets with your lucky hands?? :P
[Galaxy Note GT-N7000 General] robb13:
So is it safe to flash Paranoid Android coming from a GB rom, rooted with doomlord, cwm recovery 5.5 from CF Root Flasher?
[Galaxy Note GT-N7000 General] imilka:
If format cannot be used on CM9 kernel, then it's not safer than any Samsung bugged kernel, right? :)
[Galaxy Note GT-N7000 General] kailashnj:
Same here. I installed the PA v0.1 using the OP and after installing the CF kernel. Then I have moved between CM9, Asylum and PA 0.2 many times using what ever kernel that I was on at that time. Though most of the times I was on THOR's kernel. I have done only wipe cache and wipe dalvik for installing from the CWM.

Which means have I been doing something wrong. By the way I have never installed the Abyss 4.2 kernel till date. Oh god!!!!
[Galaxy Note GT-N7000 General] M3TALLICA:
It is not about the kernel used in PA. If it's based on official CM9, it is 100% safe.

Zylor bricked his phone because of the update-script used in PA.

Edit

If he had used any GB kernel or ICS kernel with erase command disabled within the kernel and recovery, there would not have been this incident.
[Galaxy Note GT-N7000 General] :
If euromillions is on me i'll buy you a Note! :D

If you come from gingerbread yes it is :D

Like i told on page 3 mate! With this:

delete_recursive("/system")
delete_recursive("/data")
delete_recursive("/cache)
delete_recursive("/data/cache)

:D

Does cleanup the partitions and doesn't trigger the bug :D

Well if you are now on Paranoidandroid stay there.. CM9 kernels are known to be safe!

Actually if you read what Chainfire posted:

The kernel from him is SAFE!

But a buggy update-binary or the format command used in updater-script can trigger the bug!

Like i told imilka:

Use:

delete_recursive("/system")
delete_recursive("/data")
delete_recursive("/cache)
delete_recursive("/data/cache)

:D

Does cleanup the partitions and doesn't trigger the bug :D
[Galaxy Note GT-N7000 General] M3TALLICA:
@Zylor, format command does not trigger the bug if kernel used to flash has mmc_cap_erase disabled. I had flashed my custom ics rom with Franco R4 kernel. And the update script had format command.

May be I was lucky or devs can shed some light on here.
[Galaxy Note GT-N7000 General] andreww88:
Okay, so the CM9 kernel had nothing to do with it. That's what I thought.
[Galaxy Note GT-N7000 General] M3TALLICA:
That's right.
[Galaxy Note GT-N7000 General] kailashnj:
Well today I moved to CM9 nightly and was planning to reinstall PA 0.2 as I wanted the PA's application DPI settings.

So is it safe to reinstall PA 0.2 from CWM recovery of the CM9 nightly (1806).

Kindly let me know, I am getting paranoid right now.

Imilka - hope you will use the updater script that zylor has given you for the version 0.3. Thanks.
[Galaxy Note GT-N7000 General] andreww88:
I'm still kinda confused as to how PA is to blame. It seems like he just used a bad kernel. If he was on CF root whatever and flashed PA and THEN wiped data, it wouldn't have caused the brick because he would've switched to CM9 kernel after he flashed PA.

---------- Post added at 05:19 PM ---------- Previous post was at 05:18 PM ----------

If you are already on CM9 nightly then yes you can flash PA and be fine because it to is CM9 based and uses a CM9 kernel by default.
[Galaxy Note GT-N7000 General] Chainfire:
It's probably because you missed all those posts stating PA isn't to blame.

But nevertheless, PA can fix the problem in a really simple way, that will prevent a lot of possible bricks.

And thus we ask PA to do exactly that.

Also, your scenario would *still* have caused the brick, because its that act of install PA that causes the brick, not any wipe selected from any menu.
[Galaxy Note GT-N7000 General] andreww88:
Okay, well I read all the posts in this thread so far. Thanks anyway.
[Galaxy Note GT-N7000 General] Isriam:
lol has nothing to do with pa then this thread should be renamed and discussion of pa should be opened again. No one else bricked out of the hundreds that followed the directions by imlka. you can't prevent every idiot from not following the directions.
[Galaxy Note GT-N7000 General] M3TALLICA:
Agree with you Andrew. I don't want to flame but if Zylor had read the instructions posted in CF Root thread, there would not have been this incident.

This has nothing to do with PA and CF Root kernel but better safe than sorry, format commands ought to be disabled.
[Galaxy Note GT-N7000 General] :
Boy124 and Isriam like Chainfire said the method from Imilka did brick my Note, could have happened to anyone and it could be avoided in my opinion by replacing format commands with delete_recursive!

I was the first, there could have been more, unfortunatly i was the only one but now that more bricks will be avoided thanks to me!
[Galaxy Note GT-N7000 General] OpenMinded:
This is Exactly my question!

Is it possible on a kernel with mmc_cap_erase disabled,to still trigger the bug by an updater script format command?
[Galaxy Note GT-N7000 General] :
Chainfire already answered you:

CF Root 5.6 has the mmc cap erase disabled but the format command did brick my Note! So i guess here you have your answer from what Chainfire said!

Boy124: On my first brick i flashed more then 30 times until the bug was triggered.. now the second brick only one time and i got it hardbricked!

Yes you were lucky!
[Galaxy Note GT-N7000 General] Chainfire:
No, that's not true. As I said, it's a combination of factors.

CF-Root is a *Samsung* kernel and is thus (depending on version, and like many other kernels) vulnerable. What we have done is patched out the binary calls that may trigger the brick.

However, update-binaries built with a kernel source tree that do have the MMC_CAP_ERASE enabled can still trigger the brick.

On a truly safe kernel (full recompile from source, with the relevant code portions fixed) the bug cannot occur even with a faulty update-binary.

As stated before, this isn't PA's fault - BUT, PA can implement a really simple fix that will prevent this from happening again.

The "format" command from update-binary being able to trigger the bug on a not-fully-safe kernel has been known to devs on this platform for quite some time ...
[Galaxy Note GT-N7000 General] Isriam:
Thanks for clearing it up chainfire.
[Galaxy Note GT-N7000 General] :
Thanks Chain for clarifying things to me!

What makes me happy about all this is that Devs like you, Entropy and so on see this thread and more people get clarified about the issue and what causes it!

I know i helped a lot of people with this brick and honestly i wanna learn more about Android and deviing just to make this community a lot better :D
[Galaxy Note GT-N7000 General] :
Can you explain to me of how the fix will be done?
[Galaxy Note GT-N7000 General] mehalaktas:
If I understand correctly Inside this "META-INF\com\google\android" folder there is a update script file. And Inside this file there is a format code

"format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0");"

To fix the problem I guess the above code should be replaced with the code below

delete_recursive("/system")

delete_recursive("/data")

delete_recursive("/cache)

delete_recursive("/data/cache)
[Galaxy Note GT-N7000 General] :
Probably it will be something like that! Waiting for Chainfire's reply ;)
[Galaxy Note GT-N7000 General] akenis:
So do speedmod and Franco ICS kernels qualify as truly safe? Or do they have the same limitations as CF 5.6? I'm getting ready to try Rocket Rom which comes packaged with CF 5.6 LQ2 I believe. Some on that thread are saying why bother flashing speedmod....
[Galaxy Note GT-N7000 General] Chainfire:
Something like that would be a solution, yes.

I don't keep track of which kernels are and aren't safe, sorry. Ask the kernel developer if their kernel is safe.
[Galaxy Note GT-N7000 General] beerbong:
Found the same line in CM9 nightly updater-script for galaxy note:

format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0");

Does this means CM has to change this line too?
[Galaxy Note GT-N7000 General] trahzebuck:
Yes and I'm sure there are more updater_sripts out there.

And I had some combats in different forums regarding to this.

@Chainfire: I really appreciate your work and your estimation.

But closing the PA-thread is hard in my eyes and leaves a wrong stamp on the dev. if zylor had followed the install-instructions and all the general warnings (your's too) not to flash with an ICS-Kernel - nothing had happened.

just my opinion. sadly i dont know how to remove my "thank" at the closing-post.
[Galaxy Note GT-N7000 General] kitrax59:
with all due respect to Chainfire and the other mods but I can't hold my silence and have to agree with this one. I have checked all other CM9 related roms that I have I downloaded and they all have the format command in the updater-script: cm9 nightly, asylum, aokp, ganbarou, vengeance/miui.. so, what will happen to other threads? Since the PA download link was temporarily removed, what will happen to the download links of the other roms?
[Galaxy Note GT-N7000 General] breckbit:
I´m wondering if Samsung use the "format" command on the OTA Update for clearing the cache. If so, then an simple stock OTA update could trigger the eMMC lock-up. that sounds gross to me...
[Galaxy Note GT-N7000 General] ThaiDai:
The reason for this:

too much copy-and-paste without checking what's inside.

updater-script or build.prop are good examples - build.props are sometimes really funny if you sort them alphabetically.

Resulting in many "new" ROMs or some "new" Kernels. Surface polishing but no real development.
[Galaxy Note GT-N7000 General] M3TALLICA:
If Official CM and other ROMs too use format command in update script. Users need to be careful and read the instructions thoroughly.

Always use safe GB kernel to flash ROMs.

Again there's no risk with format command when executed from totally safe kernel. As Chainfire said, CF-Root kernels are Samsung kernels with just busy box, root and recovery. So all the bugs of stock kernel exist in CF Root kernels.

BUT from my experience (Chainfire too performed tests himself) CF Root has 100% safe recovery. It is completely safe to backup-restore, wipe data/factory reset from the CF Root 5.6 recovery. Don't get confused with format option in the recovery and format command executed from update script, they work different way.

Reading the instructions posted on PA and CF Root thread would have prevented this.
[Galaxy Note GT-N7000 General] bhasg1007:
Well it is clearly mentioned not to flash CM9 based roms from ICS kernels and guess what u actually did that and more over you again flashed CF kernel back after flashing paranoid, CF kernel does not support cm9 roms
[Galaxy Note GT-N7000 General] :
I'd like to know too :P
[Galaxy Note GT-N7000 General] mehalaktas:
+100000000
[Galaxy Note GT-N7000 General] nfribeiro:
How can we pressure Samsung to release the fix. Signing a Petition?
[Galaxy Note GT-N7000 General] :
That won't work! We can only wait for them to do something about it! :(
[Galaxy Note GT-N7000 General] Chainfire:
Re: CM9 and derivatives, according to codeworkx, the update-binary used in those updates is now safe, and thus there shouldn't be a problem.

(Personally I would still refrain from testing that out, though)

Samsung has stated multiple times they are working on a solution, btw.
[Galaxy Note GT-N7000 General] :
Awesome :D

Imilka confirmed what i feared:

Quoted from paranoid android discussion thread!

No code review... bricks appear!

Call me an idiot but at least i saved more bricks from happening!
[Galaxy Note GT-N7000 General] shatroghistro:
???

I am totally confused right now..

Waited PA 0.3 to flash, but now I am afraid to flash anything that has [ICS] in it..

I guess I'll have to stick to GB roms.. I don't want to risk bricking my note and than have to deal with warranty and other stuff..
[Galaxy Note GT-N7000 General] Chainfire:
That's messed up then, back to codeworkx with this info...
[Galaxy Note GT-N7000 General] piperdaddy:
Note bricked with PA v0.1

So this explains why my Note got bricked when I flashed PA ROM even though I followed all the steps that were given initially. That time the link to "safe" kernel was down so a few members suggested that flashing PAs .zip file WITHOUT doing wipe/reset would be safe. That time I was on Criskelo's LPY.

Kudos to Chainfire for pinpointing the issue and taking some action (temporary thread lock down). Once PA cleans up the code, it would be good to see further development.

But overall, this (thread) has provided good and inherently useful information on the erase/format commands used in update.zip files. Thank you, XDA.
[Galaxy Note GT-N7000 General] Entropy512:
Not entirely true. http://review.cyanogenmod.com/#/c/17326/ combined with a boardconfig change http://review.cyanogenmod.com/#/c/17484/ allows for formatting of partitions without wipe (just like Gingerbread). At least in theory, recent CM9 nightlies (June 13 and later) should be able to safely format partitions without triggering the bug, as they format without wiping. Any update-binaries built before that are unsafe. Note that I have yet to fully test this - for this reason the CM9 instructions still contain a "safe" (MMC_CAP_ERASE removed) kernel to Odin prior to flashing the CM9 package in recovery. Once I have fully tested it (instrumented kernel which spams dmesg when an erase attempt occurs - see https://github.com/Entropy512/n7000_erasetest_kernel) the instructions will be changed.

Looking at imilka's thread, PA 0.2 was released on May 30 (last edit to that post), which is LONG before this change went in. Also, if imilka took a while to do a clobber - BoardConfig changes don't always "take" until you do a "make clobber" or remove the target directory. (All CM9 nightlies are built from a clean slate each night.)

Using rm -rf as a workaround can lead to highly unpredictable flashing behavior in the event of mild filesystem corruption.

Based on these reports, I need to re-check this with my instrumented kernel. I am not sure if imilka copied his update-binary before or after that change was made.

This is why the instructions for flashing CM9 include a "safe" (MMC_CAP_ERASE removed) kernel to flash in Odin prior to flashing the ZIP for the first time. Even if we can render the update-binary safe, there's still the corner case of people who wipe using an older dangerous recovery.
[Galaxy Note GT-N7000 General] M3TALLICA:
Hi Entropy, I completely agree with what you said. What I wrote was about CFR 5.6 as it offers one way protection only. It does not have mmc_cap_erase removed from the kernel.

I had flashed my custom ICS ROM with Franco R4 which had update-script with format command. I am also aware that format command does not inflict any damage when executed from safe kernel like SpeedMod, Franco R3 and above, DAFUQ and CM9 kernel. (Please clarify if I am wrong the with last sentence)
[Galaxy Note GT-N7000 General] Entropy512:
Correct. Format command is safe with a "safe" update-binary and/or a kernel that blocks erase commands.
[Galaxy Note GT-N7000 General] maximo12345:
I think it's always better use Abyss 4.2 for operations like these...
[Galaxy Note GT-N7000 General] :
Glad to see that i'm helping on this issue :D

Keep it up guys! Thanks Entropy for your clarification :D
[Galaxy Note GT-N7000 General] jermitano:
if you just followed the directions on the OP in red you wouldnt be bricked in the first place (you said it yourself you were on an LPY before flashing PA)...same situation i guess that happened in the OP here...cf 5.6 is "safe" if the rom to be flashed on does not initiate a format command, which i guess in this case did...