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