交叉編譯arm64核心
1、從arm64路徑下拷貝個預設配置出來
cp ./arch/arm64/configs/defconfig .config
2、配置選項
make ARCH=arm64 CROSS_COMPILE=~/tools/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- menuconfig
3、編譯核心
make ARCH=arm64 CROSS_COMPILE=~/tools/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- all
在根目錄下會產生vmlinux*,arch/arm64/boot/下會產生Image和Image.gz
~/workspace/linux-4.4.132$ ls
arch Documentation ipc Makefile README System.map
block drivers Kbuild mm REPORTING-BUGS tools
certs firmware Kconfig modules.builtin samples usr
COPYING fs kernel modules.order scripts virt
CREDITS include lib Module.symvers security vmlinux
crypto init MAINTAINERS net sound vmlinux.o
~/workspace/linux-4.4.132/arch/arm64/boot$ ls
dts Image Image.gz install.sh Makefile
4、最後,在核心目錄平級,寫個指令碼來方便編譯:
vim makeKernel
#!/bin/bash cd ~/workspace/linux-4.4.132 #make ARCH=arm64 CROSS_COMPILE=~/tools/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- menuconfig make ARCH=arm64 CROSS_COMPILE=~/tools/gcc-linaro-7.2.1-2017.11-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- all
chmod +x makeKernel
之後,直接執行makeKenrel就能編譯核心了。
完工。