imx515 开发板Android源代码编译过程(二)

2014-11-24 09:01:56 ? 作者: ? 浏览: 2
imx-android-r8/code/r8/and_patch.sh


$ help


Now you should see "c_patch


" function is available for you


$ c_patch /opt/imx-android-r8/code/r8 imx_r8


Here "/opt/imx-android-r8/code/r8" is the location of the patches (i.e. directory created when you unzip release package)


"imx_r8" is the branch which will be created automatically for you to hold all patches (only in those existing Google gits


).


You can choose any branch name you like instead of "imx_r8".


If everything is OK, "c_patch


" will generate the following output to indicate successful patch:


**************************************************************


Success: Now you can build android code for FSL i.MX


platform


**************************************************************


Note: The patch script ( and_patch.sh ) utalizes some basic utilities like awk/sed . If they are not available on your LinuxPC , install them in advance.


Build uboot


$ cd ~/myandroid/bootable/bootloader/uboot-imx


$ echo $ARCH && echo $CROSS_COMPILE


Make sure you have those 2 environment variables set


Command to build for i.MX51 BBG3 board is:


$ make mx51_bbg_android_config


$ make


"u-boot.bin " is generated if you have a successful build.


The above u-boot.bin has 1024KB padding at the head of file,for example first executable instruction is at the offset 1KB. If you want to generate a no-padding image, you need do below dd command in host.


$ dd if=./u-boot.bin of=./u-boot-no-padding.bin bs =1024 skip=1


Usually this no-padding uboot image is used in the SD card, for example, program this no-padding uboot image into 1KB offset of SD card so that we do not overwrite the MBR (including partition table) within first 512B on the SD card.


Note : Any image which must be loaded by uboot must have an unique image head, for example, some data must be added at the head of loaded image to tell uboot about the image (for example, it's a kernel, or ramfs , etc) and how to load the image (for example, load/execute address).


Therefor before you can load any image into RAM by uboot , you need a tool to add this information to generate a new image which can be recognized by uboot . Fortunately, this tool is delivered together with uboot . After you make uboot using the above steps, you can find the tool (mkimage ) under tools/.


Later the document will describe how to use mkimage to generate the image (for example kernel image, ramfs image) to be loaded by uboot .


Build Kernel Image


To run Android using NFS or from SD, build the kernel with the default configuration now as follows:


Assume you had already built uboot . mkimage was generated under myandroid//bootable/bootloader/uboot-imx/tools / and it's in your PATH


$ cd ~/myandroid/kernel_imx


$ echo $ARCH && echo $CROSS_COMPILE


Make sure you have those 2 environment variables set


$ make imx5_android_defconfig


Generate ".config " according to default config file under arch/arm/configs .


$ make uImage


You can generate zImage too by "make zImage ", use following command to generate uImage from zImage .


With a successful build in either of the above case, the generated kernel image is ~/myandroid/kernel_imx/arch/arm/boot/uImage .


Generate uImage to be loaded by u-boot


To generate uImage from the built zImage , generate a uImage based on the above zImage as follows:


$ cd myandroid/kernel_imx/arch/arm/boot


$ ~/myandroid/bootable/bootloader/uboot-imx/tools/mkimage -A arm -O linux -T kernel -C none -a 0x90008000 -e 0x90008000 -n "Android Linux Kernel" -d ./zImage ./uImage


During boot, when uboot try t

-->

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: