MY-IMX6-A9 Linux-3.0.35 编译参考手册 v3.0(1)
本帖最后由 Anxyuuu 于 2019-5-9 16:07 编辑明远智睿MY-IMX6-A9 Linux-3.0.35 编译参考手册 v3.0
1下载相关文件
1.1交叉编译工具链A9系列:打开网盘到 2.1_OS_Linux-3.0.35 -> 03_toolchain,下载 MY-IMX-A9 目录。
1.2源码u-boot:打开网盘到 2.1_OS_Linux-3.0.35 -> 02_source,下载 u-boot-2016.03-*.tar.bz2 (源码包版本号需svn315及以上)。
Kernel:打开网盘到 2.1_OS_Linux-3.0.35 -> 02_source,下载 linux-3.0.35-*.tar.bz2 (源码包版本号需svn31及以上)。
2安装交叉编译工具链解压交叉编译工具链=====> Input:tar xf gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.bz2 -C /home/myzr/my-work/03_toolchain复制工具链配置文件=====> Input:cp environment-setup-gcc-4.6-arm.sh /home/myzr/my-work/03_toolchaingcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/source 工具链配置文件=====> Input:source /home/myzr/my-work/03_toolchain/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/environment-setup-gcc-4.6-arm.sh检验交叉编译工具安装=====> Input:${CROSS_COMPILE}gcc -v
=====> Output: Using built-in specs.COLLECT_GCC=arm-fsl-linux-gnueabi-gccCOLLECT_LTO_WRAPPER=/home/myzr/my-work/03_toolchain/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/../libexec/gcc/arm-fsl-linux-gnueabi/4.6.2/lto-wrapperTarget: arm-fsl-linux-gnueabiConfigured with: /work/build/.build/src/gcc-linaro-4.6-2011.06-0/configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-fsl-linux-gnueabi --prefix=/work/fsl-linaro-toolchain-2.13 --with-sysroot=/work/fsl-linaro-toolchain-2.13/arm-fsl-linux-gnueabi/multi-libs --enable-languages=c,c++ --with-pkgversion='Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --with-gmp=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-mpfr=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-mpc=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-ppl=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-cloog=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-libelf=/work/build/.build/arm-fsl-linux-gnueabi/build/static --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm -L/work/build/.build/arm-fsl-linux-gnueabi/build/static/lib -lpwl' --enable-threads=posix --enable-target-optspace --enable-plugin --enable-multilib --with-local-prefix=/work/fsl-linaro-toolchain-2.13/arm-fsl-linux-gnueabi/multi-libs --disable-nls --enable-c99 --enable-long-long --with-system-zlibThread model: posixgcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20)
3u-boot编译
3.1编译前的准备创建编译工作目录=====> Input:mkdir ~/my-work/02_source/ -p解压源码包到工作目录=====> Input:tar xf u-boot-2016.03-svn*.tar.bz2 -C ~/my-work/02_source/
3.2编译u-boot目标文件
进入源码目录=====> Input:cd ~/my-work/02_source/u-boot-2016.03生成目标开发板的 .config 文件=====> Input:make myimx6ek200-6q-1g_defconfig
=====> Output: HOSTCCscripts/basic/fixdepHOSTCCscripts/kconfig/conf.oSHIPPED scripts/kconfig/zconf.tab.cSHIPPED scripts/kconfig/zconf.lex.cSHIPPED scripts/kconfig/zconf.hash.cHOSTCCscripts/kconfig/zconf.tab.oHOSTLDscripts/kconfig/conf## configuration written to .config#【注意】:上面 make 后面的 myimx6ek200-6q-1g_defconfig 改为与开发板型号对应的配置文件。
********** MY-IMX6-EK200 **********myimx6ek200-6q-1g_defconfig myimx6ek200-6q-2g_defconfig myimx6ek200-6q-512m_defconfigmyimx6ek200-6u-1g_defconfig myimx6ek200-6u-2g_defconfig myimx6ek200-6u-512m_defconfigmyimx6ek200-6s-512m_defconfig myimx6ek200-6s-1g_defconfig myimx6ek200-6s-128m_defconfigmyimx6ek200-6qp-1g_defconfig myimx6ek200-6qp-2g_defconfig myimx6ek200-6qp-512m_defconfig
********** MY-IMX6-EK314 **********myimx6ek314-6q-1g_defconfig myimx6ek314-6q-2g_defconfig myimx6ek314-6q-512m_defconfigmyimx6ek314-6u-1g_defconfig myimx6ek314-6u-2g_defconfig myimx6ek314-6u-512m_defconfigmyimx6ek314-6s-512m_defconfig myimx6ek314-6s-1g_defconfig myimx6ek314-6s-128m_defconfigmyimx6ek314-6qp-1g_defconfig myimx6ek314-6qp-2g_defconfig myimx6ek314-6qp-512m_defconfig执行编译=====> Input:make
=====> Output: scripts/kconfig/conf--silentoldconfig KconfigCHK include/config.hUPD include/config.hGEN include/autoconf.mkGEN include/autoconf.mk.depCHK include/config/uboot.releaseCHK include/generated/timestamp_autogenerated.hCFG u-boot.cfg......LD u-bootOBJCOPY u-boot-nodtb.binOBJCOPY u-boot.srecSYM u-boot.symCOPY u-boot.binCFGS board/myzr/myimx6/myimx6a9-6q-ddr3.cfg.cfgtmpMKIMAGE u-boot.imxNote: 如果有提示 “cc1: error”,通常是交叉编译工具的配置没生效,可以按前面 “交叉编译工具链安装” 中的 “source 工具链配置文件” 操作一次后再执行此步骤。
u-boot 目标文件
u-boot.imx 即目标文件。
3.3编译u-boot环境变量脚本=====> Input:mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "myzr bootscripts" -d board/myzr/bootscripts/myimx6a9_l3035_script.cmd my_environment.scr
=====> Output: Image Name: myzr bootscriptsCreated: Wed Jan2 09:39:38 2019Image Type: ARM Linux Script (uncompressed)Data Size: 2090 Bytes = 2.04 kB = 0.00 MBLoad Address: 00000000Entry Point:00000000Contents:Image 0: 2082 Bytes = 2.03 kB = 0.00 MB
3.4目标文件u-boot.imx 和 my_environment.scr 即编译得到的目标文件,保存这两个文件
【下章节为MY-IMX6-A9 Linux-3.0.35 编译参考手册 v3.0(2)】
页:
[1]