查看“MY-IMX6 Linux-3.0.35 Build Manual”的源代码
←
MY-IMX6 Linux-3.0.35 Build Manual
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
<div> = '''Prepare source code pacakge'''= ---- == '''3.0.35 Version code'''== === u-boot Source code === Filename:u-boot-2009.08--svn*.tar.xz<br> === kernel Source code === Filename:linux-3.0.35--svn*.tar.xz<br> === Cross compilation tool=== Filename:gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2<br> = '''Configuration compilation environment'''= ---- == '''Prepare source code'''== === Prepare source code package=== 1)Create working directory<br> *Create ~/my-imx6 as working directory <br> $ mkdir ~/my-imx6<br> [[File: myimx6l3035_build_2.1.1.1.jpg]]<br> *Create ~/my-imx6/02_source/imx_3.0.35_4.1.0 as source code directory.<br> $ mkdir ~/my-imx6/02_source/imx_3.0.35_4.1.0 -p<br> [[File: myimx6l3035_build_2.1.1.2.jpg]]<br> *Create ~/my-imx6/03_tools as tool directory<br> $ mkdir ~/my-imx6/03_tools -p<br> [[File: myimx6l3035_build_2.1.1.3.jpg]]<br> 2)Copy source code package to the development host<br> Do it in this step in your own way.<br> ''Tip:this step is to copy “02_source code”from network disk to “~/my-imx6/02_source/imx_3.0.35_4.1.0”in development host,and copy “03_tool/toolchain”to “~/my-imx6/03_tools”.''in development host.<br> === Decompress source code package=== 1)Decompress u-boot source code and kernel source code.<br> $ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0<br> $ tar xf u-boot-2009.08--svn*.tar.xz<br> $ tar xf linux-3.0.35--svn*.tar.xz<br> [[File: myimx6l3035_build_2.1.2.1.jpg]]<br> 2)Decompress cross compiler tool <br> $ cd ~/my-imx6/03_tools/<br> $ tar jxf gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2<br> [[File: myimx6l3035_build_2.1.2.2.jpg]]<br> == '''Development environment configuration'''== === Install package needed=== 1)List of updated source <br> $ sudo apt-get update<br> [[File: myimx6l3035_build_2.2.1.1.jpg]]<br> After update,it will look like below:<br> [[File: myimx6l3035_build_2.2.1.2.jpg]]<br> 2)Install aptitude package management tool and ia32-lib.<br> ''Tips:if Linux of compiler host is 32bit,you can skip this step.<br> *Install aptitude package management tool.<br> [[File: myimx6l3035_build_2.2.1.3.jpg]]<br> $ sudo apt-get –y install aptitude<br> * Install ia32-libs with aptitude.<br> $ sudo aptitude –y install ia32-libs<br> ''Tips:following is the screenshots with re-execution of installation command after installation of aptitude and ia32-libs is finished.<br> [[File: myimx6l3035_build_2.2.1.4.jpg]]<br> 3)Install mkimage tool<br> $ sudo apt-get -y install uboot-mkimage<br> ''Tips:following is the screenshots with re-execution of installation command after installation of mkimage tool is finished.<br> [[File: myimx6l3035_build_2.2.1.5.jpg]]<br> 4)Install ncurses-dev<br> <span style="color: red">Instruction:make menuconfig is dependent on it.</span><br> $ sudo aptitude -y install ncurses-dev<br> ''Tips:following is the screenshots with re-execution of installation command after installation of ncurses-dev tool is finished.<br> [[File: myimx6l3035_build_2.2.1.6.jpg]]<br> === Configure environment variables of MY-IMX6 compilation=== 1)Write platform information to a new configured file.<br> $ echo "export ARCH=arm" > ~/my-imx6/03_tools/myimx6_3035_build_env<br> 2)Write compiler tool chain path to configured file.<br> * Enter cross compiler tool directory <br> $ cd ~/my-imx6/03_tools/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/<br> * Write path to configured file.<br> $ sed -i "\$a IMX6_GCC462_PATH=$PWD" ~/my-imx6/03_tools/myimx6_3035_build_env<br> * Write cross compiler tool to configured file<br> $ sed -i "\$a export CROSS_COMPILE=\$IMX6_GCC462_PATH/arm-none-linux-gnueabi-" ~/my-imx6/03_tools/myimx6_3035_build_env<br> 3)View configured file <br> $ cat ~/my-imx6/03_tools/myimx6_3035_build_env<br> 4)Figures<br> [[File: myimx6l3035_build_2.2.2.1.jpg]]<br> Note:If an error occurs in any step, need to delect ~/my-imx6/03_tools/myimx6_3035_build_env ,and operate again all steps of this segment.<br> = '''Compile u-boot'''= ---- == '''Enter u-boot source code directory'''== $ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0/u-boot-2009.08/<br> [[File: myimx6l3035_build_3.1.0.1.jpg]]<br> == '''Validate configured file'''== * Execute source command<br> $ source ~/my-imx6/03_tools/myimx6_3035_build_env<br> [[File: myimx6l3035_build_3.2.0.1.jpg]]<br> * View compiler configuration<br> $ echo $ARCH<br> $ echo $CROSS_COMPILE<br> ''Tips:you can see that ARCH和CROSS_COMPILE is configured.<br> [[File: myimx6l3035_build_3.2.0.2.jpg]]<br> * Verify cross compiler tool configuration.<br> $${CROSS_COMPILE}gcc –v<br> ''Tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:<br> [[File: myimx6l3035_build_3.2.0.3.jpg]]<br> == '''Remove u-boot configuration'''== $ make distclean<br> [[File: myimx6l3035_build_3.3.0.1.jpg]]<br> == '''u-boot Configuration'''== * Evaluation board and its corresponding u-boot compiler configuration:<br> {| class="wikitable" |- !Evaluation board main model !CPU type-memory capacity !Corresponding u-boot configuration |- |rowspan=4|MY-IMX6-EK200 |6Q(quad. core)- 1G |myimx6ek200_6q_config |- |6Q(quad core)- 2G |myimx6ek200_6q_2g_config |- |6U(dual core tile)- 1G |myimx6ek200_6u_config |- |6S(single core)- 512M |myimx6ek200_6s_config |- |rowspan=4|MY-IMX6-EK314 |6Q(quad.core)- 1G |myimx6ek314_6q_config |- |6Q(quad.core)- 2G |myimx6ek314_6q_2g_config |- |6U(dual core tile)- 1G |myimx6ek314_6u_config |- |6S(single core)- 512M |myimx6ek314_6s_config |} *MYIMX6EK200-6Qxx-1G configuration example:<br> $ make myimx6ek200_6q_config<br> [[File: myimx6l3035_build_3.3.0.2.jpg]]<br> == '''Compilation'''== * Execute compilation <br> $ make<br> ''Tips:To speed up the compilation,add "-j4" after make.The Linux host used to compile is dual-core ,4 threads .So "-j" is followed by 4, which takes 4 threads to compile. The number behind "-j" is allocated based on system resources,but It should not exceed the maximum threads the host support.<br> [[File: myimx6l3035_build_3.5.0.1.jpg]]<br> * Complete compilation <br> ''Tips:u-boot compilation process will take a few minustes or so.<br> [[File: myimx6l3035_build_3.5.0.2.jpg]]<br> == '''Target file'''== You can get the compiled file u-boot.bin with ls command after compilation.<br> $ ls<br> [[File: myimx6l3035_build_3.6.0.1.jpg]]<br> = '''Compile kernel'''= ---- == '''Enter kernel source directory'''== $ cd ~/my-imx6/02_source/imx_3.0.35_4.1.0/linux-3.0.35/<br> [[File: myimx6l3035_build_4.1.0.1.jpg]]<br> == '''Validate configured file'''== * Execute source command<br> $ source ~/my-imx6/03_tools/myimx6_3035_build_env<br> [[File: myimx6l3035_build_4.2.0.1.jpg]]<br> * View compiler configuration<br> $ echo $ARCH<br> $ echo $CROSS_COMPILE<br> ''Tips:you can see that ARCH和CROSS_COMPILE is configured<br> [[File: myimx6l3035_build_4.2.0.2.jpg]]<br> * Verify cross compiler tool configuration<br> $ ${CROSS_COMPILE}gcc –v<br> ''Tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:<br> [[File: myimx6l3035_build_4.2.0.3.jpg]]<br> == '''Prepare for kernel configuration'''== * Remove kernel configuration<br> $ make distclean<br> [[File: myimx6l3035_build_4.3.0.1.jpg]]<br> * Generated.config file<br> Instructions:configuration files used for MY-IMX6-EK200 seires of evaluation board and MY-IMX6-EK314 series of evaluation board is myimx6_defconfig.<br> $ make myimx6_defconfig<br> [[File: myimx6l3035_build_4.3.0.2.jpg]]<br> == '''Compile kernel'''== * Compile uImage<br> $ make uImage<br> Instruction:4 threads compilation is used in the screenshots.<br> [[File: myimx6l3035_build_4.4.0.1.jpg]]<br> * Complete compilation<br> [[File: myimx6l3035_build_4.4.0.2.jpg]]<br> *Target file <br> arch/arm/boot/uImage is the target file through compilation,you can view the file information with ls command.<br> $ ls arch/arm/boot/uImage –la<br> [[File: myimx6l3035_build_4.4.0.3.jpg]]<br> == '''Compile module'''== * Compile <br> $ make<br> Instruction:4 threads compilation is used in the screenshots.<br> [[File: myimx6l3035_build_4.5.0.1.jpg]]<br> * Complete compilation<br> [[File: myimx6l3035_build_4.5.0.2.jpg]]<br> * Target file<br> The.ko file of each module is in the directory where code is located after compilation ,you can find the module compiled with find command after compilation,refering command as below:</span><br> $ find -name *.ko<br> [[File: myimx6l3035_build_4.5.0.3.jpg]]<br> = '''Linux application compilation'''= ---- == '''Write application'''== 1) Create application directory<br> $ mkdir ~/my-imx6/02_source/application/ -p <br> $ cd ~/my-imx6/02_source/application/ <br> [[File: myimx6l3035_build_5.1.0.1.jpg]]<br> 2) Write application(here take hello.c as example)<br> Create hello.c and write following code and save:<br> #include <stdio.h> <br> int main(int argc, char **argv) <br> { <br> printf("Hello, MYZR!\n"); <br> <br> return; <br> } <br> 3)View code<br> $ cat hello.c <br> [[File: myimx6l3035_build_5.1.0.2.jpg]]<br> == '''Validate compiler configured file'''== * Execute source command<br> $ source ~/my-imx6/03_tools/myimx6_3035_build_env<br> [[File: myimx6l3035_build_5.2.0.1.jpg]]<br> * View compiler configuration<br> $ echo $ARCH<br> $ echo $CROSS_COMPILE<br> ''Tips:you can see that ARCH和CROSS_COMPILE is configured <br> [[File: myimx6l3035_build_5.2.0.2.jpg]]<br> * Verify cross compiler tool configuration<br> $ ${CROSS_COMPILE}gcc –v<br> ''Tips:you can see version information of cross compiler tool shown on terminal after execution of command.as below:<br> [[File: myimx6l3035_build_5.2.0.3.jpg]]<br> == '''Compile application'''== 2) Compile <br> $ ${CROSS_COMPILE}gcc hello.c -o hello.out <br> Note:the above commands contain charater“$”,e.g“${CROSS_COMPILE}gcc”,which is the environment variable generated when referring to our source.<br> [[File: myimx6l3035_build_5.3.0.1.jpg]]<br> 3) View type of target file <br> $ file hello.out <br> You can get the property of target file hello.out.<br> [[File: myimx6l3035_build_5.3.0.2.jpg]]<br> = '''File system'''= ---- == '''File system instruction'''== File system package is located in image file folder in the network disk。as to type of file system supported and way of download please refer to《MY-IMX6 buring guide》.<br> == '''Decompress file system to compiler host'''== 1)Create directory of file system and enter.<br> $ mkdir ~/my-imx6/04_rootfs/ -p<br> $ cd ~/my-imx6/04_rootfs/<br> [[File: myimx6l3035_build_6.2.0.1.jpg]]<br> 2)Copy file system to ~/my-imx6/04_rootfs/directory<br> This step sbould be done in your own way<br> 3)Decompress file system to specified directory<br> $ mkdir rootfs<br> $ sudo tar jxf rootfs-linux.tar.bz2 -C rootfs<br> [[File: myimx6l3035_build_6.2.0.2.jpg]]<br> == '''Add application to file system'''== $ cp ~/my-imx6/02_source/application/hello.out rootfs/app_test/<br> [[File: myimx6l3035_build_6.3.0.1.jpg]]<br> 5)Re-pakcage file system<br> $ rm -rf rootfs-linux.tar.bz2<br> $ cd rootfs/<br> $ sudo tar cjf ../rootfs-linux.tar.bz2 *<br> [[File: myimx6l3035_build_6.3.0.2.jpg]]<br> == '''Add module to file system'''== Prepare .ko file of module needed,as to other operations please refer to“add application to file system”.<br> </div>
返回至
MY-IMX6 Linux-3.0.35 Build Manual
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
[-_-]
NXP平台:
MYZR-IMX6-EK200
MYZR-IMX6-EK200(EN)
MYZR-IMX6-EK314
MYZR-IMX6-EK314(EN)
MYZR-IMX6-EK336
MYZR-IMX6-EK336(EN)
MYZR-IMX6-EK140
MYZR-IMX6-EK140(EN)
MYZR-IMX6-EK140P
MYZR-IMX6-EK140P(EN)
MYZR-IMX8M-EK300
MYZR-IMX8M-EK300(EN)
MYZR-IMX8M-EVK
MYZR-IMX8Mmini-EK240
MYZR-IMX8Mmini-EK240(EN)
MYZR-IMX28-EK142
MYZR-IMX28-EK142(EN)
MYZR-LS1012A-EK200
MYZR-LS1012A-EK200(EN)
Rockchip平台:
MYZR-RK3288-EK314
MYZR-RK3288-EK314(EN)
MYZR-RK3399-EK314
MYZR-RK3399-EK314(EN)
Allwinner平台:
MYZR-R16-EK166
MYZR-R16-EK166(EN)
Microchip平台:
MYZR-SAMA5-EK200
MYZR-SAMA5-EK200(EN)
网关产品:
GW200
GW300
GW310/GW311
ST平台:
MYZR-STM32-EK152
所有页面
工具
链入页面
相关更改
特殊页面
页面信息