编译BusyBox12.0

 编译BusyBox使用的环境 交叉编译器4.4.6 

第一步:获取BusyBox的源码并解压:

  https://busybox.net/downloads/在这个网站上面下载所需要的BusyBox版本,我用的是1.12版本的,然后使用tar xvfj busy-1.12.0.tar.bz2 -C /xxxx解压到指定目录。

第二步:修改并配置BusyBox:

  进入源码后,修改Makefile文件第164行CROSS_COMPILE = arm-linux-

        修改Makefile文件第189或190行ARCH = arm

  然后输入make menuconfig配置菜单(如果出现错误,那就sudo make menuconfig)

  配置菜单可以按照默认的,也可以按照天嵌教材集当中的进行配置

  以下是在配置过程中几个重要的点

  Busybox Settings  ---> Build Options  --->

  修改交叉编译[*] Build with Large File Support (for accessing files > 2 GB)

          (arm-linux-) Cross Compiler prefix

  Busybox Settings  --->Installation Options ("make install" behavior)  --->

  修改BusyBox编译出来后存放的路径 What kind of applet links to install (as soft-links) ---> 

                   (../rootfs_Tq210_fs) BusyBox installation prefix

第三步:编译并安装BusyBox:

  执行命令make(有些需要sudo make)进行编译,执行命令make install (有些需要sudo make install)进行安装。

注意:1.对于编译不过去的情况,可能是不同的编译器对源码的解释情况不一致,最好编译时用同一种编译器。

   2.在编译过程中,如果make后出现了交叉编译问题,即交叉编译未找到的问题,可以修改自己的环境变量,在/etv/profile中增加交叉编译器的路径,并执行source /etc/profile使编译器生效。如果问题依旧存在,那么在Makefile文件当中,修改Makefile文件第164行CROSS_COMPILE = /自己交叉编译器的绝对路径(比如我的是/opt/EmbedSky/4.4.6/bin/arm-linux-)

原文地址:https://www.cnblogs.com/lucky-3/p/10244900.html