linux - 树莓派内核交叉编译时一些命令的含义

标签 linux linux-kernel raspberry-pi cross-compiling raspberry-pi2

这个 Raspberry Pi 的 official document详细介绍了如何为 Raspberry Pi 交叉编译新的 Linux 内核的过程。本文档中的一些命令如下所示,但是我很难理解。

For Pi 2:

$ cd linux
$ KERNEL=kernel7
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig

  1. KERNEL env 代表什么剂量?
  2. 为什么我们需要将 KERNEL 设置为 kernel7
  3. 另外,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/

相关文章:

linux - 描述 xmm 寄存器中未传递给 rax 的浮点参数数量的整数

python - 在启动时启动 python 脚本 - Raspbian

linux - cd Desktop 在终端中给出错误 no such file/directory

linux - top 命令第三行 CPU 使用率超过 100%

c - 内核空间中的信号处理

raspberry-pi - 一段时间后,Raspberry Pi 的视频输出停止

linux - 如何在 vi 中使用 wq~ 时删除在我的其他 linux 目录中意外创建的 ~

c - 将线性地址翻译为Linux内核中对应的逻辑地址

linux - 似乎无法使用 bash 脚本终止进程

java - 在 Raspberry Pi 上从 C++ 代码调用 Java 类