Jump to content

/dev/block/mtdblock<n>, n=0,1,2, queries


Guest zorm

Recommended Posts

I don't know if this question is Hero specific, HTC specific or more general, as I don't know how nand partitioning varies from device to device, so I'm playing safe for now & posting in the Hero sub forum...

I know that the last 3 partitions on mtdblock map as follows:

  • /dev/block/mtdblock3 /system
  • /dev/block/mtdblock4 /cache
  • /dev/block/mtdblock5 /data

But what of the first 3?

Having run out of things to try & break this morning, I decided to flash the S-off SPL around 5am. Now I guess I should make use of this freedom <_<

I fancy customising the various boot screens, but love the original so I want to back it up first. Does anyone already have a copy? Failing that, or in any case, how can one rip the existing data out of nand?

Given splash1 (and maybe splash2?) are written to nand using the same fastboot flash process as the other partitions, I'm guessing they correspond to 2 of the first 3 partitions of /dev/mtdblock - is that at all correct? If so, how can one read this data? I only have a passing acquaintance with Linux; I had thought dd would let me copy an unmounted partition but this doesn't seem to want to work, eg

dd if=/dev/block/mtdblock1 of=/sdcard/b1

gives Input/output error

I'm also guessing one can't mount the device & then manipulate the data as I imagine it doesn't contain a filing system but rather the raw image data.

Any hints or even just advice on where I might be able to get this information from?

Assuming I find a solution, I'd like to be able to create a replacement image based on the default. I know a tool exists to convert a bitmap into the format needed to flash, rgb565, but is there a tool to go the other way?

If not, how about info on the rgb565 format so I can knock a quick commandline tool together to do this job?

Link to comment
Share on other sites

Hmm, I've answered a few of my own questions but not found a solution. For the record:

cat /proc/mtd

dev: size erasesize name

mtd0: 00040000 00020000 "misc"

mtd1: 00500000 00020000 "recovery"

mtd2: 00280000 00020000 "boot"

mtd3: 0aa00000 00020000 "system"

mtd4: 08200000 00020000 "cache"

mtd5: 0a5c0000 00020000 "userdata"

ls /dev/mtd

mtd0 mtd1 mtd2 mtd3 mtd4 mtd5

mtd0ro mtd1ro mtd2ro mtd3ro mtd4ro mtd5ro

The splash screens are offset somewhere inside mtd6 & can be dumped with dd from mtd6ro if you know the offset. However, mtd6 is only visible/accessible if the kernel has enabled it & so far I can't find a main or recovery image for Hero which has it enabled. Short of setting up my own build environment & doing this myself, there's no way to rip splash <_<

The latter is probably too ambitious for me atm, but I might try at some point. Does no one have a copy of the default Hero splash1 they can share?

I eventually found this much out by exploring Amon_RA's recovery image. For anyone interested, it contains a script nandroid-mobile.sh which mentions in a comment how splash images can be dumped.

[Edit:] The mtd6 patch is rather elegant. In case anyone ending up here is looking for info, this is what I found: discussion, patch, explanation.

Edited by zorm
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.