Solaris Package Companion
By gbrunett on Jun 22, 2006
There is just so much to say and so very little time to say it. Today, I would like to steal away a few minutes to announce a new tool that I had created recently while working on some minimization efforts. I finally got completely sick and tied of having to mine through the .clustertoc, pkgmap, and depend files for everything that I needed. So, being an engineer at heart, I eliminated complexity through automation! ;-)
Without further ado, please allow me to introduce you to the Solaris Package Companion (or SPC). SPC allows you to ask quite a number of interesting questions about the relationships between Solaris metaclusters, clusters and packages as well as their dependencies. Certainly useful for those considering deploying reduced or minimal Solaris OS installations which is why I wanted to share this new tool with you.
The goal of SPC is to do all of the hard work, trolling through the various packaging files and directories in order to create a small cache that allows you to quickly and easily obtain answers to a variety of questions such as:
To display the list of packages contained in the specified cluster(s). -c [package cluster list] To display the metacluster(s) that contain the specified cluster(s). -C [package cluster list] To display the dependencies for the specified package(s). -d [package list] To display the dependencies for the specified cluster(s). -D [package cluster list] To evaluate install packages on a system against a specified metacluster. -e [meta cluster] To display the packages contained in the specified metacluster(s). -m [meta cluster list] To display the clusters contained in the specified metacluster(s). -M [meta cluster list] To display the cluster that contains the specified package(s). -p [package list] To display the metacluster(s) that contain the specified package(s). -P [package list] To display the list of packages that depend on the specified package(s). -z [package list]Upon first invokation, the tool creates a small cache (called the repository) whose location is determined by the -r command line option. The size of this cache is rather small, typically around four or five Mbytes. The time that it takes to create this cache will vary, but in my testing it was about four to five minutes. Believe me, this is a small price to pay for the speed once the cache is created. Note that you should avoid using SPC over NFS links as that will increase the time it takes to create the initial cache.
SPC supports several general options:
-h, -? [show help] -l [local mode - use local system repositories and data] -r [repository location] -s [solaris distribution location] -v [show package details]Local mode simply uses the current system as its source of information rather than a separate installation image (as would be specified by the -s option. The -r option, discussed earlier, specifies the location of the SPC repository or cache. The -v option is your typical verbose mode that provides descriptions for each of the metaclusters, clusters and packages listed.
So, now that you get the basics, let's show some of this in action. The first thing we will do is display the package dependency listing for the SUNWsshdu package:
$ ./spc-v0.4.ksh -r /tmp/gmb -s /export/install/images/s10u1/Solaris_10/Product -v -d SUNWsshdu SUNWcakr Core Solaris Kernel Architecture (Root) SUNWcar Core Architecture, (Root) SUNWckr Core Solaris Kernel (Root) SUNWcnetr Core Solaris Network Infrastructure (Root) SUNWcsd Core Solaris Devices SUNWcsl Core Solaris, (Shared Libs) SUNWcsr Core Solaris, (Root) SUNWcsu Core Solaris, (Usr) SUNWgss GSSAPI V2 SUNWgssc GSSAPI CONFIG V2 SUNWkvm Core Architecture, (Kvm) SUNWopenssl-libraries OpenSSL Libraries (Usr) SUNWsshcu SSH Common, (Usr) SUNWsshdr SSH Server, (Root) SUNWzlib The Zip compression libraryAnother interesting question is to ask which packages depend on a specified package, in this case SUNWzlib:
zoey:/tmp 143 $ ./spc-v0.4.ksh -r /tmp/gmb -v -z SUNWzlib IPLTadcon IPLTadmin IPLTcadcon IPLTcadmin IPLTjadcon IPLTjadmin JSatsvw SUNW5ttf SUNW5ttfe SUNW5xfnt SUNW5xmft SUNWTk [....many more entries removed for brevity...]Note that once the repository is created, you do not need to specify the -s option.
Well, that is it for now. I have another tool that I want to post and I hope to do so in the next day or two. At any rate, I would love to hear from people who use this tool or find it interesting. As always, if you find a bug or think up a cool enhancements, please drop me a note as well.