使用Buildroot构建文件系统

简介

        Buildroot是Linux平台上一个构建嵌入式Linux系统的框架。整个Buildroot是由Makefile脚本和Kconfig配置文件构成的。你可以和编译Linux内核一样,通过buildroot配置,menuconfig修改,编译出一个完整的可以直接烧写到机器上运行的Linux系统软件(包含boot、kernel、rootfs以及rootfs中的各种库和应用程序)。
发行版:http://buildroot.net/downloads/
历史版本:http://buildroot.net/downloads/snapshots/
对于buildroot与yocto的差异可移步:Buildroot vs OpenEmbedded or Yocto Project。

开发环境介绍

  • 主机操作系统:Ubuntu14.04 64位
  • 目标平台:全志A40I
  • buildroot工具版本:buildroot-2016.11
  • 编译时间:2019.06.02

构建rootfs

        要构建自己的开发板,首先要创建一个基本的 buildroot配置作为开发板的基本编译系统。这里包括toolchain,kernel,bootloader,filesystem 和一个简单的 busy-box 用户空间。不要选择特别的配置,这个配置必须要足够小,并仅仅作为目标平台一个基本的 BusyBox 系统。

执行make menuconfig

  • Target options:目标板的配置

    • Target Architecture:目标架构,这里选择 ARM(little endian),ARM小端模式
    • Target Binary Format:二进制格式,为 ELF
    • Target Architecture Variant:架构体为 cortex-A7,内核类型
    • Target ABI:应用程序二进制接口,为EABI
    • Floating point strategy:浮点数的策略,选择为 VFPv4-D16
    • ARM instruction set:arm 汇编指令集,选择 ARM
  • Build options:主要是一些编译时用到的选项,比如dl的路径,下载代码包使用的路径,同时运行多个编译的上限,是否使能编译器缓冲区等等,这里按照默认就行了.

  • Toolchain:工具链选项

    • Toolchain type:Buildroot提供两种方式使用toolchain
      • external toolthain:非Buildroot提供的交叉编译器,这里使用外部,选择此项
      • Buildroot toolchain:Buildroot本身编译生成的Buildroot toolchain
    • Enable MMU support:使能 MMU,A40I支持MMU,选上
  • System configuration:系统配置

    • Root FS skeleton:
    • System hostname:填写A40I
    • Init system:系统初始化,选择 BusyBox
    • /dev management:设备文件管理,选择Dynamic using devtmpfs + eudev,即使用udev动态加载设备节点的方式
    • Path to the permission tables:设备节点的配置表设置,一定要选择system/device_table_dev.txt,否则后面在dev目录下将不会生成各种设备节点。当然我们也可以手动的配置该文件,添加必要的节点或删除不需要的节点。
    • Enable root login with password:允许终端登陆使用密码
    • Root password:进入linux控制台终端后的密码,为空则登录时不需要密码,默认登录用户名为root。
    • /bin/sh (busybox' default shell)
    • Run a getty (login prompt) after boot:保持默认,默认为选中。
      • TTY port:配置为 ttyS0
      • Baudrate :波特率,配置为 115200
      • TERM environment variable:默认即可
      • other options to pass to getty:默认即可
    • remount root filesystem read-write during boot:可进行动态挂载
  • Kernel:内核配置
        这里内核不参与到buildroot的管理中;

  • Target packages:包管理;文件系统通常要包含很多第三方软件,通过该配置,自动从指定的服务器上下载源码包,自动编译,自动搭建;

    • [*] Show packages that are also provided by busybox
    • Debugging, profiling and benchmark ;这里有非常实用的调试、分析测试工具,如gdb/stress/iperf3...不过这里构建的为发行版文件系统,因此去掉;
    • Filesystem and flash utilities:文件系统和闪存工具,
      • [*] dosfstools
      • [*] mkfs.fat 格式化工具
    • Fonts, cursors, icons, sounds and themes
      • DejaVu fonts
      • mono fonts
      • sans fonts
    • Hardware handling (也包含一些工具,如evtest/hdparm/memtester/minicom)
      • dbus
      • dbus-c++
      • dbus-glib
    • Graphic libraries and applications (graphic/text) --->
      • [*] sdl2 (使用QT做图形界面,需要的)
    • Libraries
      • Crypto --->
        [*] libgcrypt

        [*] openssl

      • Graphics --->

        • [*] fontconfig (QT 显示文字信息时还需要与字体相关的东西)
      • Hardware handling --->
        [*] libinput (使用QT做图形界面,需要的)

    • Networking applications
      • [*] dhcp (ISC)
      • [*] dhcp server
      • [*] Enable delayed ACK feature
      • [*] iptables
      • [*] iw
      • [*] wpa_supplicant
      • [*] Enable nl80211 support
      • [*] Enable AP mode
      • [*] Enable Wi-Fi Display
      • [*] Enable autoscan
      • [*] Enable EAP
      • [*] Enable syslog support
      • [*] Enable WPS
      • [*] Install wpa_cli binary
      • [*] Install wpa_passphrase binary
    • System tools
      • [*] cpuload
      • [*] htop
    • Additional tools(Lichee)
      • [*] fsck msdos
  • Filesystem images:文件系统选择,选择ext4

    • [*] ext2/3/4 root filesystem
      • ext2/3/4 variant (ext4) --->
  • Bootloaders:
       硬件启动程序,这里不添加到管理

  • Host utilities:

  • Legacy config options:

保存:
cp .config configs/sun8iw11p1_defconfig

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值