buildroot 使用小记 - 2 源文件目录结构

时间:2021-08-24 16:13:48

官方下载下来的buildroot源码包在解压后,是一个名为buildroot的文件夹,它下面的目录/文件结构如下:

Makefile - *makefile,编译总入口

Config.in - *Config.in文件,包含主要的配置信息,同时还会引用其它Config.in文件(比如arch linux toolchain等目录下的Config.in文件)

arch/ -   Config.in.* 文件定义了不同的架构 (processor type, ABI, floating point, etc.)

toolchain/ - 工具链
      ▶ packages for generating or using toolchains
      ▶ toolchain/ virtual package that depends on either toolchain-buildroot or toolchain-external
      ▶ toolchain-buildroot/ virtual package to build the internal toolchain
      ▶ toolchain-external/ package to handle external toolchains
system/ - 根文件系统框架
      ▶ skeleton/ the rootfs skeleton
      ▶ Config.in, options for system-wide features like init system, /dev handling, etc.
linux/ - linux内核代码
      ▶ linux.mk, the Linux kernel package

package/ -  软件包
    
   ▶ all the user space packages (1600+)
▶ busybox/, gcc/, qt5/, etc.
      ▶ pkg-generic.mk, core package infrastructure
      ▶ pkg-cmake.mk, pkg-autotools.mk, pkg-perl.mk, etc. Specialized package infrastructures
fs/ - 文件系统
      ▶ logic to generate filesystem images in various formats
      ▶ common.mk, common logic
      ▶ cpio/, ext2/, squashfs/, tar/, ubifs/, etc.
boot/ - 引导系统
      ▶ bootloader packages
      ▶ at91bootstrap3/, barebox/, grub/, syslinux/, uboot/, etc.

configs/ - 针对不同硬件平台的特有配置文件合集
      ▶ default configuration files for various platforms
      ▶ similar to kernel defconfigs
      ▶ atmel_xplained_defconfig, beaglebone_defconfig,raspberrypi_defconfig, etc.

board/ - 针对不同硬件平台的特有配置文件/脚本/patch
      ▶ board-specific files (kernel configuration files, kernel patches, image flashing scripts, etc.)
      ▶ typically go together with a defconfig in configs/
support/ - 其它
      ▶ misc utilities (kconfig code, libtool patches, download helpers, and more.)

docs/ - 文档
      ▶ Buildroot documentation
      ▶ Written in AsciiDoc, can generate HTML, PDF, TXT versions:make manual
      ▶ 90 pages PDF document
      ▶ Also available pre-generated online.
      ▶ http://buildroot.org/downloads/manual/manual.html