As bug #10997 says, pkg change-variant debug would be really cool.
All the bits required to do this are present already, because it’s conceptually the same as the x86/sparc fat packages, and you could just as easily (if time-consumingly) build x86/sparc/debug/non-debug fatter packages by adding another level of indirection.
As a fairly hacky way to attempt this, clone a copy of the on_ips (/hg/pkg/on_ips) and pkg (/hg/pkg/gate) gates. You’ll need the pkg gate, because the scripts to do the merging and publishing conveniently aren’t delivered to the system.
Run a complete build of on_ips, including packages. (that is with p and D in NIGHTLY_OPTIONS and F not).
Start depots for the debug and non-debug bits:
/usr/lib/pkg.depotd -d $CODEMGR_WS/packages/${MACH}/nightly \
-p 13000 --add-content
/usr/lib/pkg.depotd -d $CODEMGR_WS/packages/${MACH}/nightly-nd \
-p 13001 --add-content
Merge the manifests from the two repos:
python2.6 path/to/pkg/gate/src/util/publish/merge.py -r \
-d repo_merge \
-v true,http://localhost:13000 \
-v false,http://localhost:13001 \
debug consolidation/osnet/osnet-incorporation
Publish the resulting fat packages to yet-another repository:
pkgsend -s file://$CODEMGR_WS/packages/${MACH}/nightly-fat \
create-repository --set-property publisher.prefix=on-nightly
for pkg in repo_merge/*; do
ksh path/to/pkg/gate/src/util/publish/pkg_publish $pkg \
file://$CODEMGR_WS/packages/${MACH}/nightly-fat
done
On x86 (the only arch I’ve tried), a handful of packages will fail here complaining that renamed packages must have at least one depend action, which, most confusingly, they do; I haven’t looked into why this is yet.
This is also, probably, going to take a considerable amount of time, so instead you may want to copy pkg_publisher to a temporary directory, and add the --no-index and --no-catalog flags to the last line:
pkgsend -s $repo close --no-index --no-catalog
And when the loop is complete run:
pkgsend -s file://$CODEMGR_WS/packages/${MACH}/nightly-fat refresh-index
Fire up a depotd to serve your new fat packages to clients (using the --add-content flag, if you altered pkg_publish above):
/usr/lib/pkg.depotd -d $CODEMGR_WS/packages/${MACH}/nightly-fat \
-p 13002 --add-content
On the test machine you wish to use this bits, add your on-nightly publisher as normal for on_ips. Then add a debug=false entry to the [variants] section of /var/pkg/cfg_cache (I have no idea what the correct way to introduce a new variant is, but this ain’t it.)
image-update to your own, non-debug bits, as normal.
Take a look at what will be done, the important will be at the end, when it displays the change in the set of variants and facets and their values:
pkg change-variant -nv debug=true
Finally, switch to your new bits:
pkg change-variant --be-name my-debug-bits debug=true
(Though the --be-name argument may not be honoured, see bug #13305, which I just filed about this)