busybox1.20.2编译过程

ubuntu 16.10

arm-2014.05-29-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

busybox: 1.20.2

设置路径: export PATH="/arm-none-linux-gnueabi/arm-2014.05/bin:$PATH"

查看结果: arm-none-linux-gnueabi-gcc -v


显示:Using built-in specs.

COLLECT_GCC=arm-none-linux-gnueabi-gcc

COLLECT_LTO_WRAPPER=/arm-none-linux-gnueabi/arm-2014.05/bin/../libexec/gcc/arm-none-linux-gnueabi/4.8.3/lto-wrapper

Target: arm-none-linux-gnueabi

Configured with: /scratch/maciej/arm-linux-2014.05-rel/src/gcc-4.8-2014.05/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-linux-gnueabi --enable-threads --disable-libmudflap --disable-libssp --disable-libstdcxx-pch --enable-extra-sgxxlite-multilibs --with-arch=armv5te --with-gnu-as --with-gnu-ld --with-specs='%{save-temps: -fverbose-asm} %{funwind-tables|fno-unwind-tables|mabi=*|ffreestanding|nostdlib:;:-funwind-tables} -D__CS_SOURCERYGXX_MAJ__=2014 -D__CS_SOURCERYGXX_MIN__=5 -D__CS_SOURCERYGXX_REV__=29' --enable-languages=c,c++ --enable-shared --enable-lto --enable-symvers=gnu --enable-__cxa_atexit --with-pkgversion='Sourcery CodeBench Lite 2014.05-29' --with-bugurl=https://sourcery.mentor.com/GNUToolchain/ --disable-nls --prefix=/opt/codesourcery --with-sysroot=/opt/codesourcery/arm-none-linux-gnueabi/libc --with-build-sysroot=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/libc --with-gmp=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpfr=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-mpc=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-isl=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --with-cloog=/scratch/maciej/arm-linux-2014.05-rel/obj/pkg-2014.05-29-arm-none-linux-gnueabi/arm-2014.05-29-arm-none-linux-gnueabi.extras/host-libs-i686-pc-linux-gnu/usr --disable-libgomp --disable-libitm --enable-libatomic --disable-libssp --enable-poison-system-directories --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin --with-build-time-tools=/scratch/maciej/arm-linux-2014.05-rel/install/opt/codesourcery/arm-none-linux-gnueabi/bin SED=sed

Thread model: posix

gcc version 4.8.3 20140320 (prerelease) (Sourcery CodeBench Lite 2014.05-29)


开始编译 busybox

  1. make clean

  2. make menuconfig

\* Build BusyBox as a static binary (no shared libs) 选上,不用再去拷运行库

  1. make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

编译出错:

loginutils/passwd.c: In function 'passwd_main':

loginutils/passwd.c:104:16: error: storage size of 'rlimit_fsize' isn't known

struct rlimit rlimit_fsize;

^

loginutils/passwd.c:188:2: warning: implicit declaration of function 'setrlimit' -Wimplicit-function-declaration

setrlimit(RLIMIT_FSIZE, &rlimit_fsize);

^

loginutils/passwd.c:188:12: error: 'RLIMIT_FSIZE' undeclared (first use in this function)

setrlimit(RLIMIT_FSIZE, &rlimit_fsize);

^

loginutils/passwd.c:188:12: note: each undeclared identifier is reported only once for each function it appears in

loginutils/passwd.c:104:16: warning: unused variable 'rlimit_fsize' -Wunused-variable

struct rlimit rlimit_fsize;

^

scripts/Makefile.build:197: recipe for target 'loginutils/passwd.o' failed

make1: *** loginutils/passwd.o Error 1

Makefile:740: recipe for target 'loginutils' failed

make: *** loginutils Error 2

网上查找原因是busybox版本造成,换版本:busybox-1.21.0

再次编译

  1. make clean

  2. make menuconfig

\* Build BusyBox as a static binary (no shared libs) 选上,不用再去拷运行库

  1. make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

显示:

Trying libraries: crypt m

Library crypt is not needed, excluding it

Library m is needed, can't exclude it (yet)

Final link with: m

DOC busybox.pod

DOC BusyBox.txt

DOC busybox.1

DOC BusyBox.html

  1. sudo mkdir rootsf

sudo chmod 777 rootsf/

make CONFIG_PREFIX=/qemu_tes/busybox/rootsf/ install 安装到指定位置

查看:ls rootsf/

显示:bin linuxrc sbin usr

  1. cd rootsf/

sudo mkdir proc sys dev etc etc

将busybox/busybox-1.21.0/examples/bootfloppy/etc下的所有文件拷到rootfs/etc下

sudo cp -a /qemu_tes/busybox/busybox-1.21.0/examples/bootfloppy/etc/* etc/

相关推荐
承渊政道2 小时前
PostgreSQL 鸿蒙 PC 适配全记录:从原生交叉编译到 HNP 数据库服务闭环
数据库·postgresql·harmonyos·鸿蒙系统·pc端
风哥2号2 小时前
数据库教程FGMT26‑2-GoldenGate数据库容灾迁移02(OGG同构异构、数据库迁移、数据同步、容灾复制)
数据库·goldengate
牛油果子哥q3 小时前
向量数据库原理与工程选型:FAISS深度剖析、Milvus基础、检索优化、分片与持久化落地
数据库·milvus·faiss
海浪仙人掌3 小时前
流动比率有哪些分析陷阱?流动比率怎么避开这些陷阱?
大数据·数据库·人工智能
庆登登登3 小时前
MySQL Workbench 鸿蒙 PC 适配全记录:从 GTK_X11 桌面程序到 ArkUI 原生数据库工作台
数据库·mysql·harmonyos
2601_963282773 小时前
政企无线对讲系统落地:从设备采购到长期运维的完整工程实践
大数据·运维·数据库
熊文豪3 小时前
OceanBaseVS金仓:一条 SQL 的两条路——KingbaseES 的性能竞争力从哪来
数据库·sql·电科金仓
大模型码小白4 小时前
数据可视化:AI 生成 HTML5 动态交互式数据图表
前端·数据库·人工智能·深度学习·机器学习·信息可视化·html5
风哥2号4 小时前
数据库教程FGMT26‑1‑GoldenGate数据库容灾迁移01(OGG同构异构、数据库迁移、数据同步、容灾复制)
数据库·oracle
颜颜yan_4 小时前
Firebird 鸿蒙 PC 适配全记录:打通数据库内核、Qt 管理端与原生维护工具
数据库·qt·harmonyos