Converting Solaris packages

The Solaris package commands (e.g., pkgproto, pkgadd, pkgtrans ) operate on two package formats. The first format is the “datastream” format. Packages created as datastream formatted packages use a single self contained file. This file includes the binary contents, application configuration files, and metadata to describe the package and installation process. The second format is the “file system format.” File system formatted packages contain hierarchical directory structures with all of the binaries, configuration, and metadata to describe the packages.

Both package formats can be installed with the pkgadd(1m) utility, and serve a unique purpose. Datastream formatted files are usually easier to distribute, since an archiving tool is removed from the installation/bundling process. File system formatted packages are nice to use with Solaris Jumpstart post install scripts, and make locating individual files within a package much easier.

The Solaris pkgtrans utility allows you to convert between both formats relatively easily. The following example takes a datastream formatted package, and converts it to a file system formatted package:

$ pkgtrans -o /tmp/RICHPse /var/tmp RICHPse

When pkgtrans is invoked with the “-s” option, packages can be converted from file system to datastream format:

$ pkgtrans -s /tmp /var/tmp/RICHPse.pkg RICHPse

A lot of people complain about Sun packages, but I find them easy to build, manage, and support.

This article was posted by Matty on 2005-02-20 23:35:00 -0400 -0400