busybox linux-2.6.2 编译安装中碰到的若干问题

Q1   /busybox-1.18.4/scripts/gcc-version.sh: line 11: arm-linux-gcc: command not found

1.问题:/home/ubuntu-mm/HardWare/S3C2440_Board/Linux_uImage/busybox-1.18.4/scripts/gcc-version.sh: line 11: arm-linux-gcc: command not found

2.解决方法:修改Makefile文件

进入busybox目录

vim  Makefile

将ARCH  ?= $(SUBARCH) 修改为

ARCH   ?= arm

将CROSS_COMPILE ?=   修改为

CROSS_COMPILE ?= arm-linux-

(这里一定要注意的是arm和arm-linux-后面不能有空格,在编译内核源代码的时候也一定要注意这个问题)

3. 执行source /etc/profile使编译器生效

4. make menuconfig配置busybox选项:

a.进入 Busybox Settings à

build Options->

选中 “Build busybox as a static binary”, 静态链接
   Cross Compiler prefix (arm-linux-)
   Installation Options->
   Busybox Installation Prefix (/xxx/rootfs)

该选项表明编译后的busybox的安装位置

5.最重要的问题:

一定要用root权限来做busybox和linux kernel的编译,也就是说在你开发编译这些文件之前,首先的事情是su

su

passwd:

root@ubuntu:/home/ubuntu-mm/HardWare/S3C2440_Board/Linux_uImage/busybox-1.18.4# make CONFIG_PREFIX=/home/ubuntu-mm/HardWare/S3C2440_Board/Linux_uImage/RootFileSys/rootfs install

这样进入到root权限之后就没啥问题了!

Q2 linux-2.6.22.6/Makefile:416: *** mixed implicit and normal rules: deprecated syntax

后面我在Ubuntu Kylin版本下安装 交叉编译环境arm-linux-gcc 安装了libncourses*等内核编译的库 安装了cmake&make

结果在我编译内核文件和busybox都出现了同样的错误:

linux-2.6.22.6/Makefile:416: *** mixed implicit and normal rules: deprecated syntax

linux-2.6.22.6/Makefile:1449: *** mixed implicit and normal rules: deprecated syntax 翻译为中文:混合的和隐含普通规则(下图不是我的,只是拿来表示状态)

看完博客之后发现可以这样解决:

1在makefile中将416行代码(不同的版本有所差异,不够都在附近)

  1. config %config: scripts_basic outputmakefile FORCE
改为
  1. %config: scripts_basic outputmakefile FORCE
2在makefile中将1449行代码(不同的版本有所差异,不够都在附近)
  1. / %/: prepare scripts FORCE
改为
  1. %/: prepare scripts FORCE

Q3 libstdc++.so.6: cannot open shared object file

改完上面的Q1Q2之后我的编译还是不能通过,告诉我说缺少了lib32stdc++的库,错误如下:

 error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory 。好吧那我安装总该可以了吧:

sudo apt-get install lib32stdc++6

安装完之后再make就解决了我的问题!!

sudo apt-get install libncurses5-dev

 

交叉编译器区别和概念:

https://www.cnblogs.com/xiaotlili/p/3306100.html

busybox编译错误:

https://www.cnblogs.com/softhal/p/5769121.html

根文件系统制作:

https://blog.csdn.net/qq_16777851/article/details/82056774

ramdisk只读文件系统制作:

https://www.cnblogs.com/electronic/p/11146614.html

posted @ 2017-03-27 15:42  小淼博客  阅读(2879)  评论(0编辑  收藏  举报

大家转载请注明出处!谢谢! 在这里要感谢GISPALAB实验室的各位老师和学长学姐的帮助!谢谢~