Latest product reviews
ARCHOS 50 Diamond
ARCHOS GamePad2
ARCHOS
Smartphones
ARCHOS
TV Connect
ARCHOS 101 XS

A A A
Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

Register Lost password?

ClockworkMod (CWM) Recovery easy install for RK3066 and RK3188 -- TWRP/CWM Flash-Tool and root for RK3288

 Please donate to support OMA and CrewRKTablets firmware work, thank you !

sp_Feed sp_TopicIcon
MTD-Utils / re-partitioning MTD
Avatar
setialpha
Nürnberg, Germany

Firmware Guru
Forum Posts: 209
Member Since:
2012/01/15
sp_UserOfflineSmall Offline

Thanks Received: 8
1
2012/02/15 - 18:35
sp_Permalink sp_Print sp_EditHistory

The MTD (the internal NAND (memory)) of the 7cG2 can be runtime-repartioned.

 

It's actually just one chip with virtual partitions-boundaries, those can be controlled via kernel command-line.

 

Here's the example I'm currently having running on my tablet:

 

Original MTD:

 

mtd-list

boot 0x0000044E0000 0x0000049E0000
system 0x0000049E0000 0x00000C1E0000
cache 0x00000C1E0000 0x00000C5E0000
misc 0x00000C5E0000 0x00000C6E0000
userdata 0x00000C6E0000 0x00001DFE0000
persist 0x00001DFE0000 0x00001E1E0000
recovery 0x00001E1E0000 0x00001E6E0000
content 0x00001E6E0000 0x00001FFE000

 

ls /dev/mtd/
mtd0    mtd1    mtd2    mtd3    mtd4    mtd5    mtd6    mtd7
mtd0ro  mtd1ro  mtd2ro  mtd3ro  mtd4ro  mtd5ro  mtd6ro  mtd7ro

 

Now I have running:

 

mtd-list

boot 0x0000044E0000 0x0000049E0000
system 0x0000049E0000 0x00001DCE0000
misc 0x00001DCE0000 0x00001DDE0000
persist 0x00001DFE0000 0x00001E1E0000
recovery 0x00001E1E0000 0x00001E6E0000
content 0x00001E6E0000 0x00001FFE0000

 

ls /dev/mtd
mtd0    mtd1    mtd2    mtd3    mtd4    mtd5
mtd0ro  mtd1ro  mtd2ro  mtd3ro  mtd4ro  mtd5ro

 

As you can see, there are no cache and userdata partitons anymore (as I have them on my SD-Card, I can safely give the space to system partition as it's entirely unused).

 

I have not yet removed content partitions, as I don't yet know how well those changes work with fastboot, so I left recovery and content untouched to not mess things up.

 

Now for the experts:

 

mtd-utils cross-compiled for 7c g2: http://www.nanolx.org/downloads/mtd-utils-1.4.9+20120214-arnova7cg2.tar.xz

mtd-list (a script to list all mtd partitions with start and end point): http://www.nanolx.org/downloads/mtd-list

mtd-calc (a script to calc the size of a parition (usage: mtd-calc endpoint startpoint)): http://www.nanolx.org/downloads/mtd-calc

 

Last but not least the command I used to create the boot.img:

 

mkbootimg\
    --kernel nano-boot.img-kernel\
    --ramdisk ramdisk.gz\
    --cmdline "console=ttyDCC0 androidboot.hardware=qcom mtdparts=msm_nand:5120k@0x0000044E0000(boot),

412672k@0x0000049E0000(system),1024k@0x00001DCE0000(misc),

2048k@0x00001DFE0000(persist),5120k@0x00001E1E0000(recovery),

25600k@0x00001E6E0000(content)"\
    --base 0x00200000\
    -o custom-boot.img

 

the '--cmdline ...' MUST be in one line!

 

So... let the games begin 🙂

Avatar
tremendo

Firmware Guru
Forum Posts: 42
Member Since:
2012/01/14
sp_UserOfflineSmall Offline
2
2012/02/16 - 14:01
sp_Permalink sp_Print

this can come in handy at some time... thanks for the research!

myguess is that /content is used by appslib.. no clue about persist.

Avatar
setialpha
Nürnberg, Germany

Firmware Guru
Forum Posts: 209
Member Since:
2012/01/15
sp_UserOfflineSmall Offline

Thanks Received: 8
3
2012/02/16 - 19:24
sp_Permalink sp_Print

It's not adopted by fastboot. I guess it's because the built-in partition table is used in the very very early process. Once the kernel is loaded the modified is used. This can result in /system/bin/ beeing out of place... (say it's outside the area /system normaly is)... so /system should still be flashed using fastboot not recovery.

 

Any other operation in running system/recovery is just fine of course.

Avatar
DanielVd

Firmware Guru
Forum Posts: 237
Member Since:
2012/01/05
sp_UserOfflineSmall Offline

Thanks Received: 5
4
2012/02/16 - 20:14
sp_Permalink sp_Print

I have a question.

On smartphone for changing mtd parition you have to s-off your peripheral, is the same for tablet?

After you had s-off the phone you could change mtd partition by creating a txt file and put it on sd card.

The file is like this: mtdpartmap.txt -> "140 25" which is 140 system and 25 cache

After that you should flash a new rom and the mtd partition size change..

Is the same for tablet?


Avatar
setialpha
Nürnberg, Germany

Firmware Guru
Forum Posts: 209
Member Since:
2012/01/15
sp_UserOfflineSmall Offline

Thanks Received: 8
5
2012/02/16 - 20:22
sp_Permalink sp_Print sp_EditHistory

... that would work in theory, but those scripts need to be adjusted to take all partitions in account. But this s-off scripts do nothing else than create the --cmdline for the kernel and re-build the boot.img and flash it.

So I did not bother with it and created the cmd-line on my own using mtd-list and mtd-calc scripts (and /dev/brain), building boot.img is just a simple 'repackboot'.

 

Results:

Fastboot uses built-in partition table - does not use --cmdline - if /system begins where it original begins fastboot flashes fine.

tremendo's recovery does properly flash update.zip with modified MTD partition table.

tremendo's recovery does NOT properly flash using 'flash_image MTD IMG'

 

So... if we could get fastboot to recognize the changed structure... but I guess that would require a self-compiled kernel with the changed layout built-in.

 

@tremendo: yes /content is for appslib. but: since recovery must be flashed from fastboot I could only reisze the recovery MTD until the end of the MTD, but not move it.

Forum Timezone: Europe/Paris

Most Users Ever Online: 749

Currently Online: Modo, kizzar07, Otura, davelou, tomtom11
252 Guest(s)

Currently Browsing this Page:
1 Guest(s)


Devices in use: Desktop (220), Phone (32), Tablet (5)

Top Posters:

Oma7144: 5790

globula_neagra: 2424

finless: 604

DarthJabba: 551

exelletor: 450

JochenKauz: 450

cracktech: 432

maikal: 394

Newest Members:

tomtom11

user123123

samuelbr0

Alba133

Kerb

maxstrike

Forum Stats:

Groups: 10

Forums: 185

Topics: 5916

Posts: 58873

 

Member Stats:

Guest Posters: 43

Members: 256575

Moderators: 5

Admins: 1

Administrators: admin

Moderators: globula_neagra, exelletor, JochenKauz, Oma7144, cracktech


CrewRKTablets moderators: JochenKauz and Astralix