Android eMMC Booting

Contents

[hide]

[edit]eMMC
binaries

This is the efi partition table as exists on the emmc

Sector#    Size Name
256 128K xloader
512 256K bootloader
2048 8M recovery
18432 8M boot
34816 512M system
1083392 256M cache
1607680 512M userdata
2656256 2183M media

[edit]Creating
the GPT table

On Target
  1. Connect a USB cable to the OTG port on your platform
  2. Boot your platform up with a stock u-boot and MLO
  3. Once you platform is booted you will see the following:
Fastboot entered...
On Host Machine

locate fastboot in you android filesystem

cd $mydroid/out/host/linux-x86/bin/fastboot

Search for fastboot devices

fastboot devices

Create GPT table on eMMC/SD card

fastboot oem format

From the android build these are the binaries that go into each partition:

 Sector#    Size Name            Binary
256 128K xloader MLO
512 256K bootloader u-boot.bin
2048 8M recovery recovery.img
18432 8M boot boot.img
34816 512M system system.img
1083392 256M cache cache.img
1607680 512M userdata userdata.img
2656256 2183M media none
File locations

  • MLO --> x-loader/MLO
  • u-boot --> u-boot/u-boot.bin
  • boot.img --> need to create using zImage + ramdisk.img
  • recovery.img ---> need to create using zImage + ramdisk-recovery.img
  • system.img --> $mydroid/out/target/product/<platform>/system.img
  • cache.img -->
  • userdata.img --> $mydroid/out/target/product/<platform>/userdata.img

All these partitions can be flashed with the given binary using fastboot.

 fastboot flash <name> <binary>

Example flashing of all partitions

 fastboot flash xloader     MLO
fastboot flash bootloader u-boot.bin
fastboot flash recovery recovery.img
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash cache cache.img
fastboot flash userdata userdata.img

[edit]Modifying
.IMG Files

Typically when you want to modify any of the partitions, you would need to unzip-modify-rezip and then fastboot flash.

Following section talks about how to do that for each partition

BOOT.IMG

 boot.img = zImage + ramdisk.img
zImage = kernel image
ramdisk.img = out/target/product/blaze/root/
 %./out/host/linux-x86/bin/mkbootimg
--kernel zImage
--ramdisk ramdisk.img
--base 0x80000000
--cmdline "console=ttyO2,115200n8 mem=456M@0x80000000 mem=512M@0xA0000000 init=/init vram=10M omapfb.vram=0:4M androidboot.console=ttyO2"
--board omap4
-o boot.img.new
Output: boot.img.new
**Note: bootarg is passed to kernel via --cmdline option above

To "just" boot boot.img (before flashing) you can use:

%fastboot boot boot.img

RAMDISK.IMG

 %mkdir root
 %cd root
 %gunzip -c ../ramdisk.img | cpio -i
<make changes to root/ contents...>
 %./out/host/linux-x86/bin/mkbootfs root/ | ./out/host/linux-x86/bin/minigzip >ramdisk.img.new
#output: ramdisk.img.new
** Note: any init.rc changes will need to use this method

RECOVERY.IMG

Is just like boot.img.
recovery.img = zImage + ramdisk-recovery.img
*Follow the same steps as boot.img for packing/unpacking

SYSTEM.IMG

 #uncompress
 %./out/host/linux-x86/bin/simg2img system.img system.img.raw
#mount to directory mnt-point/
 %mkdir mnt-point
 %sudo mount -t ext4 -o loop system.img.raw mnt-point/
#modify any .so or apk in the mnt-point/ directory
#rezip
 %sudo out/host/linux-x86/bin/make_ext4fs -s -l 512M -a system system.img.new mnt-point/
 %sudo umount mnt-point/
Output: system.img.new

Instead of having to reflash the whole big system.img, one can selective update any binary in /system folder on running target

%adb remount
%adb push <local> <remote>
Eg:
%adb remount
%adb push out/target/product/blaze/obj/lib/overlay.omap4.so /system/lib/hw/overlay.omap4.so
%adb sync

USERDATA.IMG

 #uncompress
 %./out/host/linux-x86/bin/simg2img userdata.img userdata.img.raw
#mount to directory mnt-point/
 %mkdir mnt-point
 %sudo mount -t ext4 -o loop userdata.img.raw mnt-point/
#modify any .so or apk in the mnt-point/ directory
#rezip
#%sudo ./out/host/linux-x86/bin/make_ext4fs -s -l 512M -a userdata userdata.img.new mnt-point/
# Above command won't work on GB/HC. For GB/HC, please use the following updated command
 %sudo ./out/host/linux-x86/bin/make_ext4fs -s -l 512M -a data userdata.img.new mnt-point/
 %sudo umount mnt-point/
Output: userdata.img.new

CACHE.IMG

 #This is empty ext4 fs image
 %mkdir mnt-point/
 %sudo ./make_ext4fs -s -l 256M -a cache cache.img mnt-point/
