jinix-3.0制作过程(2)
1.制作跟文件系统,挂载磁盘映像文件
sudo /sbin/losetup -o 32256 /dev/loop7 ./disk.img
sudo mount -o loop /dev/loop7 ./mnt
sudo umount ./mnt
sudo /sbin/losetup -d /dev/loop7
上海漕河泾, mail&msn: jinglexy at yahoo.com.cn
2.相关文件到硬盘映像文件
# 拷贝busybox文件
cd ./mnt
mkdir etc usr var tmp proc home root dev lib
mkdir -p ./opt/i686/lib
cp ../busybox-1.13.3/_install/* ./ -fr
# 拷贝设备节点文件,有一些是不需要的,实际上只需要sda就可以了:
#cp -R /dev/hda{,1,2,3,4,5,6,7,8} ./dev/
#cp -R /dev/hdb{,1,2,3,4,5,6,7,8} ./dev/
#cp -R /dev/hdc{,1,2,3,4,5,6,7,8} ./dev/
#cp -R /dev/hdd{,1,2,3,4,5,6,7,8} ./dev/
cp -fra /dev/sda{,1,2} ./dev
#cp -R /dev/sdb{,1,2,3,4,5,6,7,8} ./dev/
#cp -R /dev/sdc{,1,2,3,4,5,6,7,8} ./dev/
#cp -R /dev/sdd{,1,2,3,4,5,6,7,8} ./dev/
cp -R /dev/console ./dev/
#cp -R /dev/fb{,0,1,2,3,4} ./dev/
#cp -R /dev/fd{0,1} ./dev/
cp -R /dev/initctl ./dev/
cp -R /dev/loop{1,2,3,4,5} ./dev/
cp -R /dev/null ./dev/
cp -R /dev/ram{,0,1,2} ./dev/
cp -R /dev/tty{0,1,2,3,4,5} ./dev/
cp -R /dev/zero ./dev/
mkdir ./dev/input
cp -R /dev/input/mice ./dev/input
#cp -R /dev/input/mouse{,0,1} ./dev/input
#建立etc目录下的配置文件
touch etc/{busybox.conf,group,inittab,motd,passwd,resolv.conf,shadow-}
touch etc/{fstab,mtab,profile,shadow}
mkdir etc/init.d
cp ../busybox-1.13.3/examples/bootfloppy/etc/init.d/rcS ./etc/init.d/rcS
3.etc下面的一些文件:
busybox.conf文件:空文件
fstab文件:
none /proc proc defaults 0 0
/dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0
group文件:
root:x:0:root
inittab文件:
::sysinit:/etc/init.d/rcS
#::askfirst:/bin/sh
tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
# Stuff to do when restarting the init process
::restart:/sbin/init
# Stuff to do before rebooting
::ctrlaltdel:/sbin/reboot
::shutdown:/bin/umount -a -r
::shutdown:/sbin/swapoff -a
motd文件:是一个空文件.
mtab文件:是一个空文件.
passwd文件:
root::0:0:root:/root:/bin/sh
profile文件:
# /etc/profile: system-wide .profile file for the Bourne shells
#export PS1="[\u@\h \w]\$"
alias ll='ls -l'
alias du='du -h'
alias df='df -h'
alias rm='rm -i'
# ANSI COLORS
CRE="
^[[K"
NORMAL="^[[0;39m"
RED="^[[1;31m"
GREEN="^[[1;32m"
YELLOW="^[[1;33m"
BLUE="^[[1;34m"
MAGENTA="^[[1;35m"
CYAN="^[[1;36m"
WHITE="^[[1;37m"
#echo "${GREEN}jinix version 3.0.0${NORMAL}"
echo "welcome jinix version 3.0.0"
resolv.conf文件:
nameserver 0.0.0.0
nameserver 0.0.0.0
shadow文件:
root::12705:0:99999:7:::
shadow-文件:
root::12705:0:99999:7:::
4.拷贝bash及uclibc库
#cp /opt/i686/bash/bin/bash ./bin/ -f
cp /opt/i686/lib/ld-2.7.so ./lib/ -fa
cp /opt/i686/lib/ld-linux.so.2 ./lib/ -fa
cp /opt/i686/lib/libc-2.7.so ./lib/ -fa
cp /opt/i686/lib/libc.so ./lib/ -fa
cp /opt/i686/lib/libc.so.6 ./lib/ -fa
cp /opt/i686/lib/libdl-2.7.so ./lib/ -fa
cp /opt/i686/lib/libdl.so ./lib/ -fa
cp /opt/i686/lib/libdl.so.2 ./lib/ -fa
cp /opt/i686/lib/libm-2.7.so ./lib/ -fa
cp /opt/i686/lib/libm.so ./lib/ -fa
cp /opt/i686/lib/libm.so.6 ./lib/ -fa
cp /opt/i686/lib/librt-2.7.so ./lib/ -fa
cp /opt/i686/lib/librt.so ./lib/ -fa
cp /opt/i686/lib/librt.so.1 ./lib/ -fa
cp lib/* ./opt/i686/lib/ -fa
虽然拷重复了,但是可以使用,后面可以自己去修正库的路径
5.启动,测试一把,linux及shell应该可以正常启动。
阅读(1455) | 评论(0) | 转发(0) |