嵌入式產品: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文件
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章