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