Chinaunix首页 | 论坛 | 博客
  • 博客访问: 6966263
  • 博文数量: 637
  • 博客积分: 10265
  • 博客等级: 上将
  • 技术积分: 6165
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-12 22:00
文章分类

全部博文(637)

文章存档

2011年(1)

2010年(1)

2009年(3)

2008年(12)

2007年(44)

2006年(156)

2005年(419)

2004年(1)

分类: BSD

2005-03-31 20:53:38

In my case I had an old Sun SparcStation IPX and a standard PC running OpenBSD 2.9. What I wanted, was to boot up IPX from the network and mount the root filesystem from a nfs server. In this case the server IP address was 10.10.10.1 (super-gw) and the IPX IP address 10.10.10.2 (super-sparc) and the domain was super.local.

Basically what you need is:

  • rarp daemon to tell IPX its IP address
  • tftp daemon to provide the first stage boot loader
  • rpc.bootparam daemon to provide boot and filesystem parameters for IPX
  • nfs server to provide mount points of root and swap filesystems

Files you must modify:

   /etc/ethers
/etc/hosts
/etc/bootparams
/etc/exports

If you want to start daemon services automatically you need to modify:

   /etc/rc.conf
/etc/inetd.conf

rpc.bootparamd will be started automatically if the /etc/bootparams file exists.

Step by step instructions
  1. Read the man page from . It will explain the whole process and the reasons why diskless setups are somewhat tricky.

  2. Find out the hardware address of your IPX box (le0 interface). In power on reset IPX will show it:

    SPARCstation IPX, Type 4 Keyboard
    ROM Rev. 2.3, 64 MB Memory installed, Serial #2103274
    Ethernet address 8:0:20:b:a1:cd, Host ID: 572017ea.
  3. Set up rarp daemon that IPX will get its ip-address.

    # echo '8:0:20:b:a1:cd super-sparc' >> /etc/ethers

    # echo '10.10.10.2 super-sparc.super.local super-sparc' >> /etc/hosts

    and start the rarpd:

    # /usr/sbin/rarpd -a
  4. Create /tftpboot directory and make it world readable with chmod and copy boot.net file from the OpenBSD 2.9 Sparc distribution to there. That file is the boot program which will be loaded by the first stage boot loader of IPX. Make a link which name is composed of the IP address assigned to IPX in a hexadecimal format, a dot, and the architecture name (all upper case). If the IP address will be 10.10.10.2 and the system is IPX the link name will be 0A0A0A02.SUN4C

    # cd /tftpboot
    # ln -s boot.net 0A0A0A02.SUN4C

    Edit the /etc/inetd.conf to allow tftp daemon to run and restart inetd.

  5. Now you can test the IPX load the boot loader program. In IPX boot prompt type b net:

    Type b (boot), c (continue), or n (new command mode)
    > b net

    and it should start downloading boot.net file. After downloading, IPX will freeze for 5-7 minutes but this is normal. IPX is trying to get an acknowledgement packet from the tftp server but the OpenBSD tftp daemon is not designated to respond. This inconvenience can be solved by hacking the code or compiling a different tftp daemon :-)

    When you get a message:

    Boot device: /sbus/le@0,c00000   File and args:
    12200 receive failed
    >> OpenBSD BOOT 2.1

    You know that the OpenBSD boot program was executed (don't care about the "receive failed" message, it will appear for above reason).

  6. Next task is to prepare a filesystem for IPX. This is done by using default package sets from the OpenBSD Sparc distribution. Create /export/super-sparc/root directory and exctract at least base29.tgz and etc29.tgz to there from the OpenBSD Sparc distribution.

    # mkdir /export
    # mkdir /export/super-sparc
    # mkdir /export/super-sparc/root
    # cd /export/super-sparc/root
    # tar -zxf [OpenBSD-Source]/sparc/base29.tgz
    # tar -zxf [OpenBSD-Source]/sparc/etc29.tgz

    Check that the kernel image (bsd) can be found from /export/super-sparc/root directory

    Create special devices to dev directory:

    # cd /export/super-sparc/root/dev
    # ./MAKEDEV all

    Copy hosts to etc

    # cp /etc/hosts /export/super-sparc/root/etc
    From /export/super-sparc/root/etc change myname and hostname.if
    # cd /export/super-sparc/root/etc
    # echo 'super-sparc' > myname
    # echo 'inet 10.10.10.2 255.255.255.0' > hostname.le0

    Create 128MB (can be smaller) swap file to /export/super-sparc

    # dd bs=128k count=1024 if=/dev/zero of=/export/super-sparc/swap
  7. Set up a rpc daemon. First edit /etc/bootparams:

    # echo 'super-sparc root=super-gw:/export/super-sparc/root 
    swap=super-gw:/export/super-sparc/swap' >> /etc/bootparams

    and start rpc.bootpramd:

    # /usr/sbin/rpc.bootpramd

    Now the OpenBSD boot loader will know where look for root and swap filesystems and the kernel image (bsd for default).

  8. Last thing is to set up a nfs share for the super-sparc root filesystem. Edit /etc/exports:

    # echo '/export/super-sparc/root -maproot=root -alldirs 
    super-sparc' >> /etc/exports

    and start the nfs daemon:

    # /sbin/nfsd

Now you should be able to boot the kernel from the network and mount root and swap filesystems. There is of course a lot more tuning in the system after this but at least now you got it running...

阅读(2022) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~