xref: /onnv-gate/usr/src/pkg/README.pkg (revision 11838)
1*11838SLiane.Praza@Sun.COM#
2*11838SLiane.Praza@Sun.COM# CDDL HEADER START
3*11838SLiane.Praza@Sun.COM#
4*11838SLiane.Praza@Sun.COM# The contents of this file are subject to the terms of the
5*11838SLiane.Praza@Sun.COM# Common Development and Distribution License (the "License").
6*11838SLiane.Praza@Sun.COM# You may not use this file except in compliance with the License.
7*11838SLiane.Praza@Sun.COM#
8*11838SLiane.Praza@Sun.COM# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*11838SLiane.Praza@Sun.COM# or http://www.opensolaris.org/os/licensing.
10*11838SLiane.Praza@Sun.COM# See the License for the specific language governing permissions
11*11838SLiane.Praza@Sun.COM# and limitations under the License.
12*11838SLiane.Praza@Sun.COM#
13*11838SLiane.Praza@Sun.COM# When distributing Covered Code, include this CDDL HEADER in each
14*11838SLiane.Praza@Sun.COM# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*11838SLiane.Praza@Sun.COM# If applicable, add the following below this CDDL HEADER, with the
16*11838SLiane.Praza@Sun.COM# fields enclosed by brackets "[]" replaced with your own identifying
17*11838SLiane.Praza@Sun.COM# information: Portions Copyright [yyyy] [name of copyright owner]
18*11838SLiane.Praza@Sun.COM#
19*11838SLiane.Praza@Sun.COM# CDDL HEADER END
20*11838SLiane.Praza@Sun.COM#
21*11838SLiane.Praza@Sun.COM
22*11838SLiane.Praza@Sun.COM#
23*11838SLiane.Praza@Sun.COM# Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24*11838SLiane.Praza@Sun.COM# Use is subject to license terms.
25*11838SLiane.Praza@Sun.COM#
26*11838SLiane.Praza@Sun.COM
27*11838SLiane.Praza@Sun.COMIntroduction
28*11838SLiane.Praza@Sun.COM------------
29*11838SLiane.Praza@Sun.COM
30*11838SLiane.Praza@Sun.COMThis README describes some basics about creating, modifying, and
31*11838SLiane.Praza@Sun.COMbuilding packages in ON.  All package creation in ON is done using
32*11838SLiane.Praza@Sun.COMtools available to our customers.  If terminology in this document
33*11838SLiane.Praza@Sun.COMis confusing, you may wish to review the pkg(5) manpage.
34*11838SLiane.Praza@Sun.COM
35*11838SLiane.Praza@Sun.COMPackaging Overview
36*11838SLiane.Praza@Sun.COM------------------
37*11838SLiane.Praza@Sun.COM
38*11838SLiane.Praza@Sun.COMusr/src/pkg/ contains the definitions and rules needed to build
39*11838SLiane.Praza@Sun.COMa set of IPS repositories which contain the deliverables from an
40*11838SLiane.Praza@Sun.COMON build.
41*11838SLiane.Praza@Sun.COM
42*11838SLiane.Praza@Sun.COMThe manifests directory contains all manifests, and has one file
43*11838SLiane.Praza@Sun.COMper package.  For most packaging changes you only need to add or
44*11838SLiane.Praza@Sun.COMchange the packaging manifests themselves.
45*11838SLiane.Praza@Sun.COM
46*11838SLiane.Praza@Sun.COMThe build rules create two repositories.  These are both built
47*11838SLiane.Praza@Sun.COMfor DEBUG and non-DEBUG, and are thus available at
48*11838SLiane.Praza@Sun.COM    $CODEMGR_WS/packages/$MACH/nightly[-nd]/repo.(extra|redist)
49*11838SLiane.Praza@Sun.COM
50*11838SLiane.Praza@Sun.COM	repo.redist
51*11838SLiane.Praza@Sun.COM	    Contains the bulk of ON, and is what is delivered to the
52*11838SLiane.Praza@Sun.COM	    main OpenSolaris 'dev' and 'release' repositories.  All
53*11838SLiane.Praza@Sun.COM	    components delivered there must be redistributable.
54*11838SLiane.Praza@Sun.COM
55*11838SLiane.Praza@Sun.COM	repo.extra
56*11838SLiane.Praza@Sun.COM	    Is only built for Closed builds, and contains
57*11838SLiane.Praza@Sun.COM	    non-redistributable (without a proper legal agreement) pieces
58*11838SLiane.Praza@Sun.COM	    which may or may not be suitable for inclusion in the
59*11838SLiane.Praza@Sun.COM	    pkg.sun.com/opensolaris/extra repository, including the
60*11838SLiane.Praza@Sun.COM	    SUNWcryptoint bits necessary for working crypto in a Closed
61*11838SLiane.Praza@Sun.COM	    build.  Do not distribute any of the bits in repo.extra
62*11838SLiane.Praza@Sun.COM	    without prior agreement from the appropriate lawyers.
63*11838SLiane.Praza@Sun.COM
64*11838SLiane.Praza@Sun.COMBuilding Packages
65*11838SLiane.Praza@Sun.COM-----------------
66*11838SLiane.Praza@Sun.COM
67*11838SLiane.Praza@Sun.COMThe -p option to nightly will build the IPS repositories.
68*11838SLiane.Praza@Sun.COM
69*11838SLiane.Praza@Sun.COMAlternatively, in usr/src/pkg/Makefile there are make targets for:
70*11838SLiane.Praza@Sun.COM
71*11838SLiane.Praza@Sun.COM	all
72*11838SLiane.Praza@Sun.COM	    Process manifests into their final form with unresolved
73*11838SLiane.Praza@Sun.COM	    dependencies before publication.
74*11838SLiane.Praza@Sun.COM
75*11838SLiane.Praza@Sun.COM	install
76*11838SLiane.Praza@Sun.COM	    Publish packages.
77*11838SLiane.Praza@Sun.COM
78*11838SLiane.Praza@Sun.COM	gendeps
79*11838SLiane.Praza@Sun.COM	    Run `pkgdepend resolve`.  See Dependencies section.
80*11838SLiane.Praza@Sun.COM
81*11838SLiane.Praza@Sun.COM	protocmp
82*11838SLiane.Praza@Sun.COM	    Compare the proto area against package definitions for
83*11838SLiane.Praza@Sun.COM	    missing or incorrect files.
84*11838SLiane.Praza@Sun.COM
85*11838SLiane.Praza@Sun.COM	pmodes
86*11838SLiane.Praza@Sun.COM	    Check file and directory modes for best practices.
87*11838SLiane.Praza@Sun.COM
88*11838SLiane.Praza@Sun.COM	check
89*11838SLiane.Praza@Sun.COM	    Run protocmp and pmodes.
90*11838SLiane.Praza@Sun.COM
91*11838SLiane.Praza@Sun.COMThe build behavior may modified by the following variables:
92*11838SLiane.Praza@Sun.COM
93*11838SLiane.Praza@Sun.COM	CLOSED_IS_PRESENT
94*11838SLiane.Praza@Sun.COM	    If CLOSED_IS_PRESENT is set to "yes," repo.extra will be built.
95*11838SLiane.Praza@Sun.COM
96*11838SLiane.Praza@Sun.COM	ON_CRYPTO_BINS or CODESIGN_USER
97*11838SLiane.Praza@Sun.COM	    If ON_CRYPTO_BINS or CODESIGN_USER is set in your build env,
98*11838SLiane.Praza@Sun.COM	    no packages will depend on the internal crypto certificates.
99*11838SLiane.Praza@Sun.COM	    If neither is set, your bits depend on the internal crypto
100*11838SLiane.Praza@Sun.COM	    certificates being available and packages will depend on
101*11838SLiane.Praza@Sun.COM	    pkg:/driver/crypto/dprov, which is only available in the
102*11838SLiane.Praza@Sun.COM	    on-extra repository.
103*11838SLiane.Praza@Sun.COM
104*11838SLiane.Praza@Sun.COM	SUPPRESSPKGDEP
105*11838SLiane.Praza@Sun.COM	    If SUPPRESSPKGDEP is set to "true" in your environment,
106*11838SLiane.Praza@Sun.COM	    package dependencies will not be generated.  This variable
107*11838SLiane.Praza@Sun.COM	    should not be set in normal builds as it will mask product
108*11838SLiane.Praza@Sun.COM	    bugs.
109*11838SLiane.Praza@Sun.COM
110*11838SLiane.Praza@Sun.COM	PKGDEBUG
111*11838SLiane.Praza@Sun.COM	    If PKGDEBUG is set in your environment, $MAKE will print
112*11838SLiane.Praza@Sun.COM	    detailed information about the commands it executes to
113*11838SLiane.Praza@Sun.COM	    process and publish packages.
114*11838SLiane.Praza@Sun.COM
115*11838SLiane.Praza@Sun.COM	ONNV_BUILDNUM
116*11838SLiane.Praza@Sun.COM	    If ONNV_BUILDNUM is set to an older ON build number,
117*11838SLiane.Praza@Sun.COM	    your packages will be published at that version instead
118*11838SLiane.Praza@Sun.COM	    of the one defined in usr/src/Makefile.buildnum, which
119*11838SLiane.Praza@Sun.COM	    is managed by the gatekeepers.
120*11838SLiane.Praza@Sun.COM
121*11838SLiane.Praza@Sun.COMA set of intermediate build products are placed in
122*11838SLiane.Praza@Sun.COMusr/src/pkg/packages.$MACH/.  These can be useful during development.
123*11838SLiane.Praza@Sun.COM
124*11838SLiane.Praza@Sun.COM	.mog
125*11838SLiane.Praza@Sun.COM	    The resulting package manifest after running pkgmogrify(1)
126*11838SLiane.Praza@Sun.COM	    on the supplied manifest.  See below for details on
127*11838SLiane.Praza@Sun.COM	    pkgmogrify(1) use in ON.
128*11838SLiane.Praza@Sun.COM
129*11838SLiane.Praza@Sun.COM	.dep
130*11838SLiane.Praza@Sun.COM	    The resulting manifest after running `pkgdepend generate`
131*11838SLiane.Praza@Sun.COM	    on the .mog manifest.
132*11838SLiane.Praza@Sun.COM
133*11838SLiane.Praza@Sun.COM	.res
134*11838SLiane.Praza@Sun.COM	    The resulting manifest after running `pkgdepend resolve`
135*11838SLiane.Praza@Sun.COM	    on the .dep manifest.
136*11838SLiane.Praza@Sun.COM
137*11838SLiane.Praza@Sun.COMIncremental Builds
138*11838SLiane.Praza@Sun.COM------------------
139*11838SLiane.Praza@Sun.COM
140*11838SLiane.Praza@Sun.COM   If you want to process a subset of manifests, simply set PKGS on the
141*11838SLiane.Praza@Sun.COM   make command line and specify the "all" target.  If you want to process
142*11838SLiane.Praza@Sun.COM   them all, simply specify the "all" target.
143*11838SLiane.Praza@Sun.COM
144*11838SLiane.Praza@Sun.COM   	% dmake -e PKGS="BRCMbnx BRCMbnxe" all
145*11838SLiane.Praza@Sun.COM	% dmake -e all
146*11838SLiane.Praza@Sun.COM
147*11838SLiane.Praza@Sun.COM   If you want to publish a subset of packages, simply set PKGS on the
148*11838SLiane.Praza@Sun.COM   make command line and specify the "install" target.  Overriding PKGS
149*11838SLiane.Praza@Sun.COM   will cause dependency resolution to be limited to PKGS from the
150*11838SLiane.Praza@Sun.COM   current build, with a fallback to packages installed on the build
151*11838SLiane.Praza@Sun.COM   system.  If you want to publish them all, simply specify the
152*11838SLiane.Praza@Sun.COM   "install" target.
153*11838SLiane.Praza@Sun.COM
154*11838SLiane.Praza@Sun.COM   	% dmake -e PKGS="BRCMbnx BRCMbnxe" install
155*11838SLiane.Praza@Sun.COM	% dmake -e install
156*11838SLiane.Praza@Sun.COM
157*11838SLiane.Praza@Sun.COM   You can also use package names, or package names with ".pub"
158*11838SLiane.Praza@Sun.COM   extensions, as build targets.  This will cause processing or
159*11838SLiane.Praza@Sun.COM   publication of the specified package(s).
160*11838SLiane.Praza@Sun.COM
161*11838SLiane.Praza@Sun.COM   The on-disk repository will be initialized when it does not exist,
162*11838SLiane.Praza@Sun.COM   or when you run nightly -p.  If you build incrementally,
163*11838SLiane.Praza@Sun.COM   packages will simply be added to the existing repository.
164*11838SLiane.Praza@Sun.COM
165*11838SLiane.Praza@Sun.COM   To do cross-platform packaging, prefix your target with (for
166*11838SLiane.Praza@Sun.COM   example) "sparc/", as in "dmake sparc/install".  Note that we
167*11838SLiane.Praza@Sun.COM   currently pull some license files directly from a built source
168*11838SLiane.Praza@Sun.COM   tree, so if you do this in a workspace that had proto area copied
169*11838SLiane.Praza@Sun.COM   in via nightly -U, then you'll need to set $SRC to point to the
170*11838SLiane.Praza@Sun.COM   workspace that was actually built.
171*11838SLiane.Praza@Sun.COM
172*11838SLiane.Praza@Sun.COMTesting Packages
173*11838SLiane.Praza@Sun.COM----------------
174*11838SLiane.Praza@Sun.COM
175*11838SLiane.Praza@Sun.COMTo test the generated repositories, you should use the "onu" tool
176*11838SLiane.Praza@Sun.COMavailable from /opt/onbld/bin or usr/src/tools/scripts/ to setup and
177*11838SLiane.Praza@Sun.COMupgrade your system.  A manpage is available in /opt/onbld/man
178*11838SLiane.Praza@Sun.COMor usr/src/tools/scripts/onu.1.
179*11838SLiane.Praza@Sun.COM
180*11838SLiane.Praza@Sun.COMAlternatively, you can manually start a pkg.depot(1M) server to
181*11838SLiane.Praza@Sun.COMserve the generated repositories to multiple test machines.
182*11838SLiane.Praza@Sun.COM
183*11838SLiane.Praza@Sun.COM	Start up a depot on your build machine.
184*11838SLiane.Praza@Sun.COM	    cd $CODEMGR_WS/packages/$MACH/nightly[-nd]
185*11838SLiane.Praza@Sun.COM	    /usr/lib/pkg.depotd -d repo.redist -p <port> &
186*11838SLiane.Praza@Sun.COM
187*11838SLiane.Praza@Sun.COM	    Make SURE you choose an unused port and the depot
188*11838SLiane.Praza@Sun.COM	    starts successfully.
189*11838SLiane.Praza@Sun.COM
190*11838SLiane.Praza@Sun.COM	    The depot can be started across NFS as well if you
191*11838SLiane.Praza@Sun.COM	    have a fast pipe.
192*11838SLiane.Praza@Sun.COM
193*11838SLiane.Praza@Sun.COM	Configure your test system.
194*11838SLiane.Praza@Sun.COM	    pkg set-publisher -P -g http://<your server host>:<port> on-nightly
195*11838SLiane.Praza@Sun.COM	    pkg set-publisher --non-sticky opensolaris.org
196*11838SLiane.Praza@Sun.COM	    pkg uninstall entire
197*11838SLiane.Praza@Sun.COM
198*11838SLiane.Praza@Sun.COM	pkg image-update your test system.
199*11838SLiane.Praza@Sun.COM	    pkg image-update will upgrade all packages on your test system
200*11838SLiane.Praza@Sun.COM
201*11838SLiane.Praza@Sun.COMAlways make sure your bits are installed with image-update.
202*11838SLiane.Praza@Sun.COM	Check your versions.
203*11838SLiane.Praza@Sun.COM	    pkg info osnet-incorporation
204*11838SLiane.Praza@Sun.COM
205*11838SLiane.Praza@Sun.COM	Multiple packages should be updated.
206*11838SLiane.Praza@Sun.COM	    If you did a full build, all ON packages will be updated.
207*11838SLiane.Praza@Sun.COM	    When image-update tells you that only one or two packages has
208*11838SLiane.Praza@Sun.COM	    been updated, you likely did not get the updates you expected.
209*11838SLiane.Praza@Sun.COM
210*11838SLiane.Praza@Sun.COMThere are various tactics for troubleshooting a failed upgrade.
211*11838SLiane.Praza@Sun.COM	Make sure entire is uninstalled.
212*11838SLiane.Praza@Sun.COM
213*11838SLiane.Praza@Sun.COM	pkg install -nv osnet-incorporation@<your version>
214*11838SLiane.Praza@Sun.COM	    Ask IPS to explicitly check if ON can be installed, and
215*11838SLiane.Praza@Sun.COM	    if it can't, tell you why not.
216*11838SLiane.Praza@Sun.COM
217*11838SLiane.Praza@Sun.COM	Obsolete and renamed packages can cause trouble.
218*11838SLiane.Praza@Sun.COM	    pkg search -l ::pkg.renamed:true
219*11838SLiane.Praza@Sun.COM	    pkg search -l ::pkg.obsolete:true
220*11838SLiane.Praza@Sun.COM
221*11838SLiane.Praza@Sun.COMMaking Packaging Changes
222*11838SLiane.Praza@Sun.COM------------------------
223*11838SLiane.Praza@Sun.COM
224*11838SLiane.Praza@Sun.COMPackage definitions are in usr/src/pkg/manifests/, and have one
225*11838SLiane.Praza@Sun.COMfile per package, including for multi-architecture packages.  For
226*11838SLiane.Praza@Sun.COMmost packaging changes you only need to add or change the packaging
227*11838SLiane.Praza@Sun.COMmanifests themselves.  No packaging metadata may be kept outside of the
228*11838SLiane.Praza@Sun.COMmanifests. If you find yourself needing to modify usr/src/pkg/Makefile,
229*11838SLiane.Praza@Sun.COMyou're almost certainly doing something wrong.
230*11838SLiane.Praza@Sun.COM
231*11838SLiane.Praza@Sun.COMRemember that the "check" target is available to check many of
232*11838SLiane.Praza@Sun.COMyour packaging changes.
233*11838SLiane.Praza@Sun.COM
234*11838SLiane.Praza@Sun.COMWe run pkgmogrify(1) over the manifests before publication.  This
235*11838SLiane.Praza@Sun.COMallows us to apply a set of macros and package transformations in
236*11838SLiane.Praza@Sun.COMorder to make the manifests themselves easier to maintain.
237*11838SLiane.Praza@Sun.COM
238*11838SLiane.Praza@Sun.COMWe supply a set of commonly-used macros for use in package manifests.
239*11838SLiane.Praza@Sun.COMThese are the PKGMOG_DEFINES in usr/src/pkg/Makefile.
240*11838SLiane.Praza@Sun.COM
241*11838SLiane.Praza@Sun.COM	$(i386_ONLY)
242*11838SLiane.Praza@Sun.COM	$(sparc_ONLY)
243*11838SLiane.Praza@Sun.COM	$(ARCH)
244*11838SLiane.Praza@Sun.COM	$(ARCH32)
245*11838SLiane.Praza@Sun.COM	$(ARCH64)
246*11838SLiane.Praza@Sun.COM	$(PKGVERS), which is set to
247*11838SLiane.Praza@Sun.COM	   $(PKGVERS_COMPONENT),$(PKGVERS_BUILTON)-0.$(PKGVERS_BRANCH)
248*11838SLiane.Praza@Sun.COM
249*11838SLiane.Praza@Sun.COMpkgmogrify(1) also allows us to include a set of default transformations.
250*11838SLiane.Praza@Sun.COMThe definitions for these transforms are in usr/src/pkg/transforms/.  An
251*11838SLiane.Praza@Sun.COMoverview of their use is supplied here, but for a full accounting, please
252*11838SLiane.Praza@Sun.COMread pkmogrify(1) and the files themselves.
253*11838SLiane.Praza@Sun.COM
254*11838SLiane.Praza@Sun.COM	defaults
255*11838SLiane.Praza@Sun.COM	    This transform is applied to all manifests.  It specifies
256*11838SLiane.Praza@Sun.COM	    a set of sensible default permissions, a set of
257*11838SLiane.Praza@Sun.COM	    directory locations for which the reboot-needed actuator
258*11838SLiane.Praza@Sun.COM	    is always applied to files, and some other basic defaults.
259*11838SLiane.Praza@Sun.COM
260*11838SLiane.Praza@Sun.COM	publish
261*11838SLiane.Praza@Sun.COM	    This transform is applied to all manifests.  It ensures
262*11838SLiane.Praza@Sun.COM	    that manifest lines which don't apply to the current
263*11838SLiane.Praza@Sun.COM	    architecture are stripped.  It also ensures non-redistributable
264*11838SLiane.Praza@Sun.COM	    packages aren't included in an open-only build.
265*11838SLiane.Praza@Sun.COM
266*11838SLiane.Praza@Sun.COM	restart_fmri
267*11838SLiane.Praza@Sun.COM	    This transform is applied to all manifests.  It modifies
268*11838SLiane.Praza@Sun.COM	    all package manifest lines for SMF manifests in standard
269*11838SLiane.Praza@Sun.COM	    locations to include an actuator which runs manifest-import
270*11838SLiane.Praza@Sun.COM	    on installation/update/removal, as well as some others.  If
271*11838SLiane.Praza@Sun.COM	    you're adding a new class of file that would benefit from
272*11838SLiane.Praza@Sun.COM	    a restart or refresh of a specific SMF service, please add
273*11838SLiane.Praza@Sun.COM	    it here.
274*11838SLiane.Praza@Sun.COM
275*11838SLiane.Praza@Sun.COM	extract_metadata
276*11838SLiane.Praza@Sun.COM	    This transform is applied to all manifests.  It deals with
277*11838SLiane.Praza@Sun.COM	    manipulations required for packaging metadata like
278*11838SLiane.Praza@Sun.COM	    org.opensolaris.redist, pkg.renamed, and pkg.obsolete.
279*11838SLiane.Praza@Sun.COM
280*11838SLiane.Praza@Sun.COM	hollow_zone_pkg
281*11838SLiane.Praza@Sun.COM	    This transform is available for explicit inclusion in
282*11838SLiane.Praza@Sun.COM	    some manifests.  It ensures that all contents of the
283*11838SLiane.Praza@Sun.COM	    package are not installed within a non-global zone, but the
284*11838SLiane.Praza@Sun.COM	    package and its metadata are available in order to satisfy
285*11838SLiane.Praza@Sun.COM	    packaging dependencies.
286*11838SLiane.Praza@Sun.COM
287*11838SLiane.Praza@Sun.COMpkgmogrify(1) also allows us to use comments and continuation lines
288*11838SLiane.Praza@Sun.COMin our manifests.
289*11838SLiane.Praza@Sun.COM
290*11838SLiane.Praza@Sun.COMZones and Packages
291*11838SLiane.Praza@Sun.COM------------------
292*11838SLiane.Praza@Sun.COM
293*11838SLiane.Praza@Sun.COMpkg(5) uses variants to implement zones.  If a package is marked
294*11838SLiane.Praza@Sun.COMwith both global and non-global zone variants, the package contents will
295*11838SLiane.Praza@Sun.COMbe installed in both global and non-global by default.
296*11838SLiane.Praza@Sun.COM	set name=variant.opensolaris.zone value=global value=nonglobal
297*11838SLiane.Praza@Sun.COM
298*11838SLiane.Praza@Sun.COMSpecific actions within a package can be tagged as applying to only
299*11838SLiane.Praza@Sun.COMthe global zone or only the non-global zones.
300*11838SLiane.Praza@Sun.COM
301*11838SLiane.Praza@Sun.COMThe hollow_zone_pkg transform described above is also available to
302*11838SLiane.Praza@Sun.COMsimplify a common packaging scenario.
303*11838SLiane.Praza@Sun.COM
304*11838SLiane.Praza@Sun.COMDependencies
305*11838SLiane.Praza@Sun.COM------------
306*11838SLiane.Praza@Sun.COM
307*11838SLiane.Praza@Sun.COMPackage dependencies are automatically calculated during build time
308*11838SLiane.Praza@Sun.COMusing pkgdepend(1).  After you've done a build, you can verify your
309*11838SLiane.Praza@Sun.COMdependencies in the <package>.res file described above.  If the
310*11838SLiane.Praza@Sun.COMfile is missing a dependency that you believe could be auto-detected,
311*11838SLiane.Praza@Sun.COMplease file a bug against pkgdepend(1).
312*11838SLiane.Praza@Sun.COM
313*11838SLiane.Praza@Sun.COMDependencies can be added manually using the "depend" action.  Please
314*11838SLiane.Praza@Sun.COMadd a comment describing why the dependency is required.
315*11838SLiane.Praza@Sun.COM
316*11838SLiane.Praza@Sun.COMMoving Content Between Packages and Removing Content
317*11838SLiane.Praza@Sun.COM----------------------------------------------------
318*11838SLiane.Praza@Sun.COM
319*11838SLiane.Praza@Sun.COMpkg(5) tracks when content is removed from packages, and automatically
320*11838SLiane.Praza@Sun.COMremoves it.
321*11838SLiane.Praza@Sun.COM
322*11838SLiane.Praza@Sun.COMIf you need to move content between packages, there are two primary
323*11838SLiane.Praza@Sun.COMthings to do.
324*11838SLiane.Praza@Sun.COM
325*11838SLiane.Praza@Sun.COM	"preserve" files must be marked with original_name.
326*11838SLiane.Praza@Sun.COM	    The first time a "preserve" file moves between packages,
327*11838SLiane.Praza@Sun.COM	    you must set original_name=<original package>:<file>
328*11838SLiane.Praza@Sun.COM	    in that file's action.  Subsequent moves do not require
329*11838SLiane.Praza@Sun.COM	    modification.
330*11838SLiane.Praza@Sun.COM
331*11838SLiane.Praza@Sun.COM	Consider adding a dependency on the new package.
332*11838SLiane.Praza@Sun.COM	    The only way a system will end up with a new package
333*11838SLiane.Praza@Sun.COM	    after upgrade is if an existing package depends on it.
334*11838SLiane.Praza@Sun.COM
335*11838SLiane.Praza@Sun.COMRenaming a Package
336*11838SLiane.Praza@Sun.COM------------------
337*11838SLiane.Praza@Sun.COM
338*11838SLiane.Praza@Sun.COMTo rename a package, leave the old package manifest in place, but
339*11838SLiane.Praza@Sun.COMempty it of all delivered content.  The old package should include:
340*11838SLiane.Praza@Sun.COM
341*11838SLiane.Praza@Sun.COM	set name=pkg.fmri with the version set explicitly to the
342*11838SLiane.Praza@Sun.COM	    build you're integrating into.  For example, if you wanted
343*11838SLiane.Praza@Sun.COM	    to rename SUNWrmodu in build 133 you'd change the pkg.fmri
344*11838SLiane.Praza@Sun.COM	    line to read
345*11838SLiane.Praza@Sun.COM	    set name=pkg.fmri value=pkg:/SUNWrmodu@0.5.11,5.11-0.133
346*11838SLiane.Praza@Sun.COM
347*11838SLiane.Praza@Sun.COM	set name=pkg.renamed value=true
348*11838SLiane.Praza@Sun.COM
349*11838SLiane.Praza@Sun.COM	The architectures and variants you're renaming.  These
350*11838SLiane.Praza@Sun.COM	    should just be copied from your old package, as you
351*11838SLiane.Praza@Sun.COM	    must rename a package on all architectures and
352*11838SLiane.Praza@Sun.COM	    variants simultaneously.
353*11838SLiane.Praza@Sun.COM
354*11838SLiane.Praza@Sun.COM	A dependency on the new package.
355*11838SLiane.Praza@Sun.COM
356*11838SLiane.Praza@Sun.COMIf there were "preserve" files in the package you're renaming, make
357*11838SLiane.Praza@Sun.COMsure to create original_name settings in the new package.
358*11838SLiane.Praza@Sun.COM
359*11838SLiane.Praza@Sun.COMEOFs and Removals
360*11838SLiane.Praza@Sun.COM-----------------
361*11838SLiane.Praza@Sun.COM
362*11838SLiane.Praza@Sun.COMTo remove files, directories, drivers, or anything else within a package,
363*11838SLiane.Praza@Sun.COMsimply stop delivering them in the package.  IPS will manage the removal
364*11838SLiane.Praza@Sun.COMof no longer delivered content.
365*11838SLiane.Praza@Sun.COM
366*11838SLiane.Praza@Sun.COMPackage removals have impact on the rest of the system.  Before marking
367*11838SLiane.Praza@Sun.COMa package as obsolete, search in the OpenSolaris development
368*11838SLiane.Praza@Sun.COMrepository (http://pkg.opensolaris.org/dev or http://ipkg.sfbay/dev)
369*11838SLiane.Praza@Sun.COMto find out if any other packages depend on the software you intend
370*11838SLiane.Praza@Sun.COMto EOF.  If any packages do, you need to coordinate with those
371*11838SLiane.Praza@Sun.COMconsolidations.
372*11838SLiane.Praza@Sun.COM
373*11838SLiane.Praza@Sun.COMThe "slim_install" package may depend on ON packages.  If it does,
374*11838SLiane.Praza@Sun.COMyou must send a FLAG DAY message for ON users and PIT who test
375*11838SLiane.Praza@Sun.COMinstall.  You must also file an installation bug to get that package
376*11838SLiane.Praza@Sun.COMupdated in the same build or earlier than you intend to integrate.
377*11838SLiane.Praza@Sun.COMYou should also test install yourself.  You can do this by replacing
378*11838SLiane.Praza@Sun.COMthe "slim_install" in your Distro Constructor manifest with the
379*11838SLiane.Praza@Sun.COMexplicit list of packages to install.
380*11838SLiane.Praza@Sun.COM
381*11838SLiane.Praza@Sun.COMTo remove a package, you must mark it as obsolete.  The obsoleted
382*11838SLiane.Praza@Sun.COMpackage manifest should include
383*11838SLiane.Praza@Sun.COM
384*11838SLiane.Praza@Sun.COM	set name=pkg.fmri with the version set explicitly to the
385*11838SLiane.Praza@Sun.COM	    build you're integrating into.  For example, if you wanted
386*11838SLiane.Praza@Sun.COM	    to remove SUNWwbsd in build 133 you'd change the pkg.fmri
387*11838SLiane.Praza@Sun.COM	    line to read
388*11838SLiane.Praza@Sun.COM	    set name=pkg.fmri value=pkg:/SUNWwbsd@0.5.11,5.11-0.133
389*11838SLiane.Praza@Sun.COM
390*11838SLiane.Praza@Sun.COM	set name=pkg.obsolete value=true
391*11838SLiane.Praza@Sun.COM
392*11838SLiane.Praza@Sun.COM	The architectures and variants you're obsoleting.  These
393*11838SLiane.Praza@Sun.COM	    should just be copied from your old package, as you
394*11838SLiane.Praza@Sun.COM	    must obsolete a package on all architectures and
395*11838SLiane.Praza@Sun.COM	    variants simultaneously.
396*11838SLiane.Praza@Sun.COM
397*11838SLiane.Praza@Sun.COMCreating a Package
398*11838SLiane.Praza@Sun.COM------------------
399*11838SLiane.Praza@Sun.COM
400*11838SLiane.Praza@Sun.COMThe easiest thing is to copy a package similar to the one you're
401*11838SLiane.Praza@Sun.COMtrying to create.  Note that packages are no longer split on the
402*11838SLiane.Praza@Sun.COM/usr and / boundary.
403*11838SLiane.Praza@Sun.COM
404*11838SLiane.Praza@Sun.COMThe following actions are required for all packages in ON.
405*11838SLiane.Praza@Sun.COM	set name=pkg.fmri
406*11838SLiane.Praza@Sun.COM	    Every package must have an FMRI.  That is the package's
407*11838SLiane.Praza@Sun.COM	    name.
408*11838SLiane.Praza@Sun.COM
409*11838SLiane.Praza@Sun.COM	set name=pkg.summary
410*11838SLiane.Praza@Sun.COM	    Every package must have a short summary of its purpose.
411*11838SLiane.Praza@Sun.COM
412*11838SLiane.Praza@Sun.COM	set name=pkg.description
413*11838SLiane.Praza@Sun.COM	    Every package must have a one-sentence description of
414*11838SLiane.Praza@Sun.COM	    its purpose.
415*11838SLiane.Praza@Sun.COM
416*11838SLiane.Praza@Sun.COM	set name=variant.arch
417*11838SLiane.Praza@Sun.COM	    Every package must specify which architectures it delivers.
418*11838SLiane.Praza@Sun.COM
419*11838SLiane.Praza@Sun.COM	set name=variant.opensolaris.zone
420*11838SLiane.Praza@Sun.COM	    Every package must specify whether it can be installed in
421*11838SLiane.Praza@Sun.COM	    global zones, non-global zones, or both.
422*11838SLiane.Praza@Sun.COM
423*11838SLiane.Praza@Sun.COM	set name=info.classification
424*11838SLiane.Praza@Sun.COM	    Every package must specify a category for the packaging GUI.
425*11838SLiane.Praza@Sun.COM	    You must use an existing category, and may not invent new ones.
426*11838SLiane.Praza@Sun.COM	    Existing categories and their subcategories are listed
427*11838SLiane.Praza@Sun.COM	    in /usr/share/package-manager/data/opensolaris.org.sections.
428*11838SLiane.Praza@Sun.COM
429*11838SLiane.Praza@Sun.COM	license
430*11838SLiane.Praza@Sun.COM	    All packages must specify a set of license actions.  If
431*11838SLiane.Praza@Sun.COM	    you're adding items here that are not already included in
432*11838SLiane.Praza@Sun.COM	    usr/src/pkg/license_files, then you will also need to modify
433*11838SLiane.Praza@Sun.COM	    usr/src/tools/opensolaris/license-list.
434*11838SLiane.Praza@Sun.COM
435*11838SLiane.Praza@Sun.COMThe following actions are uncommon but specific to ON.
436*11838SLiane.Praza@Sun.COM
437*11838SLiane.Praza@Sun.COM	set name=org.opensolaris.redist
438*11838SLiane.Praza@Sun.COM	    This may be set to nonredist or internal.  If a package
439*11838SLiane.Praza@Sun.COM	    is redistributable, do not create this action.  "internal"
440*11838SLiane.Praza@Sun.COM	    packages which are legally not allowed to be distributed
441*11838SLiane.Praza@Sun.COM	    at all are strongly discouraged.  If you're adding
442*11838SLiane.Praza@Sun.COM	    content to a package with this action, you should have
443*11838SLiane.Praza@Sun.COM	    modified bindrop.sh, and test open-only builds.
444*11838SLiane.Praza@Sun.COM
445*11838SLiane.Praza@Sun.COMDrivers and Packages
446*11838SLiane.Praza@Sun.COM--------------------
447*11838SLiane.Praza@Sun.COM
448*11838SLiane.Praza@Sun.COMScripting is no longer required to deal with addition or removal of
449*11838SLiane.Praza@Sun.COMdrivers in ON.  A "driver" action should be specified for each driver,
450*11838SLiane.Praza@Sun.COMand IPS will handle updates to all the driver files.
451