LoginSignup
0
0

More than 5 years have passed since last update.

The Buildroot user manual Chapter 14. How Buildroot works 日本語訳

Posted at

原文: https://buildroot.org/downloads/manual/manual.html#_how_buildroot_works

Chapter 14. How Buildroot works - Buildrootはどのように機能するのか

As mentioned above, Buildroot is basically a set of Makefiles that download, configure, and compile software with the correct options. It also includes patches for various software packages - mainly the ones involved in the cross-compilation toolchain (gcc, binutils and uClibc).

前述のように、Buildrootは基本的に、正しいオプションを使用してソフトウェアをダウンロード、構成、およびコンパイルする一連のMakefileです。 また、さまざまなソフトウェアパッケージ(主にクロスコンパイルツールチェーン(gcc、binutils、およびuClibc)に関連するもの)のパッチも含まれています。

There is basically one Makefile per software package, and they are named with the .mk extension. Makefiles are split into many different parts.

ソフトウェアパッケージごとに基本的に1つのMakefileがあり、それらの拡張子は.mkです。Makefileはさまざまな部分に分割されています。

  • The toolchain/ directory contains the Makefiles and associated files for all software related to the cross-compilation toolchain: binutils, gcc, gdb, kernel-headers and uClibc.
  • The arch/ directory contains the definitions for all the processor architectures that are supported by Buildroot.
  • The package/ directory contains the Makefiles and associated files for all user-space tools and libraries that Buildroot can compile and add to the target root filesystem. There is one sub-directory per package.
  • The linux/ directory contains the Makefiles and associated files for the Linux kernel.
  • The boot/ directory contains the Makefiles and associated files for the bootloaders supported by Buildroot.
  • The system/ directory contains support for system integration, e.g. the target filesystem skeleton and the selection of an init system.
  • The fs/ directory contains the Makefiles and associated files for software related to the generation of the target root filesystem image.
  • toolchain/ディレクトリはクロスコンパイルツールチェーンに関連するすべてのソフトウェアのMakefileと関連ファイルを含みます: binutils, gcc, gdb, kernel-headers および uClibc
  • arch/ディレクトリはBuildrootでサポートされているすべてのプロセッサアーキテクチャの定義を含みます
  • package/ディレクトリには、Buildrootがコンパイルしてターゲットルートファイルシステムに追加できるすべてのユーザースペースツールとライブラリのMakefileと関連ファイルが含まれています。パッケージごとに1つのサブディレクトリがあります
  • linux/ディレクトリはLinuxカーネル用のMakefileと関連ファイルを含みます
  • boot/ディレクトリはBuildrootでサポートされているブートローダのためのMakefileと関連ファイルを含みます
  • system/ディレクトリはシステム統合のサポートを含みます。例: ターゲットファイルシステムのスケルトンとinitシステムの選択
  • fs /ディレクトリはターゲットルートファイルシステムイメージの生成に関連するソフトウェアのためのMakefileと関連ファイルを含みます。

Each directory contains at least 2 files:

各ディレクトリは最低でも次の2つのファイルを含みます:

  • something.mk is the Makefile that downloads, configures, compiles and installs the package something.
  • Config.in is a part of the configuration tool description file. It describes the options related to the package.
  • something.mkはパッケージをダウンロード、設定、コンパイル、そしてインストールするMakefileです
  • Config.inは設定ツール記述ファイルの一部です。パッケージに関連するオプションについて説明しています

The main Makefile performs the following steps (once the configuration is done):

メインのMakefileは以下のステップを実行します(設定は終わっているとして):

  • Create all the output directories: staging, target, build, etc. in the output directory (output/ by default, another value can be specified using O=)
  • Generate the toolchain target. When an internal toolchain is used, this means generating the cross-compilation toolchain. When an external toolchain is used, this means checking the features of the external toolchain and importing it into the Buildroot environment.
  • Generate all the targets listed in the TARGETS variable. This variable is filled by all the individual components' Makefiles. Generating these targets will trigger the compilation of the userspace packages (libraries, programs), the kernel, the bootloader and the generation of the root filesystem images, depending on the configuration.
  • すべての出力ディレクトリを作成します: staging, target, buildなど(デフォルトではoutput/、他の値はO=を使って指定できます)
  • ツールチェーンターゲットを生成します。 内部ツールチェーンが使用されている場合、これはクロスコンパイルツールチェーンを生成することを意味します。 外部ツールチェーンが使用されている場合、これは外部ツールチェーンの機能を確認してそれをBuildroot環境にインポートすることを意味します
  • TARGETS変数にリストされているすべてのターゲットを生成します。この変数は、個々のコンポーネントのすべてのMakefileによって埋められます。これらのターゲットを生成すると、設定に応じて、ユーザースペースパッケージ(ライブラリ、プログラム)、カーネル、ブートローダー、およびルートファイルシステムイメージの生成がトリガーされます
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0