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