1
votes

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

2
this is not too clear Do we need to modify Little Kernel code ? . Can you please elaborate what is little kernel?sob
You need to tell us what EVB you're using and also what bootloader(s) are involved. For example "Little Kernel" sounds like you're on a qualcomm platform and are likely not using U-Boot at all.Tom Rini
Hi sob, the platform will load lk code likely u-boot before load linux kernel , It seems that it can load linux kernel.Jam_Hu
Hi Tom, the platform boot flow is from bootrom to little kernel and then load linux kernel. It not use u-boot.Jam_Hu

2 Answers

1
votes

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
0
votes

There is a lot of way to partition the eMMC, it depends on your system: via USB, sdcard, nfs, uboot...

I think you can have a look at the meta-variscite, especially in the scripts folder. They have flash scripts for Yocto poky images, and android image (on the same boards). They flash from the SDcard to the eMMC.

I ported these scripts for a use with uboot: I run the command ums mmc 0 to start mass storage mode via USB OTG, and on my PC I run an install script which use dd for erasing partitions, fdisk for creating partitions, mkfs to format my device connected by USB.

You can also use mmc part in uboot, but I never tested this option.