【接上一章节明远智睿MY-IMX6 Linux-4.1.15 编译参考手册】
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 myimx6ek140p-6y-256m-emmc_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 后面的 myimx6ek140p-6y-256m-emmc_defconfig 改为与开发板型号对应的配置文件。
********** MY-IMX6-EK140 ********** myimx6ek140-6g-128m-emmc_defconfig myimx6ek140-6y-128m-emmc_defconfig myimx6ek140-6g-128m-nand_defconfig myimx6ek140-6y-128m-nand_defconfig myimx6ek140-6g-256m-emmc_defconfig myimx6ek140-6y-256m-emmc_defconfig myimx6ek140-6g-256m-nand_defconfig myimx6ek140-6y-256m-nand_defconfig myimx6ek140-6g-512m-emmc_defconfig myimx6ek140-6y-512m-emmc_defconfig myimx6ek140-6g-512m-nand_defconfig myimx6ek140-6y-512m-nand_defconfig ********** MY-IMX6-EK140P ********** myimx6ek140p-6g-128m-emmc_defconfig myimx6ek140p-6y-128m-emmc_defconfig myimx6ek140p-6g-128m-nand_defconfig myimx6ek140p-6y-128m-nand_defconfig myimx6ek140p-6g-256m-emmc_defconfig myimx6ek140p-6y-256m-emmc_defconfig myimx6ek140p-6g-256m-nand_defconfig myimx6ek140p-6y-256m-nand_defconfig myimx6ek140p-6g-512m-emmc_defconfig myimx6ek140p-6y-512m-emmc_defconfig myimx6ek140p-6g-512m-nand_defconfig myimx6ek140p-6y-512m-nand_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 ********** MY-IMX6-EK336 ********** myimx6ek336-6q-1g_defconfig myimx6ek336-6q-2g_defconfig myimx6ek336-6q-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/myimx6a7-6y-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/myimx6a7_l4115_emmc_script.cmd my_environment_emmc.scr =====> Output: Image Name: myzr bootscripts Created: Wed Jan 2 09:40:40 2019 Image Type: ARM Linux Script (uncompressed) Data Size: 1450 Bytes = 1.42 kB = 0.00 MB Load Address: 00000000 Entry Point: 00000000 Contents: Image 0: 1442 Bytes = 1.41 kB = 0.00 MB
3.4 目标文件u-boot.imx 和 my_environment_emmc.scr 即编译得到的目标文件,保存这两个文件 4 内核编译4.1 编译前的准备创建编译工作目录 =====> Input: mkdir ~/my-work/02_source/ -p
解压源码包到工作目录 =====> Input: tar xf linux-4.1.15-svn*.tar.bz2 -C ~/my-work/02_source/
4.2 编译内核目标文件进入内核源码目录 =====> Input: cd ~/my-work/02_source/linux-4.1.15
生成目标平台的 .config 文件 =====> Input: make myimx6a9_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 # Note: 如果有“Can't find default configuration "arch/x86/configs” 的错误,是因为交叉编译工具链的配置没有生效,可以按前面 “交叉编译工具链安装” 中的 “source 工具链配置文件” 操作一次后再执行此步骤
【注意】:上面 make 后面的 myimx6a7_defconfig 改为与开发板型号对应的配置文件。
********** MY-IMX6-EK140、MY-IMX6-EK140P ********** myimx6a7_defconfig ********** MY-IMX6-EK200、MY-IMX6-EK314、MY-IMX6-EK336 ********** myimx6a9_defconfig 编译内核目标文件 =====> Input: make zImage =====> Output: scripts/kconfig/conf --silentoldconfig Kconfig CHK include/config/kernel.release UPD include/config/kernel.release WRAP arch/arm/include/generated/asm/auxvec.h ...... AS arch/arm/boot/compressed/piggy.lzo.o LD arch/arm/boot/compressed/vmlinux OBJCOPY arch/arm/boot/zImage Kernel: arch/arm/boot/zImage is ready 内核目标文件
arch/arm/boot/zImage 即内核目标文件 【下章节为明远智睿MY-IMX6 Linux-4.1.15 编译参考手册(3)】
|