Search code examples
androidyoctopartitionu-boot

How to I partition eMMC ?


We have an development board that has been run Yocto system. and we want it to run android system, we already has compiled android image with Yocto kernel that has android's some patch.

We don't know how to flash the android image (such as system.img boot.img and recovery.img and so on) to the development board because of the Yocto system partition different with android system.

we can use fastboot tool to flash Yocto system to EVB.and we want to know:

  1. How to partition eMMC that we can use fastboot tool to flash android system. Do we need to modify Little Kernel code ? and how to modify it in Yocto system.

  2. How to we boot the android system up?

It would be appreciated if you offer any useful information.

Thanks


Solution

  • How to partition eMMC that we can use fastboot tool to flash android system.

    You'll need a tool that can partition the eMMC. Considering you are using yocto your best bet is gptfdisk package. gptfdisk recipe is at path poky/meta/recipes-devtools/fdisk/gptfdisk_1.0.0.bb. gptfdisk provides following text-mode partitioning tools

    • gdisk,
    • cgdisk,
    • sgdisk,
    • fixparts

    You can use one of these tools to recreate the partitions in the partition table.

    and how to modify it in Yocto system.

    Do IMAGE_INSTALL_append = " gptfdisk " in conf file to make the tools of this package part of your image.

    How to we boot the android system up?

    You'll need 3 partitions

    • system.img - goes in partition named system
    • boot.img - goes in system named boot
    • and recovery.img - goes in system named recovery

    Each tool has a man page on Linux. You can read the manuals using man sgdisk, man gdisk, man cgdisk and man fixparts. Some example usages of sgdisk

    • sgdisk -p </dev/sda> - To print all partitions on the disk
    • sgdisk --delete=partnum </dev/sda> - Delete a partition. This action deletes the entry from the partition table