参考之前的文章,如参考链接1,使用crosstool-NG来编译toolchain,其自带了rpi3的defconfig。
树莓派官方维护了其自己的内核,使用下述方法下载,编译:
1 2 3 4 5 | $ git clone --depth=1 -b rpi-4.14.y $ KERNEL_ENV := cd $(KERNEL_DIR) && ARCH=$(ARCH) CROSS_COMPILE=$(TOOLCHAIN_BIN_PREFIX) \ make O=$(KERNEL_BUILD_DIR)/ $ $(KERNEL_ENV) bcmrpi3_defconfig $ $(KERNEL_ENV) -j4 |
编译完成之后,拷贝arch/arm64/boot/Image到sd卡的boot分区,重命名为kernel8.img即可。
参考:
使用crosstool-NG编译toolchain. https://insidelinuxdev.net/article/a01rn1.html
Build 64-bit kernel for Raspberry Pi 3, using native tools. http://www.tal.org/tutorials/raspberry-pi3-build-64-bit-kernel
KERNEL BUILDING. https://www.raspberrypi.org/documentation/linux/kernel/building.md