一. 安装交叉编译器
1. mkdir -p /opt/freescale/usr/local
2. 将文件gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.gz拷贝到/opt/freescale/usr/local目录
3. tar zxvf gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12.tar.gz解压
4. gedit /etc/profile,添加以下内容:
export ARCH=arm
export CROSS_COMPILE=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin/arm-none-linux-gnueabi-
export PATH=/opt/freescale/usr/local/gcc-4.6.2-glibc-2.13-linaro-multilib-2011.12/fsl-linaro-toolchain/bin:$PATH
5. source /etc/profile
6. arm-fsl-linux-gnueabi-gcc -v验证交叉编译器是否安装成功
二. 安装依赖包
#!/bin/bash
# Install packages needed by LTIB(首先要先安装aptitude : sudo apt-get install aptitude)
apt-get install aptitude
aptitude -y install gettext libgtk2.0-dev rpm bison m4 libfreetype6-dev
aptitude -y install libdbus-glib-1 -dev liborbit2-dev intltool
aptitude -y install ccache ncurses-dev zlib1g zlib1g-dev gcc g++ libtool
aptitude -y install uuid-dev liblzo2-dev
aptitude -y install tcl dpkg
aptitude -y install asciidoc texlive-latex-base dblatex xutils-dev
apt-get install texinfo
# Packages required for 64-bit Ubuntu
# Do "uname -a" and see if the word "x86_64" shows up.
if uname -a|grep -sq 'x86_64'; then
aptitude -y install ia32-libs libc6-dev-i386 lib32z1
# The following recommended for Linux development.
# They are not required by LTIB.
aptitude -y install gparted emacs22-nox openssh-server
aptitude -y install nfs-common nfs-kernel-server lintian
aptitude -y install git-core git-doc git-email git-gui gitk
aptitude -y install diffstat indent tofrodos fakeroot doxygen uboot-mkimage
aptitude -y install sendmail mailutils meld atftpd sharutils
aptitude -y install manpages-dev manpages-posix manpages-posix-dev linux-doc
aptitude -y install vnc4server xvnc4viewer
三. 编译u-boot
编译四核uboot:
1. tar zxvf uboot2009-08.tar.gz
2. cd uboot2009-08
3. ./build.sh, 编译1G内存的uboot映像
4. ./build_2gddr.sh, 编译2G内存的uboot映像
编译成功后,将在‘uboot2009-08’目录下产生名为‘u-boot.bin’的二进制文件。该文件即我们需要烧写到Emmc上的U-boot映像文件
编译双核uboot:
1. tar zxvf uboot2015-04.tar.gz
2. cd uboot2015-04
3. ./build_6dl.sh, 编译1G内存的uboot映像
4. ./build_6dl_2gddr.sh, 编译2G内存的uboot映像
编译成功后,将在‘uboot2015-04’目录下产生名为‘u-boot.imx’的二进制文件。该文件即我们需要烧写到emmc上的U-boot映像文件。
四. 编译Linux-3.0.35
1. tar zxvf linux-3.0.35.tar.gz
2. cd linux-3.0.35
3. make distclean
4. cp arch/arm/configs/imx6_defconfig .config
5. make menuconfig, 配置完后选exit, 保存退出
6. 双核编译内核命令: make zImage, 编译结束后将在内核源码目录的arch/arm/boot 中得到Linux内核映像文件zImage.
7. 四核编译内核命令: make uImage, 编译结束后将在内核源码目录的arch/arm/boot 中得到Linux内核映像文件uImage.
注: 四核编译时, 如果出现"mkimage" command not found - U-Boot image will not be built错误, 可以uboot2009-08/tools目录下找到mkimage复制到/sbin目录,再重新编译即可.
五. 制作文件系统
console文件系统制作:
1. tar -jxvf rootfs.tar.bz2
2. cd rootfs
3. rm rootfs.tar.bz2
4. ./pack-rootfs.sh
QT文件系统制作
1. tar -jxvf rootfs.qt4.tar.bz2
2. cd rootfs
3. ./pack-rootfs.sh
最后生成rootfs.tar.bz2是可以下载到开发板emmc中的文件系统映像