全部博文(395)
分类: 嵌入式
2011-06-21 19:03:06
//下面的方法还是要依赖于国嵌手册上做好的4-3-1的2.6.29的内核,不过如果你有的话,下面的步骤会让你感性的认识一下文件系统的制作过程。
[root@bogon guoqian]# cd 4-3-2
[root@bogon 4-3-2]# pwd
/home/guoqian/4-3-2
[root@bogon 4-3-2]# cp ../../samba/busybox-1.13.3.tar.gz ../../samba/etc.tar.gz ./
[root@bogon 4-3-2]# ls
busybox-1.13.3.tar.gz etc.tar.gz
[root@bogon 4-3-2]# tar -zxvf busybox-1.13.3.tar.gz
[root@bogon 4-3-2]# ls
busybox-1.13.3 busybox-1.13.3.tar.gz etc.tar.gz
[root@bogon 4-3-2]# mkdir -p /home/guoqian/nfsroot/rootfs
[root@bogon 4-3-2]# cd /home/guoqian/
[root@bogon guoqian]# ls
4-1-1 4-1-3 4-2-1 4-2-6-1 4-3-2 u-boot-2008.10
4-1-2 4-1-4 4-2-6 4-3-1 nfsroot u-boot-2008.10.tar.bz2
[root@bogon guoqian]# cd nfsroot/rootfs/
[root@bogon rootfs]# mkdir bin dev etc lib proc sbin sys usr mnt tmp var
[root@bogon rootfs]# ls
bin dev etc lib mnt proc sbin sys tmp usr var
[root@bogon rootfs]# mkdir usr/bin usr/lib usr/sbin lib/modules
[root@bogon rootfs]# ls usr
bin lib sbin
[root@bogon rootfs]# ls usr
bin lib sbin
[root@bogon rootfs]# ls
bin dev etc lib mnt proc sbin sys tmp usr var
[root@bogon rootfs]# cd dev
[root@bogon dev]# mknod -m 666 console c 5 1
[root@bogon dev]# mknod -m 666 null c 1 3
[root@bogon dev]# ls
console null
[root@bogon dev]# cd ../
[root@bogon dev]# ll
总计 0
crw-rw-rw- 1 root root 5, 1 06-19 03:30 console
crw-rw-rw- 1 root root 1, 3 06-19 03:30 null
[root@bogon 4-3-2]# ls
busybox-1.13.3 busybox-1.13.3.tar.gz etc.tar.gz
[root@bogon 4-3-2]# tar zxvf etc.tar.gz -C ../nfsroot/rootfs/
etc/
etc/inittab
etc/profile
etc/fstab
etc/init.d/
etc/init.d/rcS
[root@bogon 4-3-2]# cd ../nfsroot/rootfs/
[root@bogon rootfs]# ls
bin dev etc lib mnt proc sbin sys tmp usr var
[root@bogon rootfs]# ls etc
fstab init.d inittab profile
[root@bogon etc]# cd ../../../4-3-1/linux-2.6.29/
[root@bogon linux-2.6.29]# make modules ARCH=arm CROSS_COMPILE=arm-linux-
CHK include/linux/version.h
make[1]: “include/asm-arm/mach-types.h”是最新的。
CHK include/linux/utsrelease.h
SYMLINK include/asm -> include/asm-arm
CALL scripts/checksyscalls.sh
CC [M] drivers/char/mini2440_hello_module.o
CC [M] drivers/scsi/scsi_wait_scan.o
Building modules, stage 2.
MODPOST 2 modules
CC drivers/char/mini2440_hello_module.mod.o
LD [M] drivers/char/mini2440_hello_module.ko
CC drivers/scsi/scsi_wait_scan.mod.o
LD [M] drivers/scsi/scsi_wait_scan.ko
[root@bogon linux-2.6.29]# make modules_install ARCH=arm INSTALL_MOD_PATH=../../nfsroot/rootfs/ //注:上面的命令是一行。。
INSTALL drivers/char/mini2440_hello_module.ko
INSTALL drivers/scsi/scsi_wait_scan.ko
DEPMOD 2.6.29.4-FriendlyARM
[root@bogon linux-2.6.29]# cd ../../nfsroot/rootfs/
[root@bogon rootfs]# ls
bin dev etc lib mnt proc sbin sys tmp usr var
[root@bogon rootfs]# ls lib/modules/
2.6.29.4-FriendlyARM
[root@bogon 4-3-2]# cd busybox-1.13.3
[root@bogon busybox-1.13.3]# pwd
/home/guoqian/4-3-2/busybox-1.13.3
[root@bogon busybox-1.13.3]# ls
applets e2fsprogs libpwdgrp modutils sysklogd
arch editors LICENSE networking testsuite
archival examples loginutils printutils TODO
AUTHORS fa.config mailutils procps TODO_config_nommu
Config.in findutils Makefile README util-linux
console-tools include Makefile.custom runit
coreutils init Makefile.flags scripts
debianutils INSTALL Makefile.help selinux
docs libbb miscutils shell
[root@bogon busybox-1.13.3]# make menuconfig
这下面的过程比较复杂,我略了。。。有时间加上
[root@bogon busybox-1.13.3]# make ARCH=arm CROSS_COMPILE=arm-linux-
[root@bogon busybox-1.13.3]# cd ../../nfsroot/rootfs/
[root@bogon rootfs]# ls
bin dev etc lib linuxrc mnt proc sbin sys tmp usr var
[root@bogon rootfs]# ls bin
[ deallocvt hexdump mkdir rm time
[[ delgroup hostid mkfifo rmdir top
addgroup deluser hostname mknod rtcwake touch
adduser df hush mktemp run-parts tr
ar diff id more runsv traceroute
arping dirname install mount runsvdir true
ash dmesg ip mountpoint rx tty
awk dos2unix ipaddr msh script ttysize
basename du ipcalc mt sed udpsvd
bunzip2 dumpkmap ipcrm mv seq umount
busybox dumpleases ipcs nc setarch uname
bzcat echo iplink netstat setkeycodes uncompress
bzip2 ed iproute nice setsid unexpand
cal egrep iprule nmeter setuidgid uniq
cat eject iptunnel nohup sh unix2dos
catv env kbd_mode nslookup sha1sum unlzma
chat envdir kill od showkey unzip
chattr envuidgid killall openvt sleep uptime
chgrp ether-wake killall5 passwd softlimit usleep
chmod expand last patch sort uudecode
chown expr length pgrep split uuencode
chpst false less pidof stat vi
chrt fdflush linux32 ping strings vlock
chvt fdformat linux64 ping6 stty watch
cksum fgrep ln pipe_progress su wc
clear find logger pkill sum wget
cmp fold login printenv sv which
comm free logname printf sync who
cp ftpget lpq ps tac whoami
cpio ftpput lpr pscan tail xargs
crontab fuser ls pwd tar yes
cryptpw getopt lsattr readlink tcpsvd zcat
cttyhack grep lzmacat realpath tee
cut gunzip makemime reformime telnet
date gzip md5sum renice test
dc hd mesg reset tftp
dd head microcom resize tftpd
[root@bogon rootfs]# vim /etc/exports
1 /home/root_qtopia *(rw,sync,no_root_squash)
2 /home/guoqian/nfsroot/rootfs 59.70.157.* (rw,sync,no_root_squash)
[root@bogon rootfs]# /etc/init.d/nfs restart
关闭 NFS mountd: [确定]
关闭 NFS 守护进程: [确定]
关闭 NFS quotas: [确定]
关闭 NFS 服务: [确定]
启动 NFS 服务: exportfs: No options for /home/guoqian/nfsroot/rootfs 59.70.157.*: suggest 59.70.157.*(sync) to avoid warning
exportfs: No host name given with /home/guoqian/nfsroot/rootfs (rw,sync,no_root_squash), suggest *(rw,sync,no_root_squash) to avoid warning
[确定]
关掉 NFS 配额: [确定]
启动 NFS 守护进程: [确定][root@bogon rootfs]# mount -t nfs 59.70.157.174:/home/guoqian/nfsroot/rootfs/ /mnt
[root@bogon rootfs]# ls /mnt
bin dev etc lib linuxrc mnt proc sbin sys tmp usr var
启动 NFS mountd: [确定]
[root@bogon rootfs]# mount -t nfs 59.70.157.174:/home/guoqian/nfsroot/rootfs/ /mnt
[root@bogon rootfs]# ls /mnt
bin dev etc lib linuxrc mnt proc sbin sys tmp usr var