Output: cache.img

[edit]TI
Android build setup

Copy kernel zImage, u-boot.bin and MLO for your board in folder device/ti/blaze/boot/.

Rename as:

 %mv MLO MLO_es2.2_emu
or
 %mv MLO MLO_es2.2_gp
(based on your board being GP or EMU)

Next start standard android build and all img files are generated in:

out/target/product/blaze/*.img

A script is introduced in TI Android release to make this flashing process easier: device/ti/blaze/boot/fastboot.sh

Usage:
cd device/ti/blaze/boot/
%fastboot.sh --emu
or
%fastboot.sh --gp

Running this script will flash whole android system on your board.

Android eMMC Booting的更多相关文章

  1. Android gingerbread eMMC booting

    Android gingerbread eMMC booting This page is currently under construction. The content of this page ...

  2. AM335x Android eMMC mkmmc-android.sh hacking

    # AM335x Android eMMC mkmmc-android.sh hacking # # . 有空解读一下android的分区文件. # . 代码来源:https://github.com ...

  3. 碎碎念android eMMC【转】

    本文转载自:https://blog.csdn.net/Fybon/article/details/44242549 一./dev/blockroot@:/dev/block #ls bootdevi ...

  4. Android Service Summary

     In the Androird, service is a none-UI background process that is doing some specific jobs.   6.1 Ex ...

  5. Android MMC/EMMC/MTD Partition Layout

    Android devices have a couple of partitions to store different data. The common ones are the recover ...

  6. I.MX6 Android 5.1 回到 Android 4.2 emmc 启动

    /*************************************************************************** * I.MX6 Android 5.1 回到 ...

  7. App doesn't auto-start an app when booting the device in Android

    From Android 3.1, newly installed apps are always put into a "stopped" state and the only ...

  8. Android Bootloader LittleKernel的两篇文章 【转】

    转自:http://blog.csdn.net/loongembedded/article/details/41747523 2014-12-05 14:37 3599人阅读 评论(2) 收藏 举报 ...

  9. Android系统启动过程-uBoot+Kernel+Android

    摘要:本文是参考大量网上资源在结合自己查看源代码总结出来的,让自己同时也让大家加深对Android系统启动过程有一个更加深入的了解!再次强调,本文的大多数功劳应归功于那些原创者们,同时一些必要的参考链 ...

随机推荐

  1. 使用CSS禁止textarea调整大小功能的方法

    这篇文章主要介绍了使用CSS禁止textarea调整大小功能的方法,禁止可以调整textarea大小功能的方法很简单,使用CSS的resize属性即可,需要的朋友可以参考下 如果你使用谷歌浏览器或火狐 ...

  2. GameMap地图初始化

    init_map(res_path) .初始化mapbase的基本信息 pos2d screen_area = {, }; //普通屏幕大小 m_spBase->init(screen_area ...

  3. Windows键盘快捷键

  4. HTML页面加载和解析流程详细介绍

    浏览器加载和渲染html的顺序 1. IE下载的顺序是从上到下,渲染的顺序也是从上到下,下载和渲染是同时进行的. 2. 在渲染到页面的某一部分时,其上面的所有部分都已经下载完成(并不是说所有相关联的元 ...

  5. js弹出图片原图效果

    1.将js方法独立出来common.js function openwin(src){ var basePath = document.getElementById("basePath&qu ...

  6. vi/vim使用指北 ---- Moving Around in a Hurry

    上一篇文章中,简单列出了一些基本的Vim操作,也列出了很多的光标移动命令,本章主要是有哪些命令可以更快的移动光标. vim的编辑操作,用得最多就是移动光标,对于很少行的文件来说,基本的命令就够用了,但 ...

  7. 由浅入深了解Thrift之客户端连接池化

    一.问题描述 在上一篇<由浅入深了解Thrift之服务模型和序列化机制>文章中,我们已经了解了thrift的基本架构和网络服务模型的优缺点.如今的互联网圈中,RPC服务化的思想如火如荼.我 ...

  8. VS2010 常用快捷键

    VS2010版快捷键 Ctrl+E,D ----格式化全部代码  Ctrl+E,F ----格式化选中的代码  CTRL + SHIFT + B生成解决方案  CTRL + F7 生成编译  CTRL ...

  9. [你必须知道的.NET]第三十三回,深入.NET 4.0之,Lazy<T>点滴

    发布日期:2009.10.29 作者:Anytao © 2009 Anytao.com ,Anytao原创作品,转贴请注明作者和出处. 对象的创建方式,始终代表了软件工业的生产力方向,代表了先进软件技 ...

  10. poj 3537 Crosses and Crosses 博弈论

    思路:每次画X之后都会形成2个子游戏,即i-3和n-i-2. 代码如下: #include<iostream> #include<cstdio> #include<cma ...