Menu

How to Publish Your Own IPS Packages

Welcome back! This is the last of my three-part mini-series on IPS, the Image Packaging System, for Oracle Solaris 11. The topic of “How to Publish Your Own IPS Packages” builds upon the structure and information contained in Part 1 and Part 2. In Part 3, I will cover how to build your own IPS package, create a second local IPS repository for your own packages, publish the package to your repository, and test the pkg install process for the package.

As background information, we already have a system hosting the Oracle Solaris 11 (snv_167) IPS repository with an AI service properly configured. We will not need the AI service for this topic. However, keep in mind it is possible to customize your XML based AI manifest files to use the new IPS repository we will create here to automatically install your own IPS packages during a new system install. Also, remember we have already created a top-level ZFS file system, rpool/IPS mounted at /IPS as a step in Part 1. We begin by creating a new ZFS file system as a home for our packaging playground and for our new IPS repository.

Now, we will go ahead and create our own IPS repository using the name of mycompany and the location of /IPS/myrepo. We will also set our repository to have it’s own port for remote access via HTTP, so as not to interfere with our default IPS repository. We do this by first verifying the port on our default repository and then creating our new one.

To keep our packaging process and naming schemes simple we will now create a sub directory called mypackage and create the files we need for our package. For mypackage, I am using the contents of an old package I created in Perl for some Oracle VM Server for SPARC (LDom) automation. However, you may use any type of files, symbolic links, or directories you need for your own package.

Now that we’ve painstakingly developed all of our code, created the directory structures, and placed them into our mypackge package directory, we need to create our package manifest using the pkgsend generate command.

From the output above, we can see our local file structure matches the path to which they will be installed. Additionally, the pkgsend generate command also picked up our permissions (almost). It did get our file & directory modes correct, but the group ownerships need some adjusting and we need to eliminate the directories delivered by the SUNWcs package (/etc & /opt) so we don’t infringe on changes we should not own. We can do this by hand with an editor, but it’s much simpler to use pkgmogrify to automate the transformations using a transform file to ease the burden of package automation and eliminate potential mistakes. Refer to the pkgmogrify man page for details.

We can see our new manifest file now contains dependencies which we must resolve (noted by TBD in the fmri). In this particular case, our file /opt/WFBldom/bin/adddisks.sh has a dependency on the file /usr/bin/bash and our other two files have a dependency upon /usr/bin/perl. We need to automatically resolve these dependencies using the pkgdepend resolve command. This command will create a new, resolved manifest file with “.res” appended to our manifest name which allows multiple packages to be resolved at once. Additionally, this command may take a few moments to run, so be patient here.

Notice how the output above (same grep command as before on the “.res” file) resolved all of our dependencies down to only two packages. This is because all of my files for mypackage only contained BASH or Perl code. Your dependencies will vary based on the contents and specifics of your package. Now, let’s publish our package to the mycompany IPS repository we created at the beginning. To do this, we will use the pkgsend publish command providing the mypackage package version and the Solaris 11 build to which it can be applied (minimum build version). In this example we will use mypackage version 1.0.0 and 0.167 for the Solaris 11 build version, which can be verified with the pkg list kernel output.

With our new package published to an IPS repository available via HTTP, we can now query and install our package from another Solaris 11 system remotely. However, to do this, we will need to add our repository as a publisher on the remote system. Let’s do it.

There you have it. To recap, we created our own IPS repository called mycompany, our own mypackage package, published it, and installed it from a remote system. This wraps up the three-part mini-series on IPS for Oracle Solaris 11. I hope all of the examples provided in Part 1, Part 2, and Part 3 of this series has helped you gain a better understanding of IPS. I covered a lot of ground in only a few examples, so use the man pages to fill in the gaps as well as the documentation as needed.

Share this:

Like this:

Brad Hudson is an Established Leader in IT Infrastructure, Engineering, Operations, and Customer Service with extensive experience developing and delivering infrastructure solutions, building and growing customer service organizations, leading change initiatives, providing data center management, and managing implementation activities.

Brad Hudson is an Established Leader in IT Infrastructure, Engineering, Operations, and Customer Service with extensive experience developing and delivering infrastructure solutions, building and growing customer service organizations, leading change initiatives, providing data center management, and managing implementation activities.[Read More...]