Setting Up A Netboot Enviroment on Gentoo For OpenBSD

Given the fact I seem to be getting more Sun Sparc headless machines I think its time to have a real netboot environment set up.
Currently this is geared towards Sparc and OpenBSD but theres no reasion why you can not use diffrent boot images ect.. and I plan on doing this :)

Details are as follows.
“Commands are In Italics
“Spelling Mistakes are everywhere”

Host running on ESXi :-
Linux deploy 2.6.27-gentoo-r8 #4 SMP Wed Feb 11 12:10:53 EST 2009 x86_64 Dual-Core AMD Opteron(tm) Processor 2214 HE AuthenticAMD GNU/Linux.

  • Setting Up DHCPD
    emerge -av dhcp
    Netbooting Sparcs requires you to have a static IP address for the client.  Lets set up a DHCP scope for later use and define a  static IP for the netboot
    vi /etc/dhcp/dhcpd.conf
    Here is what I’ve got in mine
    ————–SNIP————–
    # DHCP scope for undersys.net

     

    ddns-update-style ad-hoc; # This is the default. You can set it to none

    # option definitions common to all supported networks…
    # You need to change this one to your own setting

    option domain-name “undersys.net”;

    # Your name servers. You can normally find these in
    # your /etc/resolv.conf file. These will be distributed to all DHCP
    # clients.

    option domain-name-servers 192.168.0.254;

    default-lease-time 600;
    max-lease-time 7200;

    # If this DHCP server is the official DHCP server for the local
    # network, the authoritative directive should be uncommented.

    authoritative;

    # Configuration for an internal subnet.
    # Lets define a basic scope  for later on..

    subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.40 192.168.0.60; # The range of ip addresses it will give ou
    option domain-name-servers 192.168.0.254; # Change to your DNS
    option domain-name “undersys.net”; # You need to change this to your own setting
    option routers 192.168.0.254; # Your gateway, your machine that is connected to the internet
    option broadcast-address 192.168.0.255;
    default-lease-time 600;
    max-lease-time 7200;
    }

    # Static mapping for my Sun Sparc T1
    # option is where we set the boot media location, folder
    host t1 {
    hardware ethernet xx:xx:xx:xx:xx:xx;
    fixed-address 192.168.0.64;
    option root-path “/media/openbsd”;
    }

    # END
    ————–SNIP————–
    The above config will give us a basic scope from 192.168.0.40 to 192.168.0.60.
    Will also give us a static MAC to IP address map and an DHCP “option” for the boot media location.
    Start the DHCP Server
    /etc/init.d/dhcpd start
    Lets add it to auto start to
    rc-update add dhcpd default

  • Setting up RARP
    Sparc Netboot requires RARP  in order to map its MAC to an IP during the PROM stages.
    Gentoo should allready have an RARP deamon installed ” net-misc/iputils”
    vi /etc/ethers
    Add an entry for your system in the following format :-
    # MAC Address                 FQDN
    xx:xx:xx:xx:xx:xx          t1-netboot.undersys.net

     

    You also must edit the locat hosts or your DNS server to have the FQDN mapping, I’ve just used hosts file for the moment.
    vi /etc/hosts
    192.168.0.64    t1-netboot.undersys.net
    From the above we can see that the IP is the Ip address from the static DHCP map.
    vi /etc/conf.d/local.start
    add the following
    # Start rarpd
    /usr/sbin/rarpd -v -e eth0

    You will need to start this manualy first time, just use the above command

  • Setting up TFTP
    You’ll also need a way to serve out the boot image. I use TFTP becase it works with a LOT more wack  machines.
    emerge -av net-ftp/atftp
    mkdir /tftpboot
    chown nobody:nobody /tftpboot
    chmod 440 /tftpboot
    vi /etc/conf.d/local.start
    add the following :-
    # Start tftp server
    /usr/sbin/in.tftpd -v –daemon /tftpboot

     

    You will need to start this manualy first time, just use the above command

  • Setting up the OpenBSD boot files
    Get the following files from your local OpenBSD Mirror
    1) “bsd.rd” copy this into /media/openbsd
    2) “ofwboot.net” copy this into /tftpboot
    Sun Sparc’s when netbooting from PROM look for a file on the TFTP server that maches its MAC address in HEX followed by the extension.
    I like to create a symlink from ofwboot.net to the new file, as the new file names makes no sence
    ln -s  ofwboot.net XXXXXXXX (Where XXXXXXXX is the IP address of the system that we set in dhcpd.conf  in HEX)
    If this fails use TCP dump to see what file its asking for.

We should now be ready to Netboot OpenBSD on the Sparc!
How to boot will come in another article..

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: