Building a minimal Solaris jumpstart profile
November 22nd, 2007So I’ve spent this week off from work, and I have been spending my time working on building a jumpstart environment to deploy a stack of hosts into VMWare, so as I can build various kinds of Solaris hosts, including LDAP replicas (Directory Server 6.2), Mail stores and gateways using Sun Cluster and Messaging Server 6.3, and Oracle RAC on Sun Cluster.
I thought I’d give you some code I’ve written (its spectacularly awful code, but it works and works quickly) to build a minimal Solaris profile. The whole idea is to use SUNWCreq as your base for your profile, and only add packages you want from there. It makes my build around 730meg with all the stuff I need to run Sun Cluster and a bunch of utilities I find handy, without all the additional stuff that I won’t be using at this point in time.
To use this utility you will need to know the name of the package, and be running this on a Solaris host that actually has the package installed (in this case I’m running it on my jumpstart server, which is built using SUNWCXall – that is, everything). On a host like this you can locate the name of the package you are after by finding a known file from the package in /var/sadm/install/contents. eg.
bash-3.00# grep /usr/bin/bash /var/sadm/install/contents /usr/bin/bash f none 0555 root bin 611132 31995 1178118881 SUNWbash
Then you can use:
java SPDB SUNWbash
to get a profile-friendly output of all SUNWbash’s dependecies, excluding those already in SUNWCreq.
To build a reasonably minimised host ready for Sun Cluster 3.1u4, using Solaris 10 u3, with utilities I like to have installed (including the SUNWinst package so I can take a flar at the end and gcc if I’d like to do some compiling):
java SPDB SUNWgcc SUNWgmake SUNWhea SUNWluzone SUNWman SUNWpl5u SUNWpool SUNWsshcu \
SUNWsshdr SUNWsshu SUNWsshdu SUNWvolu SUNWvolr SUNWwgetr SUNWwgetu SUNWzoneu \
SUNWzoner SUNWzfsu SUNWzfsr SUNWbind SUNWdhcsu SUNWdhcsr SUNWinst SUNWbash \
SUNWtcatu SUNWcacaort > /var/tmp/pkgList
Then use that output in a profile you might have something like:
install_type initial_install system_type standalone # start with the minimal required number of packages cluster SUNWCreq
#additional packages
<INSERT package list here, in vi use:
:r /var/tmp/pkgList
to read it in>
#patches
patch 118855-36 nfs 10.0.0.1:/jumpstart/patches
# format the entire disk for Solaris fdisk all solaris all
# define how the disk is partitioned boot_device any update partitioning explicit filesys rootdisk.s0 4096 / filesys rootdisk.s1 2048 swap filesys rootdisk.s3 512 /globaldevices filesys rootdisk.s4 free /var
for example.
You can get my first cut of the code here: http://unixsysadmin.net/files/SPDB.class
Its so dodgy that I haven’t even packaged it up. I will make it much more useable in future (differing repositories of information, find dependencies based on the binary/file you’re after, so you need not know package names and so on).
Some might say there is a tool that does what I required and perhaps a much better job (http://blogs.sun.com/gbrunett/entry/solaris_package_companion for example). I haven’t used this tool, and to be honest I wanted to learn some more about how the package dependency structure worked in Solaris, so this was for both my own learning, and immediate need of having a minimal install of solaris, with just what I need – to basically reduce jumpstart host deployment time.
NOTES:
-SPDB stands for Solaris Profile Dependency Builder. I think I’ll change that when I come up with a good name. Enjoy!
-Java 1.5 is required for this package to work correctly