构建根文件系统之瑞士军刀BusyBox
来源:互联网 发布:干支纪年法简便算法 编辑:程序博客网 时间:2024/05/29 21:30
BusyBox是最常用的定制根文件系统的方法,它能够迅速建立一套相对完整、功能丰富的文件系统,其中包括大量常用的用程序。Busybox再设计上充分考虑到了硬件的资源受限的特殊工作环境,采用了将所有的命令通过软连接的方法指向自己的方法来减自己的体积。
1. 准备环境
1.1 下载BusyBox源码
链接: https://busybox.net/downloads/
1.2 建立工程目录
root@chy-pc:/opt# tree ./arm/
./arm/
├── busybox-1.26.2.tar.bz2
└── rootfs
./arm/
├── busybox-1.26.2.tar.bz2
└── rootfs
2 编译BusyBox
2.1 BusyBox解压到/opt/arm/
root@chy-pc:/opt/arm# tar -jxvf ./busybox-1.26.2.tar.bz2
2.2 修改Makefile
root@chy-pc:/opt/arm/busybox-1.26.2# vim ./Makefile
查找到
CROSS_COMPILE ?=
修改为
CROSS_COMPILE ?= arm-linux-
查找到ARCH ?=
修改为
ARCH ?= arm
2.3 配置BusyBox
root@chy-pc:/opt/arm/busybox-1.26.2# make menuconfig
Busybox Settings --->
是否使用静态C库:
Build BusyBox as a static binary (no shared libs) (NEW)
使用软连接还是硬链接:
What kind of applet links to install (as soft-links) --->
安装路径:
(/opt/arm/rootfs) BusyBox installation prefix
2.4 安装BusyBox
root@chy-pc:/opt/arm/busybox-1.26.2# make
root@chy-pc:/opt/arm/busybox-1.26.2# make install
3. 可能遇到的问题
(1) 当出现miscutils/nandwrite.c: In function 'nandwrite_main': 问题时,复制 /usr/include/mtd/mtd-abi.h 到busybox下的include目录下。并在nandwrite.c文件中添加"mtd-abi.h"头文件。
(2) 当出现util-linux/blkdiscard.c: In function 'blkdiscard_main':问题时,复制 /usr/include/linux/fs.h 到busybox下的include目录下。并在blkdiscard.c文件中添加"fs.h"头文件。
(3) 链接时出现错误
debianutils/lib.a(mktemp.o): In function `mktemp_main':mktemp.c:(.text.mktemp_main+0x98): warning: the use of `mktemp' is dangerous, better use `mkstemp'coreutils/lib.a(sync.o): In function `sync_main':sync.c:(.text.sync_main+0x7c): undefined reference to `syncfs'collect2: ld returned 1 exit statusNote: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.Example: CONFIG_EXTRA_LDLIBS="pthread dl tirpc audit pam"Makefile:717: recipe for target 'busybox_unstripped' failedmake: *** [busybox_unstripped] Error 1去掉Coreutils ---> sync
去掉Linux System Utilities ---> nsenter
0 0
- 构建根文件系统之瑞士军刀BusyBox
- 根文件系统的构建与分析(四)之瑞士军刀busybox生成系统基本命令
- 根文件系统的构建与分析(四)之瑞士军刀busybox生成系统基本命令
- Linux中的“瑞士军刀”--busybox制作根文件系统
- busybox构建根文件系统
- 用busybox构建根文件系统
- 使用busybox构建根文件系统
- 用busybox构建根文件系统
- 使用BusyBox构建根文件系统
- JZ2440:busybox构建根文件系统
- linux根文件系统制作之busybox编译和系统构建
- 使用busybox构建yaffs2根文件系统(前言)
- 移植Busybox与构建Linux根文件系统
- 移植Busybox与构建根文件系统
- 使用busybox构建linux根文件系统
- 如何利用busybox构建根文件系统
- 构建根文件系统-busybox的编译
- 使用busybox构建linux根文件系统
- sscanf函数
- git常用命令
- leetcode_3_Longest_Substring_Without_Repeating_Characters
- 网站可靠性工程 SRE
- tensorflow实现CNN
- 构建根文件系统之瑞士军刀BusyBox
- 深入理解C++中public、protected及private用法
- HTTP请求报文和HTTP响应报文
- 使用Python3获取360影视首页上电影的名称,年份,评价,播放链接并保存为txt文本
- AndroidAOP之路二 注解处理解释器
- CTF-实验吧-Flash14
- 《程序是怎样跑起来的》读书笔记
- 玲珑杯round#11 ----A
- java安全架构____证书类型转换