[计算机]busybox配置.doc_第1页
[计算机]busybox配置.doc_第2页
[计算机]busybox配置.doc_第3页
[计算机]busybox配置.doc_第4页
[计算机]busybox配置.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

面是对1.00版本的实验。1、文件准备解压busybox-1.00.tar.gz得到busybox-1.00目录,进入,阅读相关的README和INSTALL,没什么特别的,都是提示busybox需要经过三个步骤的操作进行安装使用。2、配置busyboxbusybox的配置程序和linux内核菜单配置方式简直一模一样#make menuconfig下面是需要编译进busybox的功能选项,其他的可以根据需要自选,但是同样不要太贪心.General Configuration应该选的选项Show verbose applet usage messagesSupport for SUID/SGID handling Runtime SUID/SGID configuration via /etc/busybox.conf Build OptionsBuild BusyBox as a static binary (no shared libs)这个选项是一定要选择的,这样才能把busybox编译成静态链接的可执行文件,运行时才独立于其他函数库.否则必需要其他库文件才能运行,在单一个linux内核不能使他正常工作.Installation OptionsDont use /usr(./_install) BusyBox installation prefix这个选项也一定要选,否则make install 后busybox将安装在原系统的/usr下,这将覆盖掉系统原有的命令.选择这个选项后,make install后会在busybox目录下生成一个叫_install的目录,里面有busybox和指向他的链接.其他选项都是一些linux基本命令选项,自己需要哪些命令就编译进去,一般用默认的就可以了.配置好后退出并保存.3,编译并安装busybox#make#make install顺利完成。4、检查安装结果根据参考资料2,检查到编译好后在解压目录busybox-1.00目录下生成子目录_install# ll总用量 8drwxr-xr-x 2 root root 4096 12月 11 15:49 binlrwxrwxrwx 1 root root 11 12月 11 15:49 linuxrc - bin/busyboxdrwxr-xr-x 2 root root 4096 12月 11 15:49 sbin其中可执行文件busybox在bin目录下,其他的都是指向他的符号链接.-rwxr-xr-x 1 root root 801400 12月 11 15:49 busybox可见busybox只要八百k多点。根据配置选择的不同,编译出来的busybox大小也会有差别。根据其他资料所述,典型的busybox文件大小在动态链接的情况下是300 KB左右,静态链接为800 KB左右,用它实现的文件系统完全可以控制在1 MB以下在bin/下面有:# ll总用量 788lrwxrwxrwx 1 root root 7 12月 11 15:49 - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 ash - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 basename - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 bunzip2 - busybox-rwxr-xr-x 1 root root 801400 12月 11 15:49 busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 bzcat - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 cat - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 chgrp - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 chmod - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 chown - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 chvt - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 clear - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 cmp - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 cp - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 cut - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 date - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 dd - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 deallocvt - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 df - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 dirname - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 dmesg - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 du - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 echo - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 egrep - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 env - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 expr - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 false - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 fgrep - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 find - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 free - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 grep - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 gunzip - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 gzip - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 head - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 hexdump - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 hostname - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 id - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 install - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 kill - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 killall - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 ln - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 logger - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 ls - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 mkdir - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 mknod - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 mktemp - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 more - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 mount - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 mv - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 openvt - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 pidof - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 ping - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 ps - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 pwd - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 readlink - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 reset - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 rm - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 rmdir - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 sed - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 sh - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 sleep - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 sort - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 strings - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 sync - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 tail - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 tar - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 tee - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 test - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 time - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 touch - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 tr - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 true - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 tty - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 umount - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 uname - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 uniq - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 unzip - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 uptime - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 usleep - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 vi - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 wc - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 wget - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 which - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 whoami - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 xargs - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 yes - busyboxlrwxrwxrwx 1 root root 7 12月 11 15:49 zcat - busybox根据资料,可以这样用busybox#busybox ls他的功能就相当运行ls命令实验如下:在bin/目录下# busybox ls chgrp cut du find hostname ls openvt rm sync tr uptime xargs实际就是把原先的命令加一个busybox的前缀就是了最常用的用法是建立指向busybox的链接,不同的链接名完成不同的功能.#ln -s busybox ls#ln -s busybox rm#ln -s busybox mkdir然后分别运行这三个链接:#./ls#./rm#./mkdir就可以分别完成了ls rm 和mkdir命令的功能.虽然他们都指向同一个可执行程序busybox但是只要链接名不同,完成的功能就不同。实际上可以看到安装结果已经包含了这些基本命令但符号链接。实验如下:# ./lsUsing fallback suid method chgrp cut du find hostname ls openvt rm sync tr uptime xargs# ./echo $PATHUsing fallback suid method/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin# ./mkdirUsing fallback suid methodBusyBox v1.00 (2006.12.11-07:42+0000) multi-call binaryUsage: mkdir OPTION DIRECTORY.# busybox mkdirBusyBox v0.60.5 (2003.01.24-22:43+0000) multi-call binaryUsage: mkdir OPTION DIRECTORY.可以看到,使用busybox的ls命令会多输出一个左括符号,并会多出Using fallback suid method或BusyBox v1.00 (2006.12.11-07:42+0000) multi-call binary的提示5、反思与总结实际上最麻烦的工作是配置,其中动态/静态库,安装位置,是否使用交叉编译工具等几个问题在上面操作中并没有深入涉及。参考资料3中提到配置时的选项:下面三个目录是很多人都会感兴趣的:Build Options -Installation Options -Login/Password Management Utilities -在Build Options里面有是否使用交叉编译的选项(Do you want to build BusyBox with a Cross Compiler)。如果要对其他平台进行编译就要选择它并设置相应的编译程序前缀。在Installation Options里面可以设置安装的路径,

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论