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 # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 # Use is subject to license terms.
24 #
25 #ident "%Z%%M% %I% %E% SMI"
26
27 This directory contains the tools used to do a full build of the
28 OS/Net workspace. They usually live in the /opt/onbld directory on build
29 machines. From here, 'make install' will build and install the tools
30 in $ROOT/opt/onbld. If you like, 'make pkg' will build the SUNWonbld
31 package in $(PKGARCHIVE). Installing that package will populate the
32 /opt/onbld directory, and create a root account for building called 'gk',
33 which uses csh and has a home directory of /opt/onbld/gk. You can
34 use this account to do full builds with 'nightly'. You don't have to,
35 but the 'gk' account has the path setup properly, has a .make.machines
36 file for dmake, and has a .login that sets up for dmake.
37
38 Layout of /opt/onbld
39 --------------------
40
41 /opt/onbld/etc/abi
42 contains Solaris ABI database (ABI_*.db) and exceptions
43 for ABI Auditing tool (intf_check).
44
45 /opt/onbld/gk
46 gk account's home directory.
47
48 /opt/onbld/bin
49 basic bin directory - contains scripts.
50
51 /opt/onbld/bin/${MACH}
52 architecture-specific bin directory for binaries.
53
54 /opt/onbld/env
55 build environment files.
56
57 /opt/onbld/lib
58 libraries used by the build tools.
59
60 /opt/onbld/lib/python
61 python modules used by the build tools.
62
63 /opt/onbld/lib/python/onbld/hgext
64 Mercurial extensions.
65
66 /opt/onbld/man
67 rudimentary man pages for some of the tools.
68
69
70 Tool Summary
71 ------------
72
73 bfu
74 bonwick/faulkner upgrade. Loads a set of cpio archives created
75 by 'mkbfu' onto a machine, either live or on alternate root
76 and /usr filesystems. Attempts to preserve important files,
77 but may require manual intervention before reboot to resolve
78 changes to preserved files.
79
80 bfuld
81 Used by bfu to survive getting a new runtime linker when extracting
82 new cpio archives onto a live system. Patches binaries to use
83 a saved runtime linker in /tmp during the bfu process.
84 Not run by anything but bfu.
85
86 bldenv
87 companion to 'nightly.' Takes the same environment file you
88 used with 'nightly,' and starts a shell with the environment
89 set up the same way as 'nightly' set it up. This is useful
90 if you're trying to quickly rebuild portions of a workspace
91 built by 'nightly'. 'ws' should not be used for this since it
92 sets the environment up differently and may cause everything
93 to rebuild (because of different -I or -L paths).
94
95 build_cscope
96 builds cscope databases in the uts, the platform subdirectories
97 of uts, and in usr/src. Uses cscope-fast.
98
99 cdm
100 A Mercurial extension providing various commands useful for ON
101 development
102
103 check_rtime
104 checks ELF attributes used by ELF dynamic objects in the proto area.
105 Used by 'nightly's -r option, to check a number of ELF runtime
106 attributes for consistency with common build rules. nightly uses
107 the -o option to simplify the output for diffing with previous
108 build results. It also uses the -i option to obtain NEEDED and RUNPATH
109 entries, which help detect changes in software dependencies and makes
110 sure objects don't have any strange runpaths like /opt/SUNWspro/lib.
111
112 checkproto
113 Runs protocmp and protolist on a workspace (or uses the environment
114 variable CODEMGR_WS to determine the workspace). Checks the proto area
115 against the packages.
116
117 codereview
118 Given two filenames, creates a postscript file with the file
119 differences highlighted.
120
121 codesign
122 Tools for signing cryptographic modules using the official
123 Sun release keys stored on a remote signing server. This
124 directory contains signit, a client program for signing
125 files with the signing server; signproto, a shell script
126 that finds crypto modules in $ROOT and signs them using
127 signit; and codesign_server.pl, the code that runs on the
128 server. The codesign_server code is not used on an ON
129 build machine but is kept here for source control purposes.
130
131 copyrightchk
132 Checks that files have appropriate SMI copyright notices.
133 Primarily used by wx
134
135 cscope-fast
136 The fast version of cscope that we use internally. Seems to work,
137 but may need more testing before it's placed in the gate. The source
138 just really needs to be here.
139
140 cstyle
141 checks C source for compliance with OS/Net guidelines.
142
143 ctfconvert
144 Convert symbolic debugging information in an object file to the Compact
145 ANSI-C Type Format (CTF).
146
147 ctfdump
148 Decode and display CTF data stored in a raw file or in an ELF file.
149
150 ctfmerge
151 Merge the CTF data from one or more object files.
152
153 depcheck
154 A tool to try an assess the dependencies of executables. This tool
155 is not a definitive dependency check, but it does use "strings" and
156 "ldd" to gather as much information as it can. The dependency check
157 tool can handle filenames and pkgnames. Before using the dependency
158 checker you must build a database which reflects the properties and
159 files in your system.
160
161 elfcmp
162 Compares two ELF modules (e.g. .o files, executables) section by
163 section. Useful for determining whether "trivial" changes -
164 cstyle, lint, etc - actually changed the code. The -S option
165 is used to test whether two binaries are the same except for
166 the elfsign signature.
167
168 elfsign
169 Built from the same sources as the shipped elfsign(1), this
170 version is used in nightly -t builds to assure that the signing
171 process and format is the same as will be used on the target
172 system.
173
174 elfsigncmp
175 This script can be used in lieu of elfsign during a build.
176 It uses elfsign to sign a copy of the object and elfcmp -S to
177 verify that the signing caused no damage before updating
178 the object to be signed.
179
180 findunref
181 Finds all files in a source tree that have access times older than a
182 certain time and are not in a specified list of exceptions. Since
183 'nightly' timestamps the start of the build, and findunref uses its
184 timestamp (by default), this can be used to find all files that were
185 unreferenced during a nightly build). Since some files are only used
186 during a SPARC or Intel build, 'findunref' needs to be run on
187 workspaces from both architectures and the results need to be merged.
188 For instance, if $INTELSRC and $SPARCSRC are set to the usr/src
189 directories of your Intel and SPARC nightly workspaces, then you
190 can merge the results like so:
191
192 $ findunref $INTELSRC $INTELSRC/tools/findunref/exception_list | \
193 sort > ~/unref-i386.out
194 $ findunref $SPARCSRC $SPARCSRC/tools/findunref/exception_list | \
195 sort > ~/unref-sparc.out
196 $ comm -12 ~/unref-i386.out ~/unref-sparc.out > ~/unref.out
197
198 hdrchk
199 checks headers for compliance with OS/Net standards (form, includes,
200 C++ guards).
201
202 hgsetup
203 creates a basic Mercurial configuration for the user.
204
205 hg-active
206 helper used by webrev to generate file lists for Mercurial
207 workspaces.
208
209 install.bin
210 binary version of /usr/sbin/install. Used to be vastly faster
211 (since /usr/sbin/install is a shell script), but may only be a bit
212 faster now. One speedup includes avoiding the name service for the
213 well-known, never-changing password entries like 'root' and 'sys.'
214
215 intf_check
216 detects and reports ABI versioning and stability problems.
217
218 lintdump
219 dumps the contents of one or more lint libraries; see lintdump(1)
220
221 keywords
222 checks files for proper SCCS keywords.
223
224 makebfu
225 simple wrapper around 'mkbfu' for use outside nightly (when in a build
226 shell from 'ws' or 'bldenv').
227
228 mkbfu
229 makes cpio archives out of the proto area suitable for bfu'ing.
230 Used by 'nightly' and 'makebfu'.
231
232 ndrgen
233 Network Data Language (NDL) RPC protocol compiler to support DCE
234 RPC/MSRPC and SMB/CIFS. ndrgen takes an input protocol definition
235 file (say, proto.ndl) and generates an output C source file
236 (proto_ndr.c) containing the Network Data Representation (NDR)
237 marshalling routines to implement the RPC protocol.
238
239 nightly
240 nightly build script. Takes an environment (or 'env') file describing
241 such things as the workspace, the parent, and what to build. See
242 env/developer and env/gatekeeper for sample, hopefully well-commented
243 env files.
244
245 pmodes
246 enforces proper file ownership and permissions in pkgmap and package
247 prototype* files. converts files if necessary
248
249 protocmp
250 compares proto lists and the package definitions. Used by nightly
251 to determine if the proto area matches the packages, and to detect
252 differences between a childs proto area and a parents.
253
254 protocmp.terse
255 transforms the output of protocmp into something a bit more friendly
256
257 protolist
258 create a list of what's in the proto area, to feed to protocmp.
259
260 rtichk
261 checks that a set of CRs have approved RTIs. Primarily used
262 by wx
263
264 sccscp
265 copy a file under SCCS control to another location in a workspace.
266 also updates teamware's nametable.
267
268 sccshist
269 Display the history, comments and diffs, of a file under SCCS
270 control.
271
272 sccsmv
273 rename a file under SCCS control to another location in a workspace.
274 also updates teamware's nametable.
275
276 sccsrm
277 delete a file under SCCS control workspace. also updates teamware's
278 nametable. Actually renames it to .del-<file>-`date` so that others
279 will see it move when it is brought over (in case they were working
280 on it).
281
282 ws
283 creates a shell with the environment set up to build in the given
284 workspace. Used mostly for non-full-build workspaces, so it sets up
285 to pull headers and libraries from the proto area of the parent if
286 they aren't in the childs proto area.
287
288 wx
289 A great workspace tool by bonwick. See wx.README for information
290 and warnings.
291
292 wx2hg
293 Converts a TeamWare workspace under the control of wx to a
294 Mercurial workspace, discarding intermediate deltas.
295
296 tokenize
297 Used to build the sun4u boot block.
298
299 webrev
300 Generates a set of HTML pages that show side-by-side diffs of
301 changes in your workspace, for easy communication of code
302 review materials. Can automagically find edited files or use a
303 manually-generated list; knows how to use wx's active file for
304 lists of checked-out files and proposed SCCS comments.
305
306 which_scm
307 Reports the current Source Code Management (SCM) system in use
308 and the top-level directory of the workspace.
309
310 wsdiff
311 Detect object differences between two ON proto areas. Used by
312 nightly(1) to determine what changed between two builds. Handy
313 for identifying the set of built objects impacted by a given
314 source change. This information is needed for patch construction.
315
316
317 How to do a full build
318 ----------------------
319
320 1. Find an environment file that might do what you want to do. If you're just
321 a developer wanting to do a full build in a child of the gate, copy the
322 'developer' environment file to a new name (private to you and/or the
323 work being done in this workspace, to avoid collisions with others). Then
324 edit the file and tailor it to your workspace. Remember that this file
325 is a shell script, so it can do more than set environment variables.
326
327 2. Login as 'gk' (or root, but your PATH and .make.machines for dmake will
328 not be right). Run 'nightly' and give it your environment file as an
329 option. 'nightly' will first look for your environment file in
330 /opt/onbld/env, and if it's not there then it will look for it as an
331 absolute or relative path. Some people put their environment files in
332 their workspace to keep them close.
333
334 3. When 'nightly' is complete, it will send a summary of what happened to
335 $MAILTO. Usually, the less info in the mail the better. If you have failures,
336 you can go look at the full log of what happened, generally in
337 $CODEMGR_WS/log/log.<date>/nightly.log (the mail_msg it sent and the proto
338 list are there too). You can also find the individual build logs, like
339 'make clobber' and 'make install' output in $SRC, under names like
340 clobber-${MACH}.out and install-${MACH}.out (for a DEBUG build). These
341 will be smaller than nightly.log, and maybe more searchable.
342
343 Files you have to update to add a tool
344 --------------------------------------
345
346 1. Add the tool in its appropriate place.
347 2. Update the Makefile as required.
348 3. Update usr/src/tools/SUNWonbld/prototype_*.
349 4. Update usr/src/tools/README.tools (this file).
350 5. Repeat 1-4 for any man pages.