“Buildroot”的版本间的差异

来自百问网嵌入式Linux wiki
 
(未显示2个用户的49个中间版本)
第1行: 第1行:
buildroot版本为2018.02LTS版
+
=buildroot简介=
官网使用手册 #https://buildroot.org/downloads/manual/manual.html
+
:Buildroot是Linux平台上一个构建嵌入式Linux系统的框架。整个Buildroot是由Makefile脚本和Kconfig配置文件构成的。<br>
=配置单板架构=
+
:你可以和编译Linux内核一样,通过buildroot配置,menuconfig修改,编译出一个完整的可以直接烧写到机器上运行的Linux系统软件(包含boot、kernel、rootfs以及rootfs中的各种库和应用程序)。<br>
Target options --->
+
:如何使用make menuconfig 请参考[[Menuconfig_or_how_to_configure_kernel]]<br>
==cortex-A8配置==
+
:官网使用手册 https://buildroot.org/downloads/manual/manual.html   
  Target Architecture (ARM (little endian))  --->
+
=buildroot功能详解=
  Target Binary Format (ELF)  --->
 
  Target Architecture Variant (cortex-A8)  --->
 
  Target ABI (EABIhf)  --->
 
  Floating point strategy (VFPv3-D16)  --->
 
  ARM instruction set (ARM)  --->
 
==cortex-A9配置==
 
      Target Architecture (ARM (little endian))  --->
 
      Target Binary Format (ELF)  --->
 
      Target Architecture Variant (cortex-A9)  --->
 
  [*] Enable NEON SIMD extension support
 
  [*] Enable VFP extension support
 
      Target ABI (EABIhf)  --->
 
      Floating point strategy (VFPv3-D16)  --->
 
      ARM instruction set (ARM)  --->
 
  
=构建配置=
+
* [[Buildroot_TargetOptions      | TargetOptions      ]]
Build options  --->
+
::目标单板架构配置。
      Commands  --->
+
* [[Buildroot_BuildOptions        | BuildOptions        ]]
  (/ti/mini437x_buildroot/configs/mini4378_defconfig) Location to save buildroot config
+
::主要是一些编译时用到的选项,比如dl的路径,下载代码包使用的路径,同时运行多个编译的上限,是否使能编译器缓冲区等等,这里按照默认就行了.
  ($(TOPDIR)/dl) Download dir
+
* [[Buildroot_Toolchain          | Toolchain          ]]
  ($(BASE_DIR)/host) Host dir
+
::此页面主要介绍如何使用buildroot配置内部交叉编译工具链,以及外部交叉编译工具链,还有如何添加自己的交叉编译工具链!
      Mirrors and Download locations  --->
+
* [[Buildroot_SystemConfiguration | SystemConfiguration ]]
  (0) Number of jobs to run simultaneously (0 for auto)
+
:: 此页主要涉及配置系统主机名,登陆欢迎信息root密码,以及构建系统镜像版本,根文件系统覆盖!
  [ ] Enable compiler cache
+
* [[Buildroot_Kernel              | Kernel              ]]
  [ ] build packages with debugging symbols
+
::此页面主要介绍在线下载内核源码并自动编译集成到根文件系统的方法!
  [*] strip target binaries
+
* [[Buildroot_TargetPackages      | TargetPackages      ]]
  ()    executables that should not be stripped
+
::此页主要介绍目标开发板上使用的根文件系统所需要的软件包的添加方法,以及配置方法!
  ()    directories that should be skipped when stripping
+
:*[[Buildroot_Audio and video applications | Audio and video applications]]
      gcc optimization level (optimize for size)  --->
+
:::此页主要介绍buildtroot支持的音频和视频应用功能介绍以及如何配置使用
  [ ] Enable google-breakpad support
+
:*[[Buildroot_Compressors and decompressors | Compressors and decompressors]]
      libraries (shared only)  --->
+
:::此页主要介绍buildtroot支持的压缩和解压应用简介以及如何配置使用
  ($(CONFIG_DIR)/local.mk) location of a package override file
+
:*[[Buildroot_Debugging profiling and benchmark |Debugging profiling and benchmark]]
  (board/mini437x/patches) global patch directories
+
:::此页面主要介绍buildroot 调试、分析和基准测试应用的简介以及如何配置使用。
      Advanced  --->
+
:*[[Buildroot_Development tools | Development tools]]
      *** Security Hardening Options ***
