How to set up a diskless OpenBSD in Sun SparcUnix系统 -电脑资料

电脑资料 时间:2019-01-01 我要投稿
【www.unjs.com - 电脑资料】

    In my case I had an old Sun SparcStation IPX and a standard PC runningOpenBSD 2.9. What I wanted, was to boot up IPX from the network andmount the root filesystem from a nfs server. In this case the serverIP address was 10.10.10.1 (super-gw

In my case I had an old Sun SparcStation IPX and a standard PC runningOpenBSD 2.9. What I wanted, was to boot up IPX from the network andmount the root filesystem from a nfs server. In this case the serverIP 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</p><p>    /etc/hosts</p><p>    /etc/bootparams</p><p>    /etc/exports</p><p>    

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

/etc/rc.conf</p><p>    /etc/ine<strong>td</STRONG>.conf</p><p>    

    rpc.bootparamdwill be started automatically if the/etc/bootparamsfile exists.

Step by step instructions

    Read the diskless(8)man page from OpenBSD. It willexplain the whole process and the reasons why diskless setups aresomewhat tricky.

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

    SPARCstation IPX, Type 4 Keyboard</p><p>    ROM Rev. 2.3, 64 MB Memory installed, Serial #2103274</p><p>    Ethernet address 8:0:20:b:a1:cd, Host ID: 572017ea.</p><p>    

    Set up rarp daemon that IPX will get its ip-address.

    # echo '8:0:20:b:a1:cd super-sparc' >> /etc/ethers</p><p>    # echo '10.10.10.2 super-sparc.super.local super-sparc' >> /etc/hosts</p><p>    

        and start the rarpd:

    # /usr/sbin/rarpd -a</p><p>    

    Create/tftpbootdirectory and make it world readablewithchmodand copyboot.netfile from the OpenBSD2.9 Sparc distribution to there. That file is the boot program whichwill be loaded by the first stage boot loader of IPX. Make a linkwhich name is composed of the IP address assigned to IPX in ahexadecimal format, a dot, and the architecture name (all uppercase). If the IP address will be 10.10.10.2 and the system is IPX thelink name will be 0A0A0A02.SUN4C

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

        Edit the/etc/inetd.confto allow tftp daemon to run andrestartinetd.

    Now you can test the IPX load the boot loader program. In IPX bootprompt typeb net:

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

        and it should start downloadingboot.netfile. Afterdownloading, IPX will freeze for 5-7 minutes but this is normal. IPXis trying to get an acknowledgement packet from the tftp server but theOpenBSD tftp daemon is not designated to respond. This inconveniencecan be solved by hacking the code or compiling a different tftpdaemon :-)

        When you get a message:

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

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

       

    Next task is to prepare a filesystem for IPX. This is done by usingdefault package sets from the OpenBSD Sparc distribution. Create/export/super-sparc/rootdirectory and exctract at leastbase29.tgz and etc29.tgz to there from the OpenBSD Sparc distribution.

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

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

        Create special devices to dev directory:

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

        Copy hosts toetc

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

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

    # dd bs=128k count=1024 if=/dev/zero f=/export/super-sparc/swap</p><p>    

    Set up a rpc daemon. First edit/etc/bootparams:

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

        and startrpc.bootpramd:

    # /usr/sbin/rpc.bootpramd</p><p>    

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

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

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

        and start the nfs daemon:

    # /sbin/nfsd</p><p>    

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

    原文转自:http://www.ltesting.net

最新文章