环境:ubuntu 16.04
芯片:rk3288
系统:linux + buildroot
下载 buildroot 源码
注:此文章采用 Latest long term support release: 2018.02.5 版本
在 buildroot 根目录下,执行如下命令,进行配置buildroot
$ make menuconfig
Target options ---> # 芯片构架的相关配置
Build options ---> # buildroot 编译过程中的相关配置
Toolchain ---> # 交叉工具链的相关配置
System configuration ---> # rootfs 的相关配置
Kernel --->
Target packages ---> # rootfs 第三方软件包
Filesystem images ---> # rootfs 镜像格式
Bootloaders --->
Host utilities ---> # buildroot编译时,主机需要的工具集
Legacy config options --->
- Target options ---> # 芯片构架的相关配置
Target Architecture (ARM (little endian)) ---> # 小端
Target Binary Format (ELF) --->
Target Architecture Variant (cortex-A17) ---> # cortex-A17
Target ABI (EABIhf) ---> # 存在FPU
Floating point strategy (VFPv4) ---> # VFPv4-D32
ARM instruction set (ARM) ---> # ARM
- Build options ---> # buildroot 编译过程中的相关配置
(configs/rk3288_defconfig) Location to save buildroot con # 指定 rk3288_defconfig 的存放位置
($(TOPDIR)/dl) Download dir # 指定下载的软件源码包的存放位置
($(BASE_DIR)/host) Host dir
Mirrors and Download locations ---> # 指定下载的软件源码包的网址
- Toolchain ---> # 交叉工具链的相关配置
Toolchain type (Buildroot toolchain) ---> # 由 buildroot 下载编译交叉工具链
(rk3288) custom toolchain vendor name # 指定此交叉工具链的厂商,如xxx 对应 arm-xxx-linux-gnueabihf
C library (glibc) ---> # 采用 glibc 库
Kernel Headers (Linux 4.4.x kernel headers) ---> # 与 linux内核版本 对应
Binutils Version (binutils 2.29.1) ---> # binutils 版本
GCC compiler Version (gcc 6.x) ---> # arm-linux-gcc 版本
- System configuration ---> # rootfs 的相关配置
Root FS skeleton (default target skeleton) ---> # rootfs 目录架构
(rk3288) System hostname # rootfs 主机名字
(Welcome to rk3288) System banner # rootfs 登陆时的欢迎标题
Init system (BusyBox) ---> # rootfs 初始化系统为 BusyBox 或 systemv 或 systemd
- Filesystem images ---> # rootfs 镜像格式
[*] ext2/3/4 root filesystem # rootfs 镜像格式为 ext2/3/4
ext2/3/4 variant (ext4) ---> # ext4
(60M) exact size # rootfs 镜像大小
在 buildroot 根目录下,执行如下命令,进行编译buildroot
# make
生成的rootfs.ext4镜像 在 output/images 目录中
$ ls output/images/
rootfs.ext2 # rootfs.ext2 为ext4格式
rootfs.ext4 # rootfs.ext4是rootfs.ext2的软链接
$ file output/images/rootfs.ext2
output/images/rootfs.ext2: Linux rev 1.0 ext4 filesystem data, UUID=7e2cbd2e-4445-4237-976a-d605bb699c83
$ ls output/images/ -l
rootfs.ext4 -> rootfs.ext2
保存 buildroot 配置文件
$ make savedefconfig # 配置文件保存在 configs/rk3288_defconfig
加载 buildroot 配置文件
$ make rk3288_defconfig