+
:::此页面主要介绍buildroot支持在目标系统上的开发工具应用的简介以及如何配置使用。
      Stack Smashing Protection (None)  --->
+
:*[[Buildroot_Filesystem and flash utilities | Filesystem and flash utilities]]
       RELRO Protection (None)  --->
+
:::此页面主要介绍buildroot支持在目标系统上的文件系统和闪存实用程序的简介以及如何配置使用。
      Buffer-overflow Detection (FORTIFY_SOURCE) (None)  --->
+
:*[[Buildroot_Fonts cursors icons sounds and themes |Fonts cursors icons sounds and themes]]
 +
:::此页面主要介绍buildroot支持在目标系统上的字体,游标,图标,声音和主题的简介以及如何配置使用。
 +
:*[[Buildroot_Games | Games]]
 +
:::此页面主要介绍buildroot支持在目标系统上的游戏 以及如何配置使用。
 +
:*[[Buildroot_Graphic libraries and applications | Graphic libraries and applications]]
 +
:::此页面主要介绍buildroot支持在目标系统上的图形库和应用程序(图形/文本)的简介以及如何配置使用。
 +
:*[[Buildroot_Hardware handling | Hardware handling]]
 +
:::此页面主要介绍buildroot支持在目标系统上的硬件处理应用/工具的简介以及如何配置使用。
 +
:*[[Buildroot_Interpreter languages and scripting | Interpreter languages and scripting]]
 +
:::此页面主要介绍buildroot支持在目标系统上的编程语言和脚本的简介以及如何配置使用。
 +
:*[[Buildroot_Libraries | Libraries]]
 +
:::此页面主要介绍buildroot支持在目标系统上的库的简介以及如何配置使用。
 +
:*[[Buildroot_Mail| Mail]]
 +
:::此页面主要介绍buildroot支持在目标系统上的邮箱应用的简介以及如何配置使用。
 +
:*[[Buildroot_Miscellaneous | Miscellaneous]]
 +
:::此页面主要介绍buildroot支持在目标系统上的一些杂项应用的简介以及如何配置使用。
 +
:*[[Buildroot_Networking applications | Networking applications]]
 +
:::此页面主要介绍buildroot支持在目标系统上的网络应用程序的简介以及如何配置使用。
 +
:*[[Buildroot_Package managers | Package managers]]
 +
:::此页面主要介绍buildroot支持在目标系统上的 包管理 应用的简介以及如何配置使用。
 +
:*[[Buildroot_Real-Time | Real-Time]]
 +
:::此页面主要介绍buildroot支持在目标系统上的 实时时钟 的简介以及如何配置使用。
 +
:*[[Buildroot_Security | Security]]
 +
:::此页面主要介绍buildroot支持在目标系统上的 实时时钟 的简介以及如何配置使用。
 +
:*[[Buildroot_Shell and utilities | Shell and utilities]]
 +
:::此页面主要介绍buildroot支持在目标系统上的 Shell和程序 的简介以及如何配置使用。
 +
:*[[Buildroot_System tools |System tools]]
 +
:::此页面主要介绍buildroot支持在目标系统上的 系统工具 的简介以及如何配置使用。
 +
:*[[Buildroot_Text editors and viewers | Text editors and viewers]]
 +
:::此页面主要介绍buildroot支持在目标系统上的 文版编辑和浏览工具 的简介以及如何配置使用。
 +
* [[Buildroot_FilesystemImages    | FilesystemImages    ]]
 +
::此页介绍如何使用buildroot自动根据系统分区生成相应的系统镜像!
 +
* [[Buildroot_Bootloaders        | Bootloaders        ]]
 +
::此页主要介绍在线下载u-boot源码,编译并生成相应的镜像文件到指定位置!
 +
* [[Buildroot_HostUtilities      | HostUtilities       ]]
 +
::
 +
* [[Buildroot_LegacyConfigOptions | LegacyConfigOptions ]]
  
=配置工具链=
+
=目录结构=
Toolchain type (External toolchain) --->
+
*<code>buildroot/package/:</code>下面放着应用软件的配置文件,每个应用软件的配置文件有<code>Config.in</code>和<code>soft_name.mk</code>,其中soft_name.mk(这种其实就Makefile脚本的自动构建脚本)文件可以去下载应用软件的包。
 +
*<code>buildroot/output/:</code>是编译出来的输出文件夹,里面的build/目录存放着解压后的各种软件包编译完后的现场。
 +
