Showing and Changing Variant Values
Most variants have descriptive values. For example, the value of variant.arch
can be i386
or sparc
. The value of a variant tag on an action in a package manifest must match the value of the corresponding variant property in the image in order for that action to be installed. The arch
and zone
variant property values are set by the program that creates the image and installs its initial content; these values cannot be changed.
Values of variant.debug.*
variants and values of unknown variants can only be true
or false
and are false
in the image by default. An unknown variant is a variant that is introduced as a variant tag on an action in a package manifest, not known at the time the image was created.
If both debug and non-debug versions of an action are delivered, both versions must have the applicable debug
variant tag explicitly set, as shown in the following example. In this example, if debug.osnet
is false
in the image, then the non-debug version of this file is installed; if debug.osnet
is true
in the image, then the debug version of this file is installed. Usually debug versions of a file also have variant.arch
tags.
file payload chash=hash group=sys mode=0644 overlay=allow owner=root path=etc/motd pkg.csize=116 pkg.size=106 preserve=true variant.debug.osnet=true file payload chash=hash group=sys mode=0644 overlay=allow owner=root path=etc/motd pkg.csize=70 pkg.size=50 preserve=true variant.debug.osnet=false
Use the pkg variant
command to display the values of variant properties that are set in the image.
$ pkg variant
VARIANT VALUE
arch i386
opensolaris.zone global
Use the -a
option to display the values of all variants that are explicitly set in the image and all variants that are set in installed packages.
$ pkg variant -a
VARIANT VALUE
arch i386
debug.container false
debug.osnet false
opensolaris.zone global
Use the -v
option to display all possible variant values that can be set for installed packages.
$ pkg variant -v
VARIANT VALUE
arch i386
arch sparc
debug.container false
debug.container true
debug.osnet false
debug.osnet true
opensolaris.zone global
opensolaris.zone nonglobal
Use the pkg change-variant
command to change the value of a variant property. Use the pkg variant -v
command to select a value to set.
Note:
Changing variant property values might update a large number of packages and might require a new BE. Use the-nv
options to review what changes will be made before you make any changes.
In the following command, a new BE would be created. See Boot Environment Policy Image Properties for information about when BEs are created. When a new BE is created, the current BE is not changed; boot to the new BE to use the debug files in this example. The -n
option shows what would change if you performed the operation without -n
, but the command makes no actual changes. No new BE was created in this example.
$ pkg change-variant -nv variant.debug.osnet=true
Packages to change: 232
Variants/Facets to change: 1
Estimated space available: 306.74 GB
Estimated space to be consumed: 1.49 GB
Create boot environment: Yes
Activate boot environment: Yes
Create backup boot environment: No
Rebuild boot archive: Yes
Changed variants/facets:
variant debug.osnet: true
Changed packages:
solaris
...
Editable files to change:
Update:
etc/motd