Busybox and benchmark configuration

来源:互联网 发布:温故知今txt下载 编辑:程序博客网 时间:2024/05/16 09:51

Busybox and benchmarkconfiguration

配置linux内核

(Initrd) support (在block device中),另外最好将ext3文件系统编译进内核

 

配置busybox(使用1.18.3)

General Configuration

       >Show verbose applet usage messages

       >Runtime SUID/SGID configuration via/etc/busybox.conf

Build Opions

       >Build Busybox as a static binary

InstallationOptions

       >Don’t use /usr

(工具的选择先跳过)

 

编译busybox

#make

#make install

 

制作Initrd(cpio格式)

1)     拷贝busybox

#mkdir ramdisk

#cd ramdisk

#mkdir etc usr vartmp proc home root dev

#cp –R../busybox-1.18.3/_install/* .

 

2)     设备文件

#cp –R/dev/console dev

#cp –R /dev/nulldev

#cp –R /dev/zerodev

#cp –R /dev/ptsdev

#cp –R /dev/ptmxdev

 

3)     配置文件

#cp –R../busybox-1.18.3/examples/bootfloppy/etc/* etc/

#cp /etc/passwdetc/

#cp /etc/shadowetc/

默认的root使用/bin/bash登陆,但是busybox没有bash,修改etc/passwd:

Root:x:0:0:root:/root:/bin/ash

使用ash登陆root

 

4)     生成initrd

#chown root.rootbin/busybox

#chmod 4755bin/busybox

#shgen_initramfs_list.sh ramdisk/ > filelist

#gen_init_cpiofilelist > rootfs.cpio

#gzip rootfs.cpio

rootfs.cpio.gz就是一个可以使用的ramdisk

 

FTP配置

1)     在配置busybox是选上

Networking Utilities->

        >Ftpd

        >inetd

2)     在/etc/inetd.conf中追加:

21 stream tcpnowait root ftpd ftpd –w /tftp_ftp_dir

其中/tftp_ftp_dir是FTP的根目录

3)     在/etc/init.d/rcS中追加:

Inetd

 

Telnet配置

1)     Linuxkernel必须配置

CONFIG_UNIX98_PTYS=y

Networking Utilitiesà

选择[*] Support standalone telnetd (not inetdonly)

Login/Password ManagementUtilities

去掉[] Support for /etc/nologin

去掉[] Support for /etc/seruretty

 

2)     有/dev/pts, /dev/ptmx文件

3)     Busybox必须配置

CONFIG_LOGIN

CONFIG_FEATURE_SUID

4)     修改/etc/init.d/rcS文件

Mount –t devpts devpts /dev/pts

telnet –l /bin/login

 

 

移植Netserve(netperf服务端)

1)     找出netserver以及其依赖库的位置

#whereis netserver

Netserver:/usr/local/bin/netserver

#ldd/usr/local/bin/netserver

2)     将netserver以及依赖库拷贝到指定位置

3)     修改/etc/init.d/rcS, 添加:

/usr/local/bin/netserver