**<code>build:</code>所有源码包解压出来的文件存放地和编译的发生地
 +
**<code>staging:</code>软链接到 host/<tuple>/sysroot 就是上面说到的文件系统需要的库等目录,方便查看
 +
**<code>target: </code>目录是用来制作rootfs的,里面放着Linux系统基本的目录结构,以及各种编译好的应用库和bin可执行文件。不能用来nfs mount到开发板,因为buildroot不是root权权运行的,所以现dev/,etc/等一些文件无法创建,所以目录还不完整,要用images/里的rootfs.tar解压出来的根文件目录才能mount.使用如下命令:<code>sudo tar -C /destination/of/extraction -xf images/rootfs.tar</code>
 +
**<code>Images:</code>目录下就是最终生成的可烧写到板子上的各种image。
 +
**<code>host:</code>是由各类源码编译后在你主机上运行的工具(build for host)的安装目录,如arm-linux-gcc就是安装在这里;编译出来的主机工具在host/usr下;根目录所需要的库及一些基本目录就在<code>host/<tuple>/sysroot/</code>或<code>host/usr/<tuple>/sysroot/</code>里 (<tuple>:arm-buildroot-linux-gnueabi),如果是外部toolchain,比如lirano的就在libc里,名字不一样而已
 +
*<code>buildroot/dl:</code>存放下载的源码包及应用软件的压缩包
 +
*<code>buildroot/fs:</code>放各种文件系统的源代码
 +
*<code>buildroot/fs/skeleton:</code>放生成文件系统镜像的地方,及板子里面的系统
 +
*<code>buildroot/linux:</code>存放着Linux kernel的自动构建脚本。
 +
*<code>buildroot/configs:</code>放置开发板的一些配置参数
 +
*<code>buildroot/dl:</code>目录存放从官网上下载的开源软件包,第一次下载后,下次就不会再去从官网下载了,而是从dl/目录下拿开源包,以节约时间。本身下载通常都是很慢的,你可以手动找到相关包下载后放到这里就OK了,make时会自动检测这个目录.
 +
*<code>buildroot/docs:</code>存放相关的参考文档。
 +
*<code>buildroot/arch:</code>目录存放CPU架构相关的配置脚本,如arm/mips/x86 ,这些CPU相关的配置,在制作工具链,编译boot和内核时很关键。
 +
*<code>buildroot/board:</code>存放了一些默认开发板的配置补丁之类的
 +
*<code>buildroot/boot:</code>
 +
*<code>buildroot/build:</code>
 +
*<code>buildroot/support:</code>
 +
*<code>buildroot/system:</code>这里就是根目录的主要骨架了和相关的启动初始化配置,当制作根目录时就是将此处的文件cp到output里去.然后再安装toolchain的动态库和你勾选的package的可执行文件之类的.
 +
*<code>buildroot/toolchain:</code>
  
  ( ) Buildroot toolchain
+
=buidroot常用命令=
  (X) External toolchain
+
==Linux内核操作的常用命令==
==自动制作工具链==
+
*buildroot下单独编译内核
参考文章 https://blog.csdn.net/zhou_chenz/article/details/52346134
+
  book@100ask:~/Buildroot$ make  linux-rebuild
 +
*运行内核make menuconfig配置选项界面
 +
  book@100ask:~/Buildroot$ make linux-menuconfig 
 +
*保存内核最新的配置文件
 +
  book@100ask:~/Buildroot$ make linux-savedefconfig 
 +
*更新内核配置文件
 +
  book@100ask:~/Buildroot$ make linux-update-defconfig
  
==在线下载的==
+
==其它常用操作==
  Toolchain type (External toolchain)  --->                                                                                         
+
*buildroot下编译生成sdk
      *** Toolchain External Options ***                                                                                                
+
  book@100ask:~/Buildroot$ make sdk
      Toolchain (Custom toolchain)  --->                                                                                                 
+
*buildroot下编译时显示详细信息
      Toolchain origin (Toolchain to be downloaded and installed) --->                                                                 
