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 git-active
199 helper used by webrev to generate file lists for Git workspaces.
200
201 hdrchk
202 checks headers for compliance with OS/Net standards (form, includes,
203 C++ guards).
204
205 hgsetup
206 creates a basic Mercurial configuration for the user.
207
208 hg-active
209 helper used by webrev to generate file lists for Mercurial
210 workspaces.
211
212 install.bin
213 binary version of /usr/sbin/install. Used to be vastly faster
214 (since /usr/sbin/install is a shell script), but may only be a bit
215 faster now. One speedup includes avoiding the name service for the
216 well-known, never-changing password entries like 'root' and 'sys.'
217
218 intf_check
219 detects and reports ABI versioning and stability problems.
220
221 lintdump
222 dumps the contents of one or more lint libraries; see lintdump(1)
223
224 keywords
225 checks files for proper SCCS keywords.
226
227 makebfu
228 simple wrapper around 'mkbfu' for use outside nightly (when in a build
229 shell from 'ws' or 'bldenv').
230
231 mkbfu
232 makes cpio archives out of the proto area suitable for bfu'ing.
233 Used by 'nightly' and 'makebfu'.
234
235 ndrgen
236 Network Data Language (NDL) RPC protocol compiler to support DCE
237 RPC/MSRPC and SMB/CIFS. ndrgen takes an input protocol definition
238 file (say, proto.ndl) and generates an output C source file
239 (proto_ndr.c) containing the Network Data Representation (NDR)
240 marshalling routines to implement the RPC protocol.
241
242 nightly
243 nightly build script. Takes an environment (or 'env') file describing
244 such things as the workspace, the parent, and what to build. See
245 env/developer and env/gatekeeper for sample, hopefully well-commented
246 env files.
247
248 pmodes
249 enforces proper file ownership and permissions in pkgmap and package
250 prototype* files. converts files if necessary
251
252 protocmp
253 compares proto lists and the package definitions. Used by nightly
254 to determine if the proto area matches the packages, and to detect
255 differences between a childs proto area and a parents.
256
257 protocmp.terse
258 transforms the output of protocmp into something a bit more friendly
259
260 protolist
261 create a list of what's in the proto area, to feed to protocmp.
262
263 rtichk
264 checks that a set of CRs have approved RTIs. Primarily used
265 by wx
266
267 sccscp
268 copy a file under SCCS control to another location in a workspace.
269 also updates teamware's nametable.
270
271 sccshist
272 Display the history, comments and diffs, of a file under SCCS
273 control.
274
275 sccsmv
276 rename a file under SCCS control to another location in a workspace.
277 also updates teamware's nametable.
278
279 sccsrm
280 delete a file under SCCS control workspace. also updates teamware's
281 nametable. Actually renames it to .del-<file>-`date` so that others
282 will see it move when it is brought over (in case they were working
283 on it).
284
285 ws
286 creates a shell with the environment set up to build in the given
287 workspace. Used mostly for non-full-build workspaces, so it sets up
288 to pull headers and libraries from the proto area of the parent if
289 they aren't in the childs proto area.
290
291 wx
292 A great workspace tool by bonwick. See wx.README for information
293 and warnings.
294
295 wx2hg
296 Converts a TeamWare workspace under the control of wx to a
297 Mercurial workspace, discarding intermediate deltas.
298
299 tokenize
300 Used to build the sun4u boot block.
301
302 webrev
303 Generates a set of HTML pages that show side-by-side diffs of
304 changes in your workspace, for easy communication of code
305 review materials. Can automagically find edited files or use a
306 manually-generated list; knows how to use wx's active file for
307 lists of checked-out files and proposed SCCS comments.
308
309 which_scm
310 Reports the current Source Code Management (SCM) system in use
311 and the top-level directory of the workspace.
312
313 wsdiff
314 Detect object differences between two ON proto areas. Used by
315 nightly(1) to determine what changed between two builds. Handy
316 for identifying the set of built objects impacted by a given
317 source change. This information is needed for patch construction.
318
319
320 How to do a full build
321 ----------------------
322
323 1. Find an environment file that might do what you want to do. If you're just
324 a developer wanting to do a full build in a child of the gate, copy the
325 'developer' environment file to a new name (private to you and/or the
326 work being done in this workspace, to avoid collisions with others). Then
327 edit the file and tailor it to your workspace. Remember that this file
328 is a shell script, so it can do more than set environment variables.
329
330 2. Login as 'gk' (or root, but your PATH and .make.machines for dmake will
331 not be right). Run 'nightly' and give it your environment file as an
332 option. 'nightly' will first look for your environment file in
333 /opt/onbld/env, and if it's not there then it will look for it as an
334 absolute or relative path. Some people put their environment files in
335 their workspace to keep them close.
336
337 3. When 'nightly' is complete, it will send a summary of what happened to
338 $MAILTO. Usually, the less info in the mail the better. If you have failures,
339 you can go look at the full log of what happened, generally in
340 $CODEMGR_WS/log/log.<date>/nightly.log (the mail_msg it sent and the proto
341 list are there too). You can also find the individual build logs, like
342 'make clobber' and 'make install' output in $SRC, under names like
343 clobber-${MACH}.out and install-${MACH}.out (for a DEBUG build). These
344 will be smaller than nightly.log, and maybe more searchable.
345
346 Files you have to update to add a tool
347 --------------------------------------
348
349 1. Add the tool in its appropriate place.
350 2. Update the Makefile as required.
351 3. Update usr/src/tools/SUNWonbld/prototype_*.
352 4. Update usr/src/tools/README.tools (this file).
353 5. Repeat 1-4 for any man pages.