简体   繁体   English

为Raspberry Pi交叉编译内核时某些命令的含义

[英]Meaning of some commands when cross-compiling kernel for Raspberry Pi

This Raspberry Pi's official document details the procedures of how to cross-compile new Linux Kernel for Raspberry Pi. 该Raspberry Pi的正式文档详细介绍了如何为Raspberry Pi交叉编译新的Linux内核的过程。 Some commands in this document which are shown below, however, I can hardly understand. 下面显示了本文档中的某些命令,但是我几乎听不懂。

For Pi 2: 对于Pi 2:

$ cd linux $ cd Linux
$ KERNEL=kernel7 $ KERNEL =内核7
$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig $ make ARCH = arm CROSS_COMPILE = arm-linux-gnueabihf- bcm2709_defconfig

  1. What dose KERNEL env stand for? KERNEL env代表什么剂量?
  2. Why we need to set KERNEL to kernel7 ? 为什么我们需要将KERNEL设置为kernel7
  3. Also, what doese make bcm2709_defconfig do? 另外,bcm2709_defconfig make bcm2709_defconfig做什么?

-bcm2709_defconfig choose the config file to used. -bcm2709_defconfig选择要使用的配置文件。 They are stored in paths like this: arch/arm/configs/ For the KERNEL env, I have never seen this before... It is not the mainline kernel, may be a special RPi's feature. 它们存储在这样的路径中:arch / arm / configs /对于KERNEL env,我以前从未见过……这不是主线内核,可能是RPi的特殊功能。

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 用法:sudo脚本/ 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 ie kernel=changed_name.img 您可以将环境变量更改为任何所需的变量,但是必须在引导文件夹的config.txt中添加一行,即kernel = changed_name.img

KERNEL=kernel7 - Open the boot folder. KERNEL = kernel7-打开启动文件夹。 You will see two .img. 您将看到两个.img。 One is kernel.img and other would be kernel7.img . 一个是kernel.img,另一个是kernel7.img。 By default Raspi 2/3 uses kernel7.img when it boots up. 默认情况下,Raspi 2/3在启动时会使用kernel7.img。 And Raspi 1 uses kernel.img by default. Raspi 1默认使用kernel.img。 As you are using Raspi 2/3 you are setting that environment variable to kernel7. 当您使用Raspi 2/3时,您正在将该环境变量设置为kernel7。

bcm2709_defconfig - This the configuration file made for Raspberry Pi 2 architecture. bcm2709_defconfig-这是为Raspberry Pi 2体系结构制作的配置文件。 For example, Raspberry Pi 1 compilation uses bcmrpi_defconfig. 例如,Raspberry Pi 1编译使用bcmrpi_defconfig。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM