MY-IMX6-A9 Linux-3.0.35 编译参考手册 v3.0(1)
[复制链接]
明远智睿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-gcc COLLECT_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-wrapper Target: arm-fsl-linux-gnueabi Configured 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-zlib Thread model: posix gcc version 4.6.2 20110630 (prerelease) (Freescale MAD -- Linaro 2011.07 -- Built at 2011/08/10 09:20) 3 u-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: HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/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_defconfig myimx6ek200-6u-1g_defconfig myimx6ek200-6u-2g_defconfig myimx6ek200-6u-512m_defconfig myimx6ek200-6s-512m_defconfig myimx6ek200-6s-1g_defconfig myimx6ek200-6s-128m_defconfig myimx6ek200-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_defconfig myimx6ek314-6u-1g_defconfig myimx6ek314-6u-2g_defconfig myimx6ek314-6u-512m_defconfig myimx6ek314-6s-512m_defconfig myimx6ek314-6s-1g_defconfig myimx6ek314-6s-128m_defconfig myimx6ek314-6qp-1g_defconfig myimx6ek314-6qp-2g_defconfig myimx6ek314-6qp-512m_defconfig 执行编译 =====> Input: make =====> Output: scripts/kconfig/conf --silentoldconfig Kconfig CHK include/config.h UPD include/config.h GEN include/autoconf.mk GEN include/autoconf.mk.dep CHK include/config/uboot.release CHK include/generated/timestamp_autogenerated.h CFG u-boot.cfg ...... LD u-boot OBJCOPY u-boot-nodtb.bin OBJCOPY u-boot.srec SYM u-boot.sym COPY u-boot.bin CFGS board/myzr/myimx6/myimx6a9-6q-ddr3.cfg.cfgtmp MKIMAGE u-boot.imx Note: 如果有提示 “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 bootscripts Created: Wed Jan 2 09:39:38 2019 Image Type: ARM Linux Script (uncompressed) Data Size: 2090 Bytes = 2.04 kB = 0.00 MB Load Address: 00000000 Entry Point: 00000000 Contents: 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)】
|