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