这个 Raspberry Pi 的 official document详细介绍了如何为 Raspberry Pi 交叉编译新的 Linux 内核的过程。本文档中的一些命令如下所示,但是我很难理解。
For Pi 2:
$ cd linux
$ KERNEL=kernel7
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
KERNEL
env 代表什么剂量?- 为什么我们需要将
KERNEL
设置为kernel7
? - 另外,
make bcm2709_defconfig
做什么?
最佳答案
KERNEL - It is the environment variable. We use that environment variable later when we copy the new compiled image to boot folder.
Usage: sudo scripts/mkknlimg arch/arm/boot/zImage mnt/fat32/$KERNEL.img
You can change environment variable to any desired but then you have to add a line in config.txt in boot folder i.e. kernel=changed_name.img
KERNEL=kernel7 - 打开引导文件夹。您将看到两个 .img。一个是 kernel.img ,另一个是 kernel7.img 。默认情况下,Raspi 2/3 在启动时使用 kernel7.img。而 Raspi 1 默认使用 kernel.img。当您使用 Raspi 2/3 时,您将该环境变量设置为 kernel7。
bcm2709_defconfig - 这是为 Raspberry Pi 2 架构制作的配置文件。例如Raspberry Pi 1编译使用bcmrpi_defconfig。
关于linux - 树莓派内核交叉编译时一些命令的含义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31199827/