相关版本信息
硬件:树莓派 2b目标系统: linux 4.1.18 编译环境:ubuntu 14.4 32bit用户路径:/home/hi/
安装交叉编译链
cdmkdir pi/kernelcd pi/kernelgit clone https://github.com/raspberrypi/tools tools注:在用户目录下建立一个pi/kernel目录,并将交叉编译工具链下载到此目录中
下载系统源代码
git clone -b rpi-4.1.y_rebase --depth=1 https://github.com/raspberrypi/linux linux注:将4.1.18版本的系统源代码下载到/home/hi/pi/kernel目录中,此时该目录中就有了两个文件夹 tools 与 linux
开始编译
注:*** 代表交叉编译工具链所在路径,比如 /home/hi/pi/kernel/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- 此处路径中的tools 是刚刚下载工具链所在目录 cd linux KERNEL=kernel7 make ARCH=arm CROSS_COMPILE=*** bcm2709_defconfig make ARCH=arm CROSS_COMPILE=*** zImage modules dtbs
参考官方文档
https://www.raspberrypi.org/documentation/linux/kernel/building.md
转载于:https://www.cnblogs.com/Dream-Chaser/p/5283086.html
