查看“MYZR-IMX8M-EK300 Linux-4.14.98 编译参考手册”的源代码
←
MYZR-IMX8M-EK300 Linux-4.14.98 编译参考手册
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
[^_^]: MY-IMX8M-EK300 Linux-4.14.98 编译参考手册 ## **安装交叉编译工具链** * 创建安装目录 <pre> =====> Input: mkdir ~/my-work/03_toolchain -p cd ~/my-work/03_toolchain </pre> * 下载交叉编译工具 <pre> =====> Input: wget https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz </pre> * 解压交叉编译工具 <pre> =====> Input: tar xf gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz -C ~/my-work/03_toolchain </pre> * 创建交叉编译工具配置脚本 <pre> =====> Input: cat << EOF > ~/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.env #!/bin/sh export PATH=${HOME}/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin:${PATH} export ARCH=arm64 export CROSS_COMPILE=aarch64-linux-gnu- EOF =====> Input: chmod +x ~/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.env </pre> * 配置交叉编译环境变量 <pre> =====> Input: source ~/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.env </pre> * 检查安装 <pre> =====> Input: ${CROSS_COMPILE}gcc -v =====> Output: Using built-in specs. COLLECT_GCC=aarch64-linux-gnu-gcc COLLECT_LTO_WRAPPER=/home/myzr/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/../libexec/gcc/aarch64-linux-gnu/7.3.1/lto-wrapper Target: aarch64-linux-gnu Configured with: '/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/snapshots/gcc.git~linaro-7.3-2018.05/configure' SHELL=/bin/bash --with-mpc=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds/destdir/x86_64-unknown-linux-gnu --with-mpfr=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gmp=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds/destdir/x86_64-unknown-linux-gnu --with-gnu-as --with-gnu-ld --disable-libmudflap --enable-lto --enable-shared --without-included-gettext --enable-nls --with-system-zlib --disable-sjlj-exceptions --enable-gnu-unique-object --enable-linker-build-id --disable-libstdcxx-pch --enable-c99 --enable-clocale=gnu --enable-libstdcxx-debug --enable-long-long --with-cloog=no --with-ppl=no --with-isl=no --disable-multilib --enable-fix-cortex-a53-835769 --enable-fix-cortex-a53-843419 --with-arch=armv8-a --enable-threads=posix --enable-multiarch --enable-libstdcxx-time=yes --enable-gnu-indirect-function --with-build-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/sysroots/aarch64-linux-gnu --with-sysroot=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds/destdir/x86_64-unknown-linux-gnu/aarch64-linux-gnu/libc --enable-checking=release --disable-bootstrap --enable-languages=c,c++,fortran,lto --build=x86_64-unknown-linux-gnu --host=x86_64-unknown-linux-gnu --target=aarch64-linux-gnu --prefix=/home/tcwg-buildslave/workspace/tcwg-make-release/builder_arch/amd64/label/tcwg-x86_64-build/target/aarch64-linux-gnu/_build/builds/destdir/x86_64-unknown-linux-gnu Thread model: posix gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) </pre> <br> ## **编译内核文件** ### 编译前的准备 * 创建编译工作目录 <pre> =====> Input: mkdir ~/my-work/02_source/ -p </pre> * 下载内核源码 打开网盘到 “2.1_OS_Linux-4.14.98 -> 02_Source”,下载 “linux-4.14.98.*.tar.bz2”。 把源码包复制到虚拟机的 “~/my-work/02_source/”,并解压(解压命令如下): <pre> =====> Input: cd ~/my-work/02_source tar xf linux-4.14.98.*.tar.bz2 </pre> * 进入内核源码目录 <pre> =====> Input: cd ~/my-work/02_source/linux-4.14.98 </pre> * 配置交叉编译环境变量 <pre> =====> Input: source ~/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.env </pre> ### 编译内核目标文件 * 生成目标 .config 文件 <pre> =====> Input: make myimx8mq_defconfig =====> Output: HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf # # configuration written to .config # </pre> * 编译内核目标文件 <pre> =====> Input: make Image =====> Output: scripts/kconfig/conf --silentoldconfig Kconfig CHK include/config/kernel.release UPD include/config/kernel.release WRAP arch/arm/include/generated/asm/bitsperlong.h ...... AR built-in.o LD vmlinux.o MODPOST vmlinux.o KSYM .tmp_kallsyms1.o KSYM .tmp_kallsyms2.o LD vmlinux SORTEX vmlinux SYSMAP System.map OBJCOPY arch/arm64/boot/Image </pre> * 复制内核目标文件 <pre> =====> Input: cp arch/arm64/boot/Image ./ </pre> ### 编译设备树目标文件 * 设置 TARGETEVKMODE <pre> =====> Input: TARGET_EVK_MODE=myimx8mevk-8mq </pre> **【说明】:TARGET_EVK_MODE 是根据开发板型号设置,可设置为 myimx8mevk-8mq, myimx8mek300-8mq** * 执行编译命令 <pre> =====> Input: make myzr/${TARGET_EVK_MODE}.dtb =====> Output: CHK scripts/mod/devicetable-offsets.h DTC arch/arm64/boot/dts/myzr/${TARGET_EVK_MODE}.dtb </pre> * 复制设备树目标文件 <pre> =====> Input: cp arch/arm64/boot/dts/myzr/${TARGET_EVK_MODE}.dtb ./ </pre> ### 编译内核模块包 * 执行编译 <pre> =====> Input: make modules =====> Output: CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h ...... LD [M] sound/usb/snd-usb-audio.ko LD [M] sound/usb/snd-usbmidi-lib.ko </pre> * 创建内核模块的保存目录 <pre> =====> Input: mkdir modules </pre> * 安装内核模块到指定目录 <pre> =====> Input: make modules_install headers_install INSTALL_MOD_PATH=./modules =====> Output: INSTALL arch/arm64/crypto/aes-neon-blk.ko INSTALL arch/arm64/crypto/aes-neon-bs.ko ...... INSTALL sound/usb/snd-usbmidi-lib.ko DEPMOD 4.14.98-g2ff648b CHK include/generated/uapi/linux/version.h </pre> * 打包内核模块文件 <pre> =====> Input: tar cjvf kernel-modules.tar.bz2 -C modules lib </pre> ### 目标文件 **Image、*.dtb 和 kernel-modules.tar.bz2 即编译得到的目标文件,保存这三个文件** ## **编译u-boot文件** ### 编译前的准备 * 下载u-boot源码 打开网盘到 “2.1_OS_Linux-4.14.98 -> 02_Source”,下载 “u-boot-2018.03.*.tar.bz2”。 把源码包复制到虚拟机的 “~/my-work/02_source/”,并解压(解压命令如下): <pre> =====> Input: tar xf u-boot-2018.03.*.tar.bz2 </pre> * 进入内核源码目录 <pre> =====> Input: cd ~/my-work/02_source/u-boot-2018.03 </pre> * 配置交叉编译环境变量 <pre> =====> Input: source ~/my-work/03_toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.env </pre> ### 编译u-boot目标文件 * 设置 TARGETEVKMODE <pre> =====> Input: TARGET_EVK_MODE=myimx8mevk-8mq </pre> **【说明】:TARGET_EVK_MODE 是根据开发板型号设置,可设置为 myimx8mevk-8mq, myimx8mek300-8mq** * 生成目标 .config 文件 <pre> =====> Input: make ${TARGET_EVK_MODE}_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 # </pre> * 编译u-boot目标文件 <pre> =====> Input: make =====> Output: scripts/kconfig/conf --silentoldconfig Kconfig CHK include/config.h UPD include/config.h CFG u-boot.cfg GEN include/autoconf.mk ...... LD spl/u-boot-spl OBJCOPY spl/u-boot-spl-nodtb.bin COPY spl/u-boot-spl.bin CFGS arch/arm/mach-imx/spl_sd.cfg.cfgtmp MKIMAGE SPL CFGCHK u-boot.cfg </pre> * 复制u-boot目标文件 <pre> =====> Input: cp arch/arm/dts/${TARGET_EVK_MODE}.dtb ./ </pre> ### 目标文件 **${TARGETEVKMODE}.dtb、u-boot-nodtb.bin 和 u-boot-spl.bin 即编译得到的目标文件,保存这三个文件,在下一步的 bootloader 编译需要用到** ## **编译BootLoader** ### 编译前的准备 * 下载BootLoader编译工具 打开网盘到 “2.1_OS_Linux-4.14.98 -> 02Source”,下载 “mkimage-imx4.14.98.*.tar.bz2”。 把源码包复制到虚拟机的 “~/my-work/02_source/”,并解压(解压命令如下): <pre> =====> Input: tar xf mkimage-imx_4.14.98.*.tar.bz2 </pre> * 进入工具目录 <pre> =====> Input: cd ~/my-work/02_source/mkimage-imx_4.14.98 </pre> * 设置 TARGETEVKMODE <pre> =====> Input: TARGET_EVK_MODE=myimx8mevk-8mq </pre> **【说明】:TARGET_EVK_MODE 是根据开发板型号设置,可设置为 myimx8mevk-8mq, myimx8mek300-8mq** * 复制依赖文件 把u-boot编译得到的三个文件复制过来 <pre> =====> Input: cp ../u-boot-2018.03/u-boot-nodtb.bin ./iMX8M/${TARGET_EVK_MODE}-nodtb.bin cp ../u-boot-2018.03/spl/u-boot-spl.bin ./iMX8M/${TARGET_EVK_MODE}-spl.bin cp ../u-boot-2018.03/${TARGET_EVK_MODE}.dtb ./iMX8M/${TARGET_EVK_MODE}.dtb </pre> ### 编译BootLoader目标文件 * 输入编译指令 <pre> =====> Input: make SOC=iMX8M ${TARGET_EVK_MODE%-*} OUTIMG=${TARGET_EVK_MODE}.bin =====> Output: Compiling mkimage_imx8 PLAT=imx8mq HDMI=yes Compiling mkimage_imx8 ...... Second Loader IMAGE: sld_header_off 0x57c00 sld_csf_off 0x58c20 sld hab block: 0x401fcdc0 0x57c00 0x1020 </pre> * 复制BootLoader目标文件 <pre> =====> Input: cp ./iMX8M/${TARGET_EVK_MODE}.bin ./ </pre> ### 目标文件 **${TARGET_EVK_MODE}.bin 即编译得到的目标文件,保存这个文件** Web: http://www.myzr.com.cn/ Wiki: http://wiki.myzr.com.cn/ BBS: http://bbs.myzr.com.cn/ Tel: 0756-3628023/3628021 E-mail: service@myzr.com.cn </pre> <br> <br> -------------------------------------------------------------------------------- <pre> -------------------------------------------------------------------------------- * 珠海明远智睿科技有限公司 * ZhuHai MYZR Technology CO.,LTD. * Latest Update: 2019/11/08 * Supporter: Tang Bin -------------------------------------------------------------------------------- </pre>
返回至
MYZR-IMX8M-EK300 Linux-4.14.98 编译参考手册
。
导航菜单
个人工具
登录
命名空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
[-_-]
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
所有页面
工具
链入页面
相关更改
特殊页面
页面信息