tryitle
驱动牛犊
驱动牛犊
  • 注册日期2003-04-22
  • 最后登录2004-04-09
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:2181回复:0

搭建通过nfs mount rootfs开发环境(原创)

楼主#
更多 发布于:2004-04-08 15:20
搭建通过nfs mount rootfs开发环境:
有了这个环境好处就蛮多了,最主要好处就是系统在研发阶段,不用无数次地烧写flash,加快开发速度。
不过在搭建这个环境前应具备的条件有:
1. 在板子上应有个可以支持ethernet网络(ftp,tftp)下载的bootload
2. 下载的是image.ram( RAM版,非ROM版喔)
server端-redhat 7.3:
1. Nfs server
a) /etc/exports
添加内容-可读写,可行使root权限:
/work2/uc24/uClinux-dist/romfs *(rw,no_root_squash,no_all_squash)
2.Host解释相关
b) /etc/hosts
由于没使用DNS解释机器名称(动态),这里采取静态映射的方式,名称不能重复
192.168.8.135           le.com

192.168.8.101           lelinux1
192.168.8.102           lelinux2
192.168.8.103           lelinux3
192.168.8.104           lelinux4

c) /etc/hosts.deny
先对所有用户封闭nfs相关网络支持
portmap : ALL
lockd : ALL
mountd : ALL
rquotad : ALL
statd : ALL

d) /etc/hosts.allow
再对指定范围用户打开nfs相关网络支持
portmap : 192.168.8.0/255.255.255.0
lockd : 192.168.8.0/255.255.255.0
mountd : 192.168.8.0/255.255.255.0
rquotad : 192.168.8.0/255.255.255.0
statd : 192.168.8.0/255.255.255.0

2. Dhcpd server
配置/etc/dhcpd.conf
内容如下:
use-host-decl-names on;
default-lease-time 259200;
max-lease-time 518400;
allow bootp;

subnet 192.168.8.0 netmask 255.255.255.0 {
        # --- default gateway
        option routers 192.168.8.135;
        option subnet-mask 255.255.255.0;
        range 192.168.8.101 192.168.8.105;

        group {
                host le.com {
                        hardware ethernet 00:03:FF:4E:4F:50;
                        fixed-address 192.168.8.135;
                        filename "image.ram";
                        option root-path "/work2/uc24/uClinux-dist/romfs";
                }
        }
}

3. Portmap
开启状态,Nfs需要portmap的支持

4. 制作rootfs
很简单,在uclinux的image生成之后,在开发环境下会有个romfs目录(笔者环境下为:/work2/uc24/uClinux-dist/romfs),在其dev子目录下需要执行的动作:
从系统的/dev目录下拷贝设备文件到这个目录中,拷贝的设备文件主要有,满多的,估计我的系统一些是没有用到的:
crwxrwxrwx    1 root     root       5,   1  4月  8  2004 console
crwxrwxrwx    1 root     root       5,  64  3月 15  2002 cua0
crwxrwxrwx    1 root     root       5,  65  3月 15  2002 cua1
crwxrwxrwx    1 root     root       1,   7  4月  8  2004 full
crwxrwxrwx    1 root     root       1,   2  4月  8  2004 kmem

crwxrwxrwx    1 root     root       1,   1  4月  8  2004 mem
crwxrwxrwx    1 root     root       1,   3  4月  8  2004 null
crwxrwxrwx    1 root     root       1,   4  4月  8  2004 port
crwxrwxrwx    1 root     root       2,   0  3月 15  2002 ptyp0
crwxrwxrwx    1 root     root       2,   1  3月 15  2002 ptyp1
crwxrwxrwx    1 root     root       2,   2  3月 15  2002 ptyp2
crwxrwxrwx    1 root     root       2,   3  3月 15  2002 ptyp3

lrwxrwxrwx    1 root     root            4  4月  7 20:30 ram -> ram1
brwxrwxrwx    1 root     root       1,   0  4月  8  2004 ram0
brwxrwxrwx    1 root     root       1,   1  4月  8  2004 ram1
brwxrwxrwx    1 root     root       1,  10  4月  8  2004 ram10
brwxrwxrwx    1 root     root       1,  11  4月  8  2004 ram11

crwxrwxrwx    1 root     root       5,   0  4月  8  2004 tty
crwxrwxrwx    1 root     root       4,   0  4月  8  2004 tty0
crwxrwxrwx    1 root     root       4,   1  4月  8  2004 tty1
crwxrwxrwx    1 root     root       4,  10  4月  8  2004 tty10

crwxrwxrwx    1 root     root       3,   0  9月 20  2003 ttyp0
crwxrwxrwx    1 root     root       3,   1  7月 20  2003 ttyp1
crwxrwxrwx    1 root     root       3,   2  3月 15  2002 ttyp2
crwxrwxrwx    1 root     root       3,   3  3月 15  2002 ttyp3
crwxrwxrwx    1 root     root       3,   4  3月 15  2002 ttyp4

5. 相关命令:
/etc/init.d/nfs restart
/etc/init.d/dhcpd restart
/etc/init.d/portmap restart
cp
附件名称/大小 下载次数 最后更新
2004-04-08_搭建通过nfs mount rootfs开发环境.doc (48KB)  44
游客

返回顶部