Sunday 26 April 2009

A rare techie post

I got my hands on a Sun 420R last week - it would have ended up the tip otherwise - and have been struggling to install Solaris 10 ever since ...

Downloaded Solaris 10 from Sun here and burnt it on to a DVD.... Anyway for some unknown reason the machine would not boot from the DVD (and it also failed with an original, kosher Sun DVD) so I was a bit stuffed. I later managed to install Solaris 9 but that was missing a lot of the goodies I wanted (ZFS, Dtrace etc etc) as well as MySQL etc etc

So I wondered about using a Linux box as a Jumpstart server : bootp doesn't care what it is copying, neither does bootparamd and a bit of googling showed me that it was possible (esp here which was excellent )

Given the usefulness of such a technique - Linux boxes being a damn sight being cheaper than Suns and would make very good inexpensive servers - I went for it...

Firstly I copied the .iso onto the Linux box (192.168.1.3 - ben) and mounted it using the loop option

# mount -o loop /tmp/SOL_10_1008_SPARC.iso /data/sol

This allowed me inside the iso :-)

According to the web site above a few things needed to be done in order to sort out a few glitches...

# ln -s /bin/tar /bin/bar
# ln -s /bin/sed /usr/bin/sed
# ln -s /usr/bin/gdb /usr/bin/adb

A shell script to mimic the Sun mach (1) is needed as well:

# echo '#!/bin/bash' > /bin/mach
# echo "uname -p" >> /bin/mach
# chmod +x /bin/mach


Once all this is done then the jumpstart area can be created using the standard commands. ( I will use the same directory as in the site: /home/jumpstart/install)

# cd /data/sol/Solaris_10/Tools
#./setup_install_server /home/jumpstart/install

Make certain that all the tools are installed that will be required: tftpd, bootparamd and nfs (both common and kernel)

For instance (on my Ubuntu box):

# apt-get install bootparamd (I much prefer apt-get to rpm!)
# apt-get install tftp
# apt-get install nfs-common
# apt-get install nfs-kernel-server

So once all this done, we can configure the server ...

Check that tftpd is enabled in inetd.conf (or wherever your operating system has it).. I used the default of /tftpboot
tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot

Now the fun starts ....

According to Alex's site the following files need to be changes:
  • /etc/hosts

    Add the remote machine into it - in this case warspite and 192.168.1.70

    One major gotcha: ensure that your local host name is not pointed to localhost (127.0.0.1) but rather to the IP address as assigned .....
  • /etc/ethers

    Put into this the client's ethernet address :

    # cat /etc/ethers
    08:00:20:fe:4a:fb warspite

    On a SPARC box the MAC is displayed upon boot (even if the machine hasn't got an operating system!) - just write it down!
  • /etc/bootparams

    I got the following to work:

    # cat /etc/bootparams

    warspite root=ben:/home/jumpstart/install/Solaris_10/Tools/Boot \ install=ben:/home/jumpstart/install \
    boottype=:in \
    rootopts=ben:rsize=8192,wsize=8192
  • /etc/exports

    Setup the NFS shares:

    /home/jumpstart/install 192.168.1.70(ro,no_root_squash,async,no_subtree_check)

    There is a known issue about compatibility between Solaris and Linux versions of NFS so it is necessary to disable NFS v4 on the Linux box ....

    # cd /etc/default

    vi nfs-kernel-server

    Change the first entry to this:

    # Number of servers to start up
    RPCNFSDCOUNT='8 --no-nfs-version 4'

    bounce nfs in /etc/init.d

    That solved a major issue.

    Don't forget to run exportfs -a

  • Configuring entry in /tftpboot

    This is where it gets fun. The file inetboot needs to be copied into /tftpboot. However which file to copy depends on the platform:

    /home/jumpstart/install/Solaris_10/Tools/Boot/platform/sun4u/inetboot
    /home/jumpstart/install/Solaris_10/Tools/Boot/platform/sun4us/inetboot
    /home/jumpstart/install/Solaris_10/Tools/Boot/platform/sun4v/inetboot

    The 420R is a sun4u so this is the file to copy :

    /home/jumpstart/install/Solaris_10/Tools/Boot/platform/sun4u/inetboot

    This file must be tailored to provde the IP address of the client. To do this convert the client's proposed IP address into hex:

    192.168.1.70 becomes C0A80146 (ignore the dots)

    In /tftpboot I created the following files and symlinks

    lrwxrwxrwx 1 root root 14 2009-04-26 12:47 C0A80145 -> inetboot.sun4u
    lrwxrwxrwx 1 root root 14 2009-04-26 12:47 C0A80145.SUN4U -> inetboot.sun4u
    -rw-r--r-- 1 root root 221280 2009-04-26 12:45 inetboot
    -rw-r--r-- 1 root root 221280 2009-04-26 12:46 inetboot.sun4u

    (The inetboot itself is not strictly necessary but I copied it over for good measure)

Now over to the Solaris box ....

Get to the ok prompt and enter:

boot net - text

At which point the machine should boot off the remote Linux box and Solaris 10 be installed ....

No comments: