xref: /illumos-gate/usr/src/pkg/transforms/global_zone_only_component (revision cd3e933325e68e23516a196a8fea7f49b1e497c3)
1#
2# CDDL HEADER START
3#
4# The contents of this file are subject to the terms of the
5# Common Development and Distribution License (the "License").
6# You may not use this file except in compliance with the License.
7#
8# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9# or http://www.opensolaris.org/os/licensing.
10# See the License for the specific language governing permissions
11# and limitations under the License.
12#
13# When distributing Covered Code, include this CDDL HEADER in each
14# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15# If applicable, add the following below this CDDL HEADER, with the
16# fields enclosed by brackets "[]" replaced with your own identifying
17# information: Portions Copyright [yyyy] [name of copyright owner]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
24#
25
26#
27# For packagers:
28#
29# This ruleset is useful for "system" components-- ones which are expected
30# to appear primarily in the global zone, but which may have some small
31# pieces (man pages, header files) which may need to appear in all zones.
32#
33# The current rules specify that all payload-bearing actions (file,
34# dir, hardlink, link) should appear *only* in the global zone, with
35# the following exceptions:
36#
37# 	- man pages appear in all zones
38# 	- header files appear in all zones
39# 	- mdb(1) modules appear in all zones
40#
41# You may well have other actions which you wish to appear in all zones.
42# An example would be an administrative utility for a driver which has
43# been virtualized to work within zones.  For those actions you wish to
44# appear in all zones, add the following attribute to your action.
45#
46#         variant.opensolaris.zone=__NODEFAULT
47#
48# You DO NOT need to specify __NODEFAULT for man pages, headers, or
49# mdb modules, as those are covered by the automatic rules below.
50#
51# Note: When you specify variant.opensolaris.zone=__NODEFAULT, the
52# net effect is that *no* variant.opensolaris.zone attribute will
53# appear in the post-processed manifest.
54#
55
56#
57# For packaging nerds:
58#
59# We have a problem to solve here: To make an action appear in all zones,
60# it should have *no* variant.opensolaris.zone attribute.  So it's a bit
61# more complicated to use "default".
62#
63# Here's what we do: we use "default" to set all payload bearing actions
64# which have no variant.opensolaris.zone attribute to be
65# variant.opensolaris.zone=global.  For those actions which need to appear
66# in all zones, the packager must specify
67# variant.opensolaris.zone=__NODEFAULT.  Additionally we have some rules
68# which set __NODEFAULT for a few classes of well known things, like man
69# pages and headers.
70#
71# We then go through and clean up all of the __NODEFAULTed attributes by
72# simply deleting them.
73#
74
75# Man pages should appear in all zones.
76<transform dir file link hardlink path=.*/man/.* -> default variant.opensolaris.zone __NODEFAULT>
77<transform dir path=.*/man$ -> default variant.opensolaris.zone __NODEFAULT>
78
79# Headers should appear in all zones.
80<transform dir file link hardlink path=.*/include/.* -> default variant.opensolaris.zone __NODEFAULT>
81<transform dir path=.*/include$ -> default variant.opensolaris.zone __NODEFAULT>
82
83# MDB modules should appear in all zones, as one might debug a crash dump
84# in a zone.
85<transform dir file link hardlink path=.*/mdb/.* -> default variant.opensolaris.zone __NODEFAULT>
86<transform dir path=.*/mdb$ -> default variant.opensolaris.zone __NODEFAULT>
87
88# Everything else is global zone only unless the user overrides
89# action-by-action with __NODEFAULT.
90<transform dir file link hardlink -> default variant.opensolaris.zone global>
91
92#
93# Buff out the __NODEFAULT attributes.
94#
95<transform dir file link hardlink -> delete variant.opensolaris.zone __NODEFAULT>
96