xref: /titanic_41/usr/src/tools/pmodes/README.pmodes (revision 5203bc321053fb87d7073c7640548fab73634793)
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 2010 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26
27Pmodes is a program that updates pkgmap files or pkg prototype files.
28
29
30
31Applicability:
32
33Use of pmodes has been deprecated in onnv-gate; instead, see
34validate_pkg, as delivered by developer/build/onbld, and
35exception_lists/pmodes.
36
37Other OSNet users (ie on10 patch gates and earlier) should use pmodes
38from their own workspace.
39
40The information here is suitable for pmodes users in other
41consolidations, using tools from onnv-tools.
42
43
44
45Usage: pmodes [-somwDeNndvqP] [-r file] directory  .. proto/pkgmap file....
46
47
48
49Options that modify what is changed:
50
51	-s 	Strip read and write permissions from setgid/setuid executables.
52	-o	Do not change ownership to root
53	-m	Do not change file permissions (modes)
54	-w 	Do not strip owner write permissions from non-root owned
55		binaries
56	-e	Do not change 'e' or 'v' (editable or volatile) files
57		(they are only affected when owned by bin)
58	-D	Limit changes to directories only.
59
60Options that modify the output:
61	-n	Create a <file>.new file
62	-N	Overwrite the original pkgmap/proto file with the new file;
63		old pkgmap/proto file saved as file.old
64	-d	Produce "diff-style" output
65	-P	Ignore pkgmap files in directories.
66	-q	Do not produce error messages about directories w/ pkginfo*
67		files
68	-v	Preceed the output caused by each processed file by a
69		shortened version of the filename.
70
71	-r file	Restrict the test to the pathnames listed in "file"
72
73
74In default mode of operation, pmodes processes each argument.
75If an argument is a directory, it will first look for a pkginfo or
76pkginfo.tmpl file n order to learn the BASEDIR; it will than process
77the directory converting either the pkgmap file or, if the pkgmap file
78doesn't exist or the -P option is specified, the prototype_* files
79Names that contain .old or .new will be ignored.  If an argument is a file,
80the pkginfo* file in the same directory is used to learn the BASEDIR.
81
82Pmodes outputs a line for each change made:
83
84e m 0664 -> 0644 /var/adm/wtmpx
85d m 0775 -> 0755 /usr/lib
86d o bin -> root /usr/include/sys [755]
87f o bin -> root /usr/include/sys/cg6reg.h [0644]
88f o bin -> root /usr/include/sys/cg6var.h [0644]
89
90The first field is the "pkgmap" file type; the second field is the type
91of modification (m for mode, o for ownership).  This is followed by the
92change mode and the pathname.
93
94When ownership is changed, the file permissions are printed in square
95brackets.
96
97Multiple lines of output can be produced for a single file.
98
99With the -d option, output looks like:
100
101< d 0775 root sys /usr
102> d 0755 root sys /usr
103< d 0775 root bin /usr/include
104> d 0755 root bin /usr/include
105< d 1777 bin bin /var/preserve
106> d 1777 root bin /var/preserve
107< e 0664 root sys /etc/vfstab
108> e 0644 root sys /etc/vfstab
109
110And only one line per file is produced.
111
112
113
114Exceptions
115
116If pmodes insists on flagging errors that you believe must be
117integrated as-is, you may update the inline initializers for either
118exceptions or exempt_pkgs in pmodes.c.  If you do this, make sure that
119the bug report and your RTI include a justification for the exception.
120