[Android General] syserr:
Thanks sam_pon. You are right, you pushed me to do some checks to see if the NVRAM partition block is blown away when you do a Format Whole Flash... and it is. It must be able to do a mass clear on the entire "emmc" flash. I had previously thought it might only be wiping the PMT block that holds the partition information.

For the curious, this is how I checked:

I wrote my original NVRAM dump to my -H tablet with SPFT..

Write Memory -> NVRAM file -> begin address 0xA60000

Then I did Format Whole Flash with SPFT

Then I read back the NVRAM block with SPFT..

Read Memory -> NVRAMAFTER file -> begin address 0xA60000, size 0x300000

They were different, and the file NVRAMAFTER contained only zeros (hex).

So then, I downloaded my stock SPFT ROM for -H AT&T. (this does not explicitly write over the NVRAM block area)

I read back the NVRAM and confirmed that the SP Flash Tool doesn't do anything to the NVRAM block area.

So then, I booted stock ROM all the way, let it sit for a minute, powered off.

I read back the NVRAM and confirmed that stock boot doesn't do anything to the NVRAM block.

Go into settings->about->status, I see my MEID "unknown" (but I do see my WiFI MAC... weird!)

So I can confirm whole-heartedly that if you Format Whole Flash, the NVRAM partition block gets clobbered with zeros and nothing will replace it automagically once that is done.

----------------

BUT....

----------------

Somehow, if I look at the /data/nvram (need rooted to look) I have directories and files in there even with the NVRAM partition block showing zeros. So what that tells me... the directory /data/nvram is being created by something, even though the NVRAM partition block is not mounted there. So everything in that /data/nvram directory is actually sitting on the /data partition. This explains a lot. In months past users would complain about MEIDs disappearing when they would switch ROMs etc. If you or MKDRT fix MEIDs in the /data/nvram directory while the NVRAM partiton block is NOT mounted, then all those settings will get wiped if you Wipe Data / Cache. The reason the NVRAM partition block is not being mounted on /data/nvram in that case is because it doesn't look like a filesystem that Linux knows about -- of course, because it's just a bunch of zeros (hex).

And now.. I find some PDFs on the net that describe MTK's NVRAM block. It's not really a general purpose filesystem, I don't any easy way to mount it. They have a bunch of C structs to access it.

But the meaty question is... On startup, does MTK's android mount this NVRAM block or are those values copied down to the general purpose filesystem /data in the location /data/nvram. Hum...

And... after about 2 hours of slowly dumping the DATA partition block with SP Flash and loopback mounting it as an ext4 filesystem, I find the nvram directory populated with files. So... This means at the very least when the NVRAM block in flash is zeroed out, it basically gets ignored and something in the system builds up /data/nvram file structure anyway.

Folks like ursulavasey and InfernoChz are probably working against this very side effect. What if the radio hardware only reads that nvram block area? And doesn't give a crap about what is copied down or exists in /data/nvram? Although this seems to be true, MKDIRT can write MEIDs back through just the filesystem I think, how could it do that? And how would restoring your data.tar ever fix your MEID if your MEID/NVRAM block was corrupt.

(This is why open source is a good thing.... there are too many secrets.)

UPDATE:

After a Wipe Data and Cache in CWM, the /data is empty... confirmed with ADB in CWM.

I can get an ADB Shell early on in the next boot maybe 10 seconds

Right away the booted system has created many things in /data, /data/nvram is one of them and it is quite populated!

I wonder how many A2107A users are running around with /data/nvram in their DATA filesystem. Any time you Data/Cache Wipe you would loose any settings.

UPDATE:

So MKDRT (sorry, but that's how I remember the name of that tool, you know what I mean)... So MKDRT is able to write a new MEID to my tablet. Where does it go? It goes in /data/nvram/*. It does not proliferate up to the NVRAM block, I still have all zeros. I do a Wipe Data expecting that it would wipe the MEID, and it DIDN'T!!!! :eek: I better check the NVRAM block again. :confused:

UPDATE:

Yeah, at least dumping the NVRAM block with ADB is showing me that MKDRT was actually modifying it. I guess I need to give it more credit. A Read Memory with SPFT confirms it. So, I really don't understand why ^ (one update ago) I had an NVRAM block with all zeros.