嵌入式产品:build root制作系统

Buildroot是一个简单,高效且易于使用的工具,可通过交叉编译来生成嵌入式Linux系统,由Makefile脚本和Kconfig配置文件构成。快速变成编译cross-compilation toolchain、bootloader、kernel、rootfs、第三方库。

链接

Rockchip原厂Buildroot项目: https://github.com/rockchip-linux/buildroot
Buildroot官网: https://buildroot.org

下载编译

1. wget https://buildroot.org/downloads/buildroot-2020.02.1.tar.gz
2. tar zxvf buildroot-2020.02.1.tar.gz
3. cd buildroot-2020.02.1
4. make list-defconfigs  # 查看当前可用配置
5. make menuconfig
6. Target options ---> 选择目标平台为AArch64
7. sudo make  # 需要root权限,并且需要联网(从官网下载)
8. 在output/images生成kernel, bootloader, root filesystem

具体配置

1. 目标平台target options
架构:AArch64
二进制格式:ELF
小端存储:little endian (大端:big endian)
交叉工具:支持eabihf
浮点数处理:VFP-v4
精简指令集:Thumb2
CPU:Cortex-A5
2. Build options:配置存放路径(不用配置)
C library: C库选择glibc/eglibc
Kernel Headers: 内核头文件
glibc version: glibc版本选择
GCC compiler Version:GCC版本选择
Enable C++ support: 使能C++支持
Build cross gdb for the host: 主机上运行gdb进行调试
3. 交叉编译工具toolchain
生成编译器:根据系统架构自动生成
外部编译器:External toolchain,使用已经安装好的编译器
4. 系统配置System configuration
system hostname:开发板的名称
system banner:欢迎语
Init system中:初始化系统 BusyBox
/dev management:设备管理 Dynamic using mdev(使用mdev动态加载设备节点的方式)
Path to thepermission tables:设备节点的配置表 system/device_table_dev.txt (即在/dev生成目录,可以修改这个文件生成需要的设备节点)
Root password:进入linux控制台终端后的密码,为空则登录时不需要密码,默认登录用户名为root。
Run agetty(login prompt)after boot:自动运行终端
Remount root filesystem read-write during boot:动态的挂载文件系统
5. 终端getty options
TTY port:调试串口
6. 内核kernel
Kernel version:版本
Kernel configuration: 内核配置文件
Kernel binary format: 内核二进制文件格式,uImage
Kernel compression format:内核压缩格式,gzip
Build a Device Tree Blob:设备树
7. 根文件系统Filesystem images
ext2/3/4 root filesystem: ext4
tar the root filesystem: 打包
Filesystem images:文件系统选择
8. 第三方开源工具包target packages
添加需要的系统工具:g++/git/alsa等
9. Bootloaders:引导程序U-boot
Build system: Kconfig
U-boot Version: U-boot版本
Board defconfig: 板子的配置,选择默认文件
U-boot needs dtc:设备树,默认,后期调试
U-boot needs OpenSSL: 是OpenSSL
U-boot binary format: 二进制文件,选择 .bin文件
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章