+
  book@100ask:~/Buildroot$ make V=1 <pkg>
  (https://publishing-ap-linaro-org.s3.amazonaws.com/...)
+
*buildroot下编译时显示详细信息
  ($(ARCH)-linux-gnueabihf) Toolchain prefix                                                                                             
+
book@100ask:~/Buildroot$ make V=1 <pkg>
      External toolchain gcc version (5.x)  --->                                                                                         
+
*buildroot下单独编译u-boot
      External toolchain kernel headers series (4.0.x) --->                                                                             
+
  book@100ask:~/Buildroot$ make uboot-rebuild
      External toolchain C library (glibc/eglibc)  --->                                                                                  
+
*buildroot下单独编译某个软件包
  [*] Toolchain has SSP support?                                                                                                         
+
  book@100ask:~/Buildroot$ make <pkg>-rebuild
  [*] Toolchain has RPC support?                                                                                                         
 
  [*] Toolchain has C++ support?                                                                                                         
 
  () Extra toolchain libraries to be copied to target                                                                                   
 
  [ ] Copy gdb server to the Target                                                                                                     
 
      *** Host GDB Options ***                                                                                                           
 
  [ ] Build cross gdb for the host                                                                                                       
 
      *** Toolchain Generic Options ***                                                                                                 
 
  [ ] Copy gconv libraries                                                                                                               
 
  [*] Enable MMU support                                                                                                                 
 
  () Target Optimizations                                                                                                               
 
  ()  Target linker options                                                                                                             
 
  [ ] Register toolchain within Eclipse Buildroot plug-in
 
  
=系统配置=                                                                      
+
=buildroot高级操作=
System configuration  --->
+
*[[How to add a new package to buildroot | 如何添加一个自己的包到buildroot]]
 
+
*[[Buildroot_TargetOptions | 如何配置TargetOptions(目标架构选择) ]]
  Root FS skeleton (default target skeleton)  --->                                       
+
*[[Buildroot_BuildOptions| 如何配置buildroot构建选项]]
  (mini437x) System hostname                                                           
+
*[[Buildroot_Toolchain | 如何为目标单板配置工具链]]
  (Welcome to Mini437x) System banner                                                   
+
*[[Buildroot_SystemConfiguration | 如何为目标单板配置系统配置参数]]
      Passwords encoding (md5)  --->                                                   
+
*[[Buildroot_Kernel |如何为目标单板安装内核镜像]]
      Init system (systemV)  --->                                                       
+
*[[Buildroot_TargetPackages | 如何安装相应的软件包到目标单板内]]
      /dev management (Dynamic using devtmpfs + mdev)  --->                             
+
*[[Buildroot_Bootloaders | 如何为目标单板安装uboot]]
  (system/device_table.txt) Path to the permission tables                               
+
*[[Buildroot_FilesystemImages | 如何为目标单板生成指定的文件系统镜像]]
  [ ] support extended attributes in device tables                                     
 
  [ ] Use symlinks to /usr for /bin, /sbin and /lib                                     
 
  [*] Enable root login with password                                                   
 
  ()    Root password                                                                   
 
      /bin/sh (bash)  --->                                                             
 
  [*] Run a getty (login prompt) after boot  --->                                       
 
  [*] remount root filesystem read-write during boot                                   
 
  (eth0) Network interface to configure through DHCP                                   
 
  [*] Purge unwanted locales                                                           
 
  (C en_US) Locales to keep                                                             
 
  ()  Generate locale data                                                             
 
  [ ] Enable Native Language Support (NLS)                                             
 
  -*- Install timezone info                                                             
 
  (default) timezone list                                                               
 
  (Etc/UTC) default local time                                                         
 
  ()  Path to the users tables                                                         
 
  (board/mini437x/rootfs-overlay) Root filesystem overlay directories                   
 
  (board/mini437x/post-build.sh) Custom scripts to run before creating filesystem images
 
  ()  Custom scripts to run inside the fakeroot environment                             
 
  (board/mini437x/post-image.sh) Custom scripts to run after creating filesystem images 
 
  ()    Extra arguments passed to custom scripts
 
==配置登陆信息==
 
  (mini437x) System hostname                                                           
 
  (Welcome to Mini437x) System banner                                                   
 
      Passwords encoding (md5)  ---> 
 
  [*] Enable root login with password                                                   
 
  ()    Root password 
 
==配置登陆串口==
 
 
 
[*] Run a getty (login prompt) after boot  --->
 
 
 
  --- Run a getty (login prompt) after boot
 
  (ttyS0) TTY port
 
        Baudrate (keep kernel default)  --->
 
  (vt100) TERM environment variable
 
  ()    other options to pass to getty
 
 
 
==其它配置==
 
  (board/mini437x/rootfs-overlay) Root filesystem overlay directories                   
 
  (board/mini437x/post-build.sh) Custom scripts to run before creating filesystem images
 
  ()  Custom scripts to run inside the fakeroot environment                             
 
  (board/mini437x/post-image.sh) Custom scripts to run after creating filesystem images
 
 
 
=配置linuxkernel=
 
Kernel  --->
 
 
 
  [*] Linux Kernel
 
        *** Linux kernel in thumb mode may be broken with binutils >= 2.29 ***
 
        Kernel version (Custom Git repository)  --->
 
  (https://git.coding.net/codebug8/mini437x_kernel.git) URL of custom repository
 
  (master) Custom repository version
 
  ()    Custom kernel patches
 
        Kernel configuration (Using an in-tree defconfig file)  --->
 
  (mini437x) Defconfig name
 
  ()    Additional configuration fragment files
 
        Kernel binary format (zImage)  --->
 
        Kernel compression format (gzip compression)  --->
 
  [*]  Build a Device Tree Blob (DTB)
 
  (am437x-sk-evm) In-tree Device Tree Source file names
 
  ()      Out-of-tree Device Tree Source file paths
 
  [*]  Install kernel image to /boot in target
 
  [ ]  Needs host OpenSSL
 
  [ ]  Needs host libelf
 
        Linux Kernel Extensions  --->
 
        Linux Kernel Tools  --->
 
 
 
=包的管理=
 
Target packages  --->
 
  -*- BusyBox
 
  (package/busybox/busybox.config) BusyBox configuration file to use?
 
  ()    Additional BusyBox configuration fragment files
 
  -*-  Show packages that are also provided by busybox
 
  [ ]  Enable SELinux support
 
  [ ]  Individual binaries
 
  [ ]  Install the watchdog daemon startup script
 
  Audio and video applications  --->
 
  Compressors and decompressors  --->
 
  Debugging, profiling and benchmark  --->
 
  Development tools  --->
 
  Filesystem and flash utilities  --->
 
  Fonts, cursors, icons, sounds and themes  --->
 
  Games  --->
 
  Graphic libraries and applications (graphic/text)  --->
 
  Hardware handling  --->
 
  Interpreter languages and scripting  --->
 
  Libraries  --->
 
  Mail  --->
 
  Miscellaneous  --->
 
  Networking applications  --->
 
  Package managers  --->
 
  Real-Time  --->
 
  Security  --->
 
  Shell and utilities  --->
 
  System tools  --->
 
  Text editors and viewers  --->
 
==手动添加自己的包==
 
参考链接
 
* https://blog.csdn.net/zhou_chenz/article/details/52335634
 
 
 
==添加蓝牙工具==
 
 
 
  [*] bluez-tools
 
  [ ] bluez-utils
 
  [*] bluez-utils 5.x
 
  [*]  build OBEX support
 
  [*]  build CLI client
 
  [*]    install deprecated tool
 
  [*]  build experimental obexd plugin
 
  [*]  build health plugin
 
  [*]  build midi profile
 
  [*]  build nfc plugin
 
  [*]  build sap plugin
 
 
 
  [*] openobex
 
 
 
==添加wifi工具==
 
> Target packages > Networking applications
 
 
 
  [*] wpa_supplicant
 
  [*]  Enable nl80211 support
 
  [*]  Enable AP mode
 
  [*]    Enable Wi-Fi Display
 
  [*]    Enable mesh networking
 
  [*]  Enable autoscan
 
  [*]  Enable EAP
 
  [*]  Enable HS20
 
  [*]  Enable syslog support
 
  [*]  Enable WPS
 
  [*]  Install wpa_cli binary
 
  [*]  Install wpa_client shared library
 
  [*]  Install wpa_passphrase binary
 
  [*]  Enable support for old DBus control interface
 
  [*]  Enable support for new DBus control interface
 
  [*]    Introspection support
 
 
 
==添加http+php工具==
 
===添加httpd工具包===
 
[*] lighttpd
 
[*]  openssl support
 
[*]  zlib support
 
[*]  bzip2 support
 
[*]  pcre support
 
[*]  webdav support
 
===添加php工具包===
 
> Target packages > Interpreter languages and scripting
 
<source lang="makefile">
 
  [*] php
 
  [*]  CGI interface
 
  [ ]  CLI interface
 
  [*]  FPM interface
 
    Extensions --->
 
[*] Readline
 
    [*] Session
 
    *** Compression extensions ***
 
    [*] zlib
 
    *** Cryptography extensions ***
 
    [ ] hash
 
    [ ] mcrypt
 
    [ ] openssl
 
    *** Database extensions ***
 
    [ ] DBA
 
    [ ] Mysqli
 
    [ ] SQLite3
 
    [ ] PDO
 
    *** Human language and character encoding support ***
 
    *** Gettext support needs NLS enabled ***
 
    [ ] iconv
 
    [ ] intl
 
    [ ] mbstring
 
    *** Image processing ***
 
    [ ] EXIF
 
    [ ] GD
 
    *** Mathematical extensions ***
 
    [ ] BC math
 
    [ ] GMP
 
    *** Other basic extensions ***
 
    [*] JSON
 
    [ ] Tokenizer
 
    *** Other services ***
 
    [ ] cURL
 
    [ ] FTP
 
    [ ] SNMP
 
    [*] sockets
 
    *** Process Control ***
 
    [ ] PCNTL
 
    [*] Posix
 
  External php extensions  --->
 
</source>
 
 
 
===配置http+php===
 
 
 
==添加Qt==
 
> Target packages > Graphic libraries and applications (graphic/text) > Qt5
 
 
 
  Qt5 version (Latest (5.9))  --->
 
        *** qt53d module needs an OpenGL-capable backend ***
 
  -*-  qt5base
 
  ()      Custom configuration options
 
  ()     Config file
 
  [ ]     Compile and install examples (with code)
 
  -*-    concurrent module
 
  [ ]    MySQL Plugin
 
  [ ]     PostgreSQL Plugin
 
          SQLite 3 support (No sqlite support)  --->
 
  -*-    gui module
 
  -*-      widgets module
 
            *** OpenGL support needs an OpenGL-capable backend ***
 
  [*]      linuxfb support
 
  [*]      directfb support
 
            *** X.org XCB backend available if X.org is enabled ***
 
            *** eglfs backend available if OpenGL and EGL are enabled ***
 
  ()        Default graphical platform
 
  [*]       fontconfig support
 
  [*]       harfbuzz support
 
  [*]      GIF support
 
  [*]      JPEG support
 
  [*]       PNG support
 
  -*-    DBus module
 
  -*-    Enable ICU support
 
  [*]     Enable Tslib support
 
        *** qt5canvas3d needs an OpenGL-capable backend ***
 
  [*]  qt5charts
 
  [*]   qt5connectivity
 
  [*]   qt5declarative
 
  [*]    quick module
 
  [*]  qt5enginio
 
        *** qt5graphicaleffects needs an OpenGL-capable backend ***
 
  [*]   qt5imageformats
 
  [*]   qt5location
 
  [*]  qt5multimedia
 
  [ ]  qt5quickcontrols
 
  [ ]   qt5quickcontrols2
 
  [ ]   qt5script
 
  [ ]  qt5scxml
 
  [ ]  qt5sensors
 
  [ ]  qt5serialbus
 
  [ ]  qt5serialport
 
  [ ]  qt5svg
 
  [ ]  qt5tools
 
  [ ]  qt5virtualkeyboard
 
        *** qt5wayland needs an OpenGL-capable backend ***
 
  [*]  qt5webchannel
 
  [*]  qt5webkit
 
  [*]  qt5webkit-examples
 
        *** qt5webengine needs udev /dev management and a glibc toolchain w/ gcc >= 4.8, host gcc >= 4.8, threads, wchar ***
 
        *** qt5webengine needs an OpenGL and EGL-capable backend ***
 
  -*-  qt5websockets
 
  -*-  qt5xmlpatterns
 
 
 
==添加can-until==
 
==添加ssh工具==
 
===选中包===
 
> Target packages > Networking applications
 
[*] openssh
 
 
 
===修改配置文件===
 
 
 
==添加mkfs格式化工具==
 
==添加自己的bin文件==
 
 
 
=编译bootloader=
 
Bootloaders  --->
 
 
 
  [ ] afboot-stm32
 
  [ ] Barebox
 
  [ ] mxs-bootlets
 
  [ ] s500-bootloader
 
  [ ] ts4800-mbrboot
 
  [*] U-Boot
 
  [ ]  CRC image for Altera SoC FPGA (mkpimage)
 
  [ ]  Environment image  ----
 
  [ ]   Generate a U-Boot boot script
 
  ()    Device Tree Source file paths
 
  [ ] X-loader
 
==u-boot编译==
 
  [*] U-Boot
 
        Build system (Kconfig)  --->
 
        U-Boot Version (Custom Git repository)  --->
 
  (https://git.coding.net/codebug8/mini437x_uboot.git) URL of custom repository
 
  (master) Custom repository version
 
  ()    Custom U-Boot patches
 
        U-Boot configuration (Using an in-tree board defconfig file)  --->
 
  (mini437x) Board defconfig
 
  ()    Additional configuration fragment files
 
  [*]  U-Boot needs dtc
 
  [ ]  U-Boot needs pylibfdt
 
  [ ]  U-Boot needs OpenSSL
 
        U-Boot binary format  --->
 
  [ ]  produce a .ift signed image (OMAP)
 
  [*]  Install U-Boot SPL binary image
 
  (MLO)  U-Boot SPL/TPL binary image name(s)
 
 
 
=系统镜像的生成=
 
  [ ] axfs root filesystem
 
  [ ] cloop root filesystem for the target device
 
  [*] cpio the root filesystem (for use as an initial RAM filesystem)
 
        Compression method (gzip)  --->
 
  [*]  Create U-Boot image of the root filesystem
 
  [ ] cramfs root filesystem
 
  [*] ext2/3/4 root filesystem
 
        ext2/3/4 variant (ext4)  --->
 
  ()    filesystem label
 
  (300M) exact size
 
  (0)  exact number of inodes (leave at 0 for auto calculation)
 
  (5)  reserved blocks percentage
 
  (-O ^64bit) additional mke2fs options
 
        Compression method (no compression)  --->
 
  [ ] initial RAM filesystem linked into linux kernel
 
  [ ] jffs2 root filesystem
 
  [ ] romfs root filesystem
 
  [ ] squashfs root filesystem
 
  [*] tar the root filesystem
 
        Compression method (gzip)  --->
 
  ()    other random options to pass to tar
 
  [ ] ubi image containing an ubifs root filesystem
 
  [ ] ubifs root filesystem
 
  [ ] yaffs2 root filesystem
 
  
 
=参考=
 
=参考=
# https://blog.csdn.net/zhou_chenz/article/category/6019071
+
* https://hceng.cn/2019/09/05/Buildroot%E7%AC%94%E8%AE%B0/#more
 
+
* https://www.cnblogs.com/kele-dad/p/8231434.html
 +
* https://blog.csdn.net/zhou_chenz/article/category/6019071
 +
* http://www.crifan.com/files/doc/docbook/buildroot_intro/release/html/buildroot_intro.html
 +
* https://buildroot.org/
 
[[Category:rootfs]]
 
[[Category:rootfs]]
 +
[[Special:RecentChanges | Special:RecentChanges]]

2020年8月26日 (三) 16:32的最新版本

buildroot简介

Buildroot是Linux平台上一个构建嵌入式Linux系统的框架。整个Buildroot是由Makefile脚本和Kconfig配置文件构成的。
你可以和编译Linux内核一样,通过buildroot配置,menuconfig修改,编译出一个完整的可以直接烧写到机器上运行的Linux系统软件(包含boot、kernel、rootfs以及rootfs中的各种库和应用程序)。
如何使用make menuconfig 请参考Menuconfig_or_how_to_configure_kernel
官网使用手册 https://buildroot.org/downloads/manual/manual.html

buildroot功能详解

目标单板架构配置。
主要是一些编译时用到的选项,比如dl的路径,下载代码包使用的路径,同时运行多个编译的上限,是否使能编译器缓冲区等等,这里按照默认就行了.
此页面主要介绍如何使用buildroot配置内部交叉编译工具链,以及外部交叉编译工具链,还有如何添加自己的交叉编译工具链!
此页主要涉及配置系统主机名,登陆欢迎信息root密码,以及构建系统镜像版本,根文件系统覆盖!
此页面主要介绍在线下载内核源码并自动编译集成到根文件系统的方法!
此页主要介绍目标开发板上使用的根文件系统所需要的软件包的添加方法,以及配置方法!
此页主要介绍buildtroot支持的音频和视频应用功能介绍以及如何配置使用
此页主要介绍buildtroot支持的压缩和解压应用简介以及如何配置使用
此页面主要介绍buildroot 调试、分析和基准测试应用的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的开发工具应用的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的文件系统和闪存实用程序的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的字体,游标,图标,声音和主题的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的游戏 以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的图形库和应用程序(图形/文本)的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的硬件处理应用/工具的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的编程语言和脚本的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的库的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的邮箱应用的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的一些杂项应用的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的网络应用程序的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的 包管理 应用的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的 实时时钟 的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的 实时时钟 的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的 Shell和程序 的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的 系统工具 的简介以及如何配置使用。
此页面主要介绍buildroot支持在目标系统上的 文版编辑和浏览工具 的简介以及如何配置使用。
此页介绍如何使用buildroot自动根据系统分区生成相应的系统镜像!
此页主要介绍在线下载u-boot源码,编译并生成相应的镜像文件到指定位置!

目录结构

  • buildroot/package/:下面放着应用软件的配置文件,每个应用软件的配置文件有Config.insoft_name.mk,其中soft_name.mk(这种其实就Makefile脚本的自动构建脚本)文件可以去下载应用软件的包。
  • buildroot/output/:是编译出来的输出文件夹,里面的build/目录存放着解压后的各种软件包编译完后的现场。
    • build:所有源码包解压出来的文件存放地和编译的发生地
    • staging:软链接到 host/<tuple>/sysroot 就是上面说到的文件系统需要的库等目录,方便查看
    • target: 目录是用来制作rootfs的,里面放着Linux系统基本的目录结构,以及各种编译好的应用库和bin可执行文件。不能用来nfs mount到开发板,因为buildroot不是root权权运行的,所以现dev/,etc/等一些文件无法创建,所以目录还不完整,要用images/里的rootfs.tar解压出来的根文件目录才能mount.使用如下命令:sudo tar -C /destination/of/extraction -xf images/rootfs.tar
    • Images:目录下就是最终生成的可烧写到板子上的各种image。
    • host:是由各类源码编译后在你主机上运行的工具(build for host)的安装目录,如arm-linux-gcc就是安装在这里;编译出来的主机工具在host/usr下;根目录所需要的库及一些基本目录就在host/<tuple>/sysroot/host/usr/<tuple>/sysroot/里 (<tuple>:arm-buildroot-linux-gnueabi),如果是外部toolchain,比如lirano的就在libc里,名字不一样而已
  • buildroot/dl:存放下载的源码包及应用软件的压缩包
  • buildroot/fs:放各种文件系统的源代码
  • buildroot/fs/skeleton:放生成文件系统镜像的地方,及板子里面的系统
  • buildroot/linux:存放着Linux kernel的自动构建脚本。
  • buildroot/configs:放置开发板的一些配置参数
  • buildroot/dl:目录存放从官网上下载的开源软件包,第一次下载后,下次就不会再去从官网下载了,而是从dl/目录下拿开源包,以节约时间。本身下载通常都是很慢的,你可以手动找到相关包下载后放到这里就OK了,make时会自动检测这个目录.
  • buildroot/docs:存放相关的参考文档。
  • buildroot/arch:目录存放CPU架构相关的配置脚本,如arm/mips/x86 ,这些CPU相关的配置,在制作工具链,编译boot和内核时很关键。
  • buildroot/board:存放了一些默认开发板的配置补丁之类的
  • buildroot/boot:
  • buildroot/build:
  • buildroot/support:
  • buildroot/system:这里就是根目录的主要骨架了和相关的启动初始化配置,当制作根目录时就是将此处的文件cp到output里去.然后再安装toolchain的动态库和你勾选的package的可执行文件之类的.
  • buildroot/toolchain:

buidroot常用命令

Linux内核操作的常用命令

  • buildroot下单独编译内核
book@100ask:~/Buildroot$ make  linux-rebuild
  • 运行内核make menuconfig配置选项界面
 book@100ask:~/Buildroot$ make linux-menuconfig   
  • 保存内核最新的配置文件
 book@100ask:~/Buildroot$ make linux-savedefconfig   
  • 更新内核配置文件
 book@100ask:~/Buildroot$ make linux-update-defconfig

其它常用操作

  • buildroot下编译生成sdk
book@100ask:~/Buildroot$ make sdk
  • buildroot下编译时显示详细信息
book@100ask:~/Buildroot$ make V=1 <pkg>
  • buildroot下编译时显示详细信息
book@100ask:~/Buildroot$ make V=1 <pkg>
  • buildroot下单独编译u-boot
book@100ask:~/Buildroot$ make uboot-rebuild
  • buildroot下单独编译某个软件包
book@100ask:~/Buildroot$ make <pkg>-rebuild