AnsweredAssumed Answered

MFG Tools: eMMC partitioning for Android

Question asked by Carlo Barbaro on Apr 8, 2014
Latest reply on May 13, 2014 by alejandrolozano

Hello,

 

I'm studing the process performed by MFG Tools to partition, format and installing the Android firmware on a eMMC device.

Looking at the mksdcard-android.sh script, I see the following:

 

# call sfdisk to create partition table

# get total card size

seprate=40

total_size=`sfdisk -s ${node}`

total_size=`expr ${total_size} / 1024`

boot_rom_sizeb=`expr ${BOOT_ROM_SIZE} + ${BOOTLOAD_RESERVE}`

extend_size=`expr ${SYSTEM_ROM_SIZE} + ${CACHE_SIZE} + ${VENDER_SIZE} + ${MISC_SIZE} + ${seprate}`

data_size=`expr ${total_size} - ${boot_rom_sizeb} - ${RECOVERY_ROM_SIZE} - ${extend_size} + ${seprate}`

 

# destroy the partition table

dd if=/dev/zero of=${node} bs=1024 count=1

 

# create partitions

sfdisk --force -uM ${node} << EOF

,${boot_rom_sizeb},83

,${RECOVERY_ROM_SIZE},83

,${extend_size},5

,${data_size},83

,${SYSTEM_ROM_SIZE},83

,${CACHE_SIZE},83

,${VENDER_SIZE},83

,${MISC_SIZE},83

EOF

 

Can someone explain the meaning the additional ${seprate} with size of 40MB, added to both extended and data partition?

Doing this way, the partitioning exceed the total size of storage device.

This is also reported by logs generated by the target when MFG Tools are partitioning the device:

 

Disk /dev/mmcblk0: 238592 cylinders, 4 heads, 16 sectors/track

 

sfdisk: ERROR: sector 0 does not have an msdos signature

/dev/mmcblk0: unrecognized partition table type

Old situation:

No partitions found

Warning: given size (6392) exceeds max allowable size (6352)

New situation:

Units = mebibytes of 1048576 bytes, blocks of 1024 bytes, counting from 0

 

  Device Boot Start End MiB #blocks Id System

/dev/mmcblk0p1 0+ 15 16- 16383+ 83 Linux

/dev/mmcblk0p2 16 23 8 8192 83 Linux

/dev/mmcblk0p3 24 1103 1080 1105920 5 Extended

/dev/mmcblk0p4 1104 7495 6392 6545408 83 Linux

/dev/mmcblk0p5 24+ 535 512- 524287+ 83 Linux

/dev/mmcblk0p6 536+ 1047 512- 524287+ 83 Linux

/dev/mmcblk0p7 1048+ 1055 8- 8191+ 83 Linux

/dev/mmcblk0p8 1056+ 1063 8- 8191+ 83 Linux

Warning: partition 4 extends past end of disk

Successfully wrote the new partition table

 

Re-reading the partition table ...

mmcblk0: p1 p2 p3 < p5 p6 p7 p8 > p4

mmcblk0: p4 size 13090816 extends beyond EOD, truncated

Outcomes