nt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0
group
root:x:0:root
inittab
::sysinit:/etc/init.d/rcS
::askfirst:/bin/sh
tty2::respawn:/bin/getty 38400 tty2
tty3::respawn:/bin/getty 38400 tty3
tty4::respawn:/bin/getty 38400 tty4
# Stuff to do when restarting the init process
::restart:/bin/init
# Stuff to do before rebooting
::ctrlaltdel:/bin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/bin/swapoff -a
issue
Baby Linux release 0.1
motd
mtab
passwd
root::0:0:root:/root:/bin/ash
profile
# /etc/profile: system-wide .profile file for the Bourne shells
echo
echo
export PS1="[u@h w]$"
echo "Done"
alias ll='ls -l'
alias du='du -h'
alias df='df -h'
alias rm='rm -i'
echo
resolv.conf
nameserver 202.96.209.5
nameserver 202.96.209.6
shadow
root:$$adltAB9Sr/MSKqylIvSJT/:12705:0:99999:7:::
shadow-
root:$DWU.tenP$B7ANiXoGoiZMwJR6Ih8810:12705:0:99999:7:::
其中有很多是从原系统的/etc下拷贝过来修改的,如果你是一个具有中等以上水平的linux爱好者,那么应该一看就明白了,当然,你也可以根据自己的需要修改这些文件.其中最重要的是fstab和inittab,busybox内建的init程序用到的inittab文件的语法和一般的不一样,不能直接把原系统/etc下inittab文件拷贝过来.可以把busybox-1.00目录下的示例文件拷贝过来修改用.具体请看busybox的文档.busybox的init也可以不用inittab.但是在我制作babylinux过程中有一个非常奇怪的bug.所有/sbin下的busybox链接在做成压缩的根文件系统,解压后都不能正常运行,显示找不到该命令.只有当我在/bin下做这些链接时才能运行.具体原因还不太清除,所以你需要做下面的工作:
#cd /babylinux/rootfs/sbin
#ls
chroot getty ifconfig losetup pivot_root reboot swapoff sysctl
fdisk halt init mkswap poweroff route swapon telnetd
查看到sbin下有上述链接
转到bin下
#cd /babylinux/rootfs/bin
重新做这些链接:
#ln -s busybox chroot
#ln -s busybox getty
#ln -s busybox ifconfig
...
然后把sbin下的链接删除,以节省空间
#rm -rf /babylinux/rootfs/sbin/*
再把原先inittab中所有的sbin改成bin
init.d下的文件:
rcS
请确保这个文件是可执行的,否则请改成可执行的:
#chmod u+x rcS
rcS的内容:
#! /bin/sh
mount -o remount,rw /
/bin/mount -a
>/etc/mtab
echo
echo
echo
echo
echo -en "Welcom to 33[0;32mBabyLinux33[0;39m"
echo -en "33[0;36m"
echo
echo -en "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo -en "+ This is a tiny linux system based on a floppy.It contains "
echo -en "+ more than 100 basic Linux commands and tools.The kernel of "
echo -en "+ this tiny system support all kinds of normal filesystems. "
echo -en "+ linux ext2,ext3,jfs,reiserfs and windows fat,vfat,ntfs[readonly]"
echo -en "+ is supported! So it is a powerful small system you can use it "
echo -en "+ as a linux and windows rescue disk.Beside this,the kernel also"
echo -en "+ contains the drivers of Reltek8139,NE2000,via-rhine ethernet"
echo -en "+ adpater. you can configure the IPaddress and netmask with tools"
echo -en "+ 'ifconfig' and config the default gateway with command 'route'. "
echo -en "+ Is there anything else? Haha,this is a telnet server build-in"
echo -en "+ you can type 'telnetd' to startd it and thus your friends can"
echo -en "+ logon to your system to help you solve the problem."
echo -en "+ 33[0;32mAll these great features are powered by BusyBox 1.033[0;36m"
echo -en "+ This is a free system tool developed by GuCuiwen."
echo -en "+ RUN YOUR OWN RISK of using it ! if you have any problem please"
echo -en "+ mailto :
win2linux@163.com Enjoy!!"
echo -en "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo -en "33[0;39m"
hostname BabyLinux
可以自己作相应的修改.
以上是babylinux根文件系统的所有内容,他的总大小应该在1M左右.
[root@gucuiwen baby]# du -hs
1.1M .
九,制作ramdisk映象文件
babylinux根文件系统所有东西都放在/babylinux/rootfs下,我们将利用ramdisk把这些内容做成ramdisk映象文件并压缩他.
以下主要是ramdisk的用法,看完以下内容,你应当学会ramdisk的使用.
[root@gucuiwen babylinux]# dd if=/dev/zero of=/dev/ram1
dd: 正在写入 ‘/dev/ram1’: 设备上没有空间
读入了 8193+0 个块
输出了 8192+0 个块
zero是一个特殊的设备,表示全部为0的字符块.上面这条命令的意思是把系统的第一个ramdisk用全部为0的数据填充,因为ramdisk默认大小为4M,因此当读满8192个块(每块512字节)后,显示'设备上没空间'.这很正常,/dev/ram1已经被填充满了.
如果指定块的大小:
[root@gucuiwen babylinux]# dd if=/dev/zero of=/dev/ram1 bs=1M count=4
读入了 4+0 个块
输出了 4+0 个块
不会有错误提示,这里演示了dd的一般用法,接下来还要频繁用到dd命令.
在/dev下有很多ramdisk设备,ram1,ram2,ram3....
一般用第一个就可以了.
填充后,ram1就有可空间,可以在这个空间上创见一个文件系统:
[root@gucuiwen babylinux]# mkfs.ext2 -m0 /dev/ram1
mke2fs 1.32 (09-Nov-2002)