|
|
Solaris Package CompanionThe Solaris Package Companion is a small Korn shell script that allows you to ask quite a number of interesting questions about the relationships between Solaris metaclusters, clusters and packages as well as their respective dependencies. Very often, answers to these kinds of questions are essential for the construction of minimized systems as well as more generally for OS golden images. The goal of the Solaris Package Companion, or SPC for short, is to do all of the hard work so you don't have to. SPC will create a cache of important facts by mining information from the various packaging files and directories to allow you to quickly and easily obtain answers to a variety of questions such as:
Note that this tool is provided to the community for its use, but it is not officially supported by Sun. Downloading the ToolThe current version of the Solaris Package Companion is v0.8.1. The MD5 fingerprint for this file is:
Special thanks to Clive King for pointing out a bug in the recently released 0.8 version related to the processing of local system package information. This bug has been fixed in version 0.8.1 and no other changes were introduced in this release. Thanks also to Peter Pickford (for pointing out a case where not all package dependencies were being captured) and Fredrich Maney (for contributing the new tree display options). In addition to these enhancements, a little code cleanup was also incorporated into this release. An older version of the tool is available in case there are any problems with the current version. The MD5 fingerprint for version 0.7 is:
The information below assumes that you are using the latest version of the tool. Installing the ToolThe Solaris Package Companion is just a single shell script and can be installed into any directory location. Permissions typically should be:
Using the ToolThe following is the list of options supported by the Solaris Package Companion:
Before you can use the tool for the first time, you must create its package information cache. By default, the information cache contains information regarding packaging relationships, dependencies, names and even which files are contained within each package. Collecting this amount of information can generate a cache of over 30M and take several minutes to complete. If you are sure you do not need this much information, you can adjust one of the COLLECT_ variables inside of the program. The smallest cache (with no names, dependencies, or package maps) is roughly 4MB. In general, it is recommended that the settings remain unmodified so that the complete set of functionality is enabled. This is also why no public interface has been provided to adjust these settings. Note that the repository need only be created once (for each distribution you want to inspect) so the impact should be minimal both in terms of time and disk space. The information cache can be created in one of two ways depending on what you would like to accomplish. First, if you would like to create a cache based on Solaris installation media, then you should use the following command:
This will create a cache based on the Solaris OS media found at the location specified by the
In this case, it leverages information found on the currently installed system to create its cache (stored in ./myrepository). Note that since each cache is specified by name, there is nothing to stop you from having multiple caches for different systems, versions of the operating system, etc. The time to create the cache will vary depending on the media being read as well as the performance of the system on which it is being created. Initial testing showed that the time could range from 10 to 30 minutes. Once the cache is created, it will not need to be created nor modified again so this is a one time penalty as noted above. ExamplesThe following are just a few examples to illustrate how the SPC tool can be used to answer some very interesting packaging questions. We would love to hear about other uses and requirements in this space, so please forward your ideas and feedback along! Each of these examples was generated using the most recent version of the tool against a Solaris 10 05/08 (Update 5, build 10) repository. Each of these examples should work with other versions of the Solaris OS including newer Nevada builds. What packages are in cluster SUNWCssh?
In addition, you can always get more information by specifying the
Updated in this release is the tag before the item name to inform the user of the type of object being dispayed. [P] indicates a package while [C] is a cluster and [M] is a metacluster. In previous releases this was placed between the item name and item description. Also new in this release is the ability to display information in a tree view. What packages are in cluster SUNCssh (tree view)?
Similar questions can be asked of metaclusters as well:
Thanks to Fredrich Maney for contributing code to implement these functions. In what metaclusters is the SUNWsshdr package found?
On what packages does the SUNWsshdu package depend?
Another new feature is the ability to fold packages back into their respective clusters (where possible). This can be helpful when trying to create a complete list of items for a standard OE image or JumpStart configuration. This can be accomplished using the '-F' (folding) option:
In this case, several of the packages were able to be folded into their respective clusters leaving just a handful of individual packages. These packages do not belong to any existing software cluster. Which package contains the file /usr/sbin/zic?
Which package cluster contains the file /usr/sfw/lib/libcrypto.so?
Which packages depend on the SUNWmfrun package?
This option can also take advantage of the folding (-F) option to merge packages back into their respective clusters (if applicable):
Testing the ToolAfter some reworking, I have also released version 0.1 of the Solaris Package Companion Testing Tool, spc-test-v0.1.sh. This tool is fairly configurable, allowing you to test multiple versions of the tool against multiple repositories. There are currently 48 tests although tests can be easily added or removed as needed. It can optionally display the results to the screen, but by default it records them in a directory where a basic consistency check is performed to detect differences in output (for the same repository) resulting from the use of different versions of the tool. This is not intended to be an all encompassing test suite, but rather a basic sanity check to make sure the key functions are working as expected. Project Lead(s)Acknowledgements
Additional References |