The versions of core operating system packages that can be installed in an image are controlled by the pkg:/entire incorporation package. To control system upgrades, create a package that specifies a particular version of the pkg:/entire package as an incorporate dependency.
The following example shows a manifest named upgradectrl.p5m for a custom incorporation package that controls the version of the pkg:/entire package that can be installed. Some of the settings in this manifest are described below.
set name=pkg.fmri [email protected] set name=pkg.summary value="Incorporation to constrain the version of the OS" set name=pkg.description value="This package controls the version of \ pkg://solaris/entire that can be installed." set name=info.classification value="org.opensolaris.category.2008:Meta Packages/Incorporations" set name=pkg.depend.install-hold value=core-os set name=variant.opensolaris.zone value=global value=nonglobal set name=variant.arch value=sparc value=i386 depend fmri=feature/package/dependency/self type=parent variant.opensolaris.zone=nonglobal depend fmri=pkg://solaris/entire type=require depend fmri=pkg://solaris/[email protected],5.11-0.175.1.0 type=incorporate
If a user enters the pkg update upgradectrl command, the pkg:/entire package is automatically updated as well.
This package can be installed in both global and non-global zones. See also the description of the parent dependency.
This package can be installed on both SPARC and x86 systems.
This package can be installed in a non-global zone only if it is already installed in the global zone.
The upgradectrl package can be installed only if the pkg://solaris/entire package is already installed or can be installed in this same operation.
The pkg://solaris/entire package must be installed at the specified version. More than one version can satisfy an incorporate dependency, depending on how many places of accuracy are specified. In this example, 0.175.1.0 specifies Oracle Solaris 11.1 SRU 0. This upgrade control package will keep systems at Oracle Solaris 11.1 with no support updates. This upgrade control package will, however, allow packages that are not constrained by the pkg:/entire incorporation to be updated.
Publish the upgradectrl package to a local file-based repository. This repository is for developing and testing this new package. If you create a repository for general use, you should include additional steps such as creating a separate file system for the repository. For information about creating package repositories for general use, see Copying and Creating Package Repositories in Oracle Solaris 11.2 .
Create a package development repository on your system. See the pkgrepo(1) man page for more information about the pkgrepo command.
$ pkgrepo create myrepo
Set the default publisher for this repository. The default publisher is the value of the publisher/prefix property of the repository.
$ pkgrepo -s myrepo set publisher/prefix=site
Publish the upgradectrl package to the development repository.
$ pkgsend -s myrepo publish upgradectrl.p5m pkg://site/[email protected],5.11:20131104T072336Z PUBLISHED
Notice that the repository default publisher has been applied to the package FMRI.
Examine the repository to confirm that the package was published.
$ pkgrepo -s myrepo list PUBLISHER NAME 0 VERSION site upgradectrl 1.0,5.11:20131104T072336Z $ pkg list -vg myrepo FMRI IFO pkg://site/[email protected],5.11:20131104T072336Z ---
Deliver the package to a local repository in a separate ZFS file system in a shared location.
$ pkgrecv -s myrepo -d /export/IPSpkgrepos/Solaris upgradectrl Processing packages for publisher site ... Retrieving and evaluating 1 package(s) ... PROCESS ITEMS GET (MB) SEND (MB) Completed 1/1 0.0/0.0 0.0/0.0
Verify the package in the repository and the version of pkg:/entire that it incorporates.
$ pkg info -g /export/IPSpkgrepos/Solaris upgradectrl Name: upgradectrl Summary: Incorporation to constrain the version of the OS Description: This package controls the version of pkg://solaris/entire that can be installed. Category: Meta Packages/Incorporations State: Not installed Publisher: site Version: 1.0 Build Release: 5.11 Branch: None Packaging Date: November 20, 2013 01:01:05 AM Size: 0.00 B FMRI: pkg://site/[email protected],5.11:20131120T010105Z $ pkg contents -Hro fmri -t depend -a type=incorporate upgradectrl pkg://solaris/[email protected],5.11-0.175.1.0
See Creating and Publishing a Package in Packaging and Delivering Software With the Image Packaging System in Oracle Solaris 11.2 for more detailed information about creating and delivering IPS packages.
Set the origin for the site publisher. The system repository is automatically updated with this information so that non-global zones can access packages from the site publisher.
$ pkg set-publisher -g /export/IPSpkgrepos/Solaris site $ pkg publisher PUBLISHER TYPE STATUS P LOCATION solaris origin online F https://pkg.oracle.com/solaris/support/ site origin online F file:///export/IPSpkgrepos/Solaris/