Busybox编译安装「建议收藏」

发布时间:2025-12-09 12:00:25 浏览次数:16

Busybox

1 Busybox介绍

Busybox 最初是由 Bruce Perens 在 1996 年为 Debian GNU/Linux 安装盘编写的。其目标是在一张软盘(存储空间只有1MB多)上创建一个GNU/Linux 系统,可以用作安装盘和急救盘

Busybox 是一个开源项目,遵循GPL v2协议。Busybox将众多的UNIX命令集合进一个很小的可执行程序中,可以用来替代GNU fileutils、shellutils 等工具集。Busybox中各种命令与相应的GNU工具相比,所能提供的选项比较少,但是也足够一般的应用了。Busybox主要用于嵌入式系统

Busybox 是一个集成了三百多个最常用Linux命令和工具的软件。BusyBox 包含了一些简单的工具,例如ls、cat和echo等等,还包含了一些更大、更复杂的工具,例grep、find、mount以及telnet。有些人将 BusyBox 称为 Linux 工具里的瑞士军刀。简单的说BusyBox就好像是个大工具箱,它集成压缩了Linux 的许多工具和命令,也包含了 Android 系统的自带的shell

定制小型的Linux操作系统:linux内核+busybox

官方网站:https://busybox.net/

2 Busybox使用

busybox 的编译过程与Linux内核的编译类似

busybox的使用有三种方式:

  • busybox后直接跟命令,如 busybox ls
  • 直接将busybox重命名,如 cp busybox tar
  • 创建符号链接,如 ln -s busybox rm

busybox的安装

3 busybox编译安装

[root@centos7 ~]#yum -y install gcc gcc-c++ glibc glibc-devel make pcre pcredevel openssl openssl-devel systemd-devel zlib-devel glibc-static ncurses-devel[root@centos7 ~]#wget https://busybox.net/downloads/busybox-1.31.1.tar.bz2[root@centos7 ~]#tar xvf busybox-1.31.1.tar.bz2 [root@centos7 ~]#cd busybox-1.31.1/[root@centos7 busybox-1.31.1]#make menuconfig #按下面选择,把busybox编译也静态二进制、不用共享库:Settings -->Build Options -->[*] Build static binary (no shared libs)[root@centos7 busybox-1.31.1]#make #如果出错,执行make clean后,重新执行上面命令[root@centos7 busybox-1.31.1]#ls [root@centos7 busybox-1.31.1]#make install [root@centos7 busybox-1.31.1]#pwd/root/busybox-1.31.1[root@Centos7 busybox-1.31.1]#lsapplets                 debianutils  loginutils              qemu_multiarch_testingapplets_sh              docs         mailutils               READMEarch                    e2fsprogs    Makefile                runitarchival                editors      Makefile.custom         scriptsAUTHORS                 examples     Makefile.flags          selinuxbusybox                 findutils    Makefile.help           shellbusybox.links           include      make_single_applets.sh  size_single_applets.shbusybox_unstripped      init         miscutils               sysklogdbusybox_unstripped.map  _install     modutils                testsuitebusybox_unstripped.out  INSTALL      networking              TODOConfig.in               klibc-utils  NOFORK_NOEXEC.lst       TODO_unicodeconfigs                 libbb        NOFORK_NOEXEC.sh        util-linuxconsole-tools           libpwdgrp    printutilscoreutils               LICENSE      procps[root@Centos7 busybox-1.31.1]#ll busybox -h-rwxr-xr-x 1 root root 2.6M May 14 09:35 busybox[root@Centos7 busybox-1.31.1]#ls _install/bin  linuxrc  sbin  usr[root@Centos7 busybox-1.31.1]#ls _install/binarch     cttyhack       fdflush   kbd_mode  mknod       ping           run-parts     tarash      date           fgrep     kill      mktemp      ping6          scriptreplay  touchbase64   dd             fsync     link      more        pipe_progress  sed           truebusybox  df             getopt    linux32   mount       printenv       setarch       umountcat      dmesg          grep      linux64   mountpoint  ps             setpriv       unamechattr   dnsdomainname  gunzip    ln        mpstat      pwd            setserial     usleepchgrp    dumpkmap       gzip      login     mt          reformime      sh            vichmod    echo           hostname  ls        mv          resume         sleep         watchchown    ed             hush      lsattr    netstat     rev            stat          zcatconspy   egrep          ionice    lzop      nice        rm             sttycp       false          iostat    makemime  nuke        rmdir          sucpio     fatattr        ipcalc    mkdir     pidof       rpm            sync[root@Centos7 busybox-1.31.1]#find _install/ -type l |wc -l396[root@Centos7 busybox-1.31.1]#du -sh _install/2.6M_install/[root@Centos7 busybox-1.31.1]#mkdir /mnt/sysroot/[root@Centos7 busybox-1.31.1]#cp -a _install/* /mnt/sysroot/

159989.html

busybox安装
需要做网站?需要网络推广?欢迎咨询客户经理 13272073477