1、创建目录
[fedora@localhost lqm]$ pwd
/home/fedora/lqm
[fedora@localhost lqm]$ mkdir -p ./embedded-system/{setup-dir,src-dir,kernel,build-dir,tool-chain,program,doc
}
[fedora@localhost lqm]$
2、下载相关数据
[fedora@localhost setup-dir]$ wget ftp://ftp.gnu.org/gnu/binutils/binutils-2.11.2.tar.gz
[fedora@localhost setup-dir]$ wget ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-core-2.95.3.tar.gz
[fedora@localhost setup-dir]$ wget ftp://ftp.gnu.org/gnu/gcc/gcc-2.95.3/gcc-g++-2.95.3.tar.gz
[fedora@localhost setup-dir]$ wget ftp://ftp.gnu.org/gnu/glibc/glibc-2.2.4.tar.gz
[fedora@localhost setup-dir]$ wget ftp://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-2.2.4.tar.gz
[fedora@localhost setup-dir]$ wget ftp://ftp.kernel.org/pub/linux/kernel/v2.4/linux-2.4.21.tar.gz
[fedora@localhost setup-dir]$ wget ftp://ftp.arm.linux.org.uk/pub/linux/arm/kernel/v2.4/patch-2.4.21-rmk1.gz
[fedora@localhost setup-dir]$ ls
binutils-2.11.2.tar.gz gcc-g++-2.95.3.tar.gz glibc-linuxthreads-2.2.4.tar.gz patch-2.4.21-rmk1.gz
gcc-core-2.95.3.tar.gz glibc-2.2.4.tar.gz linux-2.4.21.tar.gz
[fedora@localhost setup-dir]$
3、定义环境变量
[fedora@localhost build-dir]$ cd ../doc
[fedora@localhost scripts]$ vi env
[fedora@localhost scripts]$ cat -n env
1 export PRJROOT=/home/lqm/embedded-system
2 export TARGET=arm-linux
3 export PREFIX=$PRJROOT/tool-chain
4 export TARGET_PREFIX=$PREFIX/$TARGET
5 export PATH=$PREFIX/bin:$PATH
[fedora@localhost scripts]$ . env
[fedora@localhost embedded-system]$
4、内核头文件配置
[fedora@localhost embedded-system]$ cd kernel/
[fedora@localhost kernel]$ #内核头文件的配置
[fedora@localhost kernel]$ tar zxvf ../setup-dir/linux-2.4.21.tar.gz
[fedora@localhost kernel]$ gunzip ../setup-dir/patch-2.4.21-rmk1.gz
[fedora@localhost kernel]$ cd linux-2.4.21/
[fedora@localhost linux-2.4.21]$ patch -p1 < ../../setup-dir/patch-2.4.21-rmk1
[fedora@localhost linux-2.4.21]$ make ARCH=arm CROSS_COMPILE=arm-linux-menuconfig #配置
[fedora@localhost linux-2.4.21]$ make dep
[fedora@localhost linux-2.4.21]$ make distclean
[fedora@localhost li