1. qemu
ubuntu软件包安装:
$ sudo apt-get install qemu
源码编译安装:
$ git clone git://git.qemu-project.org/qemu.git
$ cd qemu
$ git checkout remotes/origin/stable-2.4 -b stable-2.4
2. gcc
$ sudo apt-get install gcc-4.9-arm-linux-gnueabi
$ sudo apt-get install gcc-4.9-arm-linux-gnueabi-base
3. linux kernel源码
$ wget https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.16.tar.xz
4. busybox
$ wget http://www.busybox.NET/downloads/busybox-1.20.2.tar.bz2thorn@ubuntu:~/busybox-1.20.2
$ make defconfig
编译选择使用glibc动态库,因为静态库可能会出现一些未知的问题
# make menuconfigSettings ---> Build Options ---> [ ] Buildstaticbinary(nosharedlibs)
$ make CROSS_COMPILE=arm-linux-gnueabi-
$ make install CROSS_COMPILE=arm-linux-gnueabi-
编译时的错误
错误一:
loginutils/passwd.c:In function ‘passwd_main’:
loginutils/passwd.c:104:16:error: storage size of ‘rlimit_fsize’isn’t known
loginutils/passwd.c:188:2: warning: implicit declaration offunction ‘setrlimit’ [-Wimplicit-function-declaration]
loginutils/passwd.c:188:12: error: ‘RLIMIT_FSIZE’ undeclared(first use in this function)
loginutils/passwd.c:188:12: note: each undeclared identifier isreported>for each function it appears in
loginutils/passwd.c:104:16: warning: unused variable‘rlimit_fsize’ [-Wunused-variable]
改正:
sudo gedit busybox-1.19.4/include/libbb.h
添加头文件:#include <sys/resource.h>
错误二:
util-linux/mkfs_ext2.c:51:27: fatal error: linux/ext2_fs.h:No such file or directory
改正:
出现这个错误是busybox版本导致的,只有busybox-1.19.4会出现这个问题,换成busybox-1.21.1,问题消失。
5. libguestfs
sudo apt-get install libguestfs-tools
6. 编译内核
6.1 生成config文件
make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm O=./out_vexpress_3_16 vexpress_defconfig
6.2 配置内核
$ sudo apt-get install libncurses-dev
$ make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm O=./out_vexpress_3_16 menuconfig
将System Type -->的Enable the L2x0 outer cache controller 取消
6.3 编译
$ make CROSS_COMPILE=arm-linux-gnueabi- ARCH=arm O=./out_vexpress_3_16 zImage -j2