1、将NXP源码拷贝到开发环境home/root/work目录下解压。
elf@ubuntu:~/work$ tar jvxf linux-imx-imx_4.1.15_2.0.0_ga.tar.bz2
elf@ubuntu:~/work$ cd linux-imx-imx_4.1.15_2.0.0_ga/
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ ls
打开arch/arm/boot/dts/Makefile,找到CONFIG_SOC_IMX6ULL,将imx6ull-elf1-emmc.dts添加到Makefile中:
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ vi arch/arm/boot/dts/Makefile
4、建立交叉编译脚本。
建立一个编译脚本build.sh:
elf@ubuntu:~/work/linux-imx-imx_4.1.15_2.0.0_ga$ vim build.sh
添加以下内容,保存退出:
#!/bin/bash
export CPUS=`grep -c processor /proc/cpuinfo`
source /opt/fsl-imx-x11/4.1.15-2.0.0/environment-setup-cortexa7hf-neon-poky-linux-gnueabi
make distclean
make imx6ull_elf1_defconfig
make -j${CPUS}
rm -rf ./.tmp
make modules_install INSTALL_MOD_PATH=./.tmp/rootfs/
cd .tmp/rootfs/
tar -jcvf modules.tar.bz2 *