xref: /onnv-gate/usr/src/tools/README.tools (revision 12776:0a254b4b5ca4)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
52217Smeem# Common Development and Distribution License (the "License").
62217Smeem# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
210Sstevel@tonic-gate#
22*12216Srichlowe@richlowe.net# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
2310355SAli.Bahrami@Sun.COM
240Sstevel@tonic-gate
250Sstevel@tonic-gateThis directory contains the tools used to do a full build of the
260Sstevel@tonic-gateOS/Net workspace.  They usually live in the /opt/onbld directory on build
270Sstevel@tonic-gatemachines. From here, 'make install' will build and install the tools
280Sstevel@tonic-gatein $ROOT/opt/onbld. If you like, 'make pkg' will build the SUNWonbld
290Sstevel@tonic-gatepackage in $(PKGARCHIVE). Installing that package will populate the
300Sstevel@tonic-gate/opt/onbld directory, and create a root account for building called 'gk',
310Sstevel@tonic-gatewhich uses csh and has a home directory of /opt/onbld/gk. You can
320Sstevel@tonic-gateuse this account to do full builds with 'nightly'. You don't have to,
332294Smeembut the 'gk' account has the path setup properly, has a .make.machines
342294Smeemfile for dmake, and has a .login that sets up for dmake.
350Sstevel@tonic-gate
360Sstevel@tonic-gateLayout of /opt/onbld
370Sstevel@tonic-gate--------------------
380Sstevel@tonic-gate
390Sstevel@tonic-gate/opt/onbld/etc/abi
400Sstevel@tonic-gate	contains Solaris ABI database (ABI_*.db) and exceptions
4110355SAli.Bahrami@Sun.COM	for ABI Auditing tool (interface_check, interface_cmp).
420Sstevel@tonic-gate
430Sstevel@tonic-gate/opt/onbld/gk
440Sstevel@tonic-gate	gk account's home directory.
450Sstevel@tonic-gate
460Sstevel@tonic-gate/opt/onbld/bin
470Sstevel@tonic-gate	basic bin directory - contains scripts.
480Sstevel@tonic-gate
490Sstevel@tonic-gate/opt/onbld/bin/${MACH}
500Sstevel@tonic-gate	architecture-specific bin directory for binaries.
510Sstevel@tonic-gate
520Sstevel@tonic-gate/opt/onbld/env
530Sstevel@tonic-gate	build environment files.
540Sstevel@tonic-gate
557078Smjnelson/opt/onbld/lib
567078Smjnelson	libraries used by the build tools.
577078Smjnelson
58*12216Srichlowe@richlowe.net/opt/onbld/lib/python<version>/
597078Smjnelson	python modules used by the build tools.
607078Smjnelson
61*12216Srichlowe@richlowe.net/opt/onbld/lib/python<version>/onbld/hgext
627078Smjnelson	Mercurial extensions.
637078Smjnelson
64*12216Srichlowe@richlowe.net/opt/onbld/lib/python/
65*12216Srichlowe@richlowe.net        symlink to the modules directory of the currently preferred
66*12216Srichlowe@richlowe.net        python version.  This exists to retain compatibility both for
67*12216Srichlowe@richlowe.net        tools expecting only one supported version of python, and for
68*12216Srichlowe@richlowe.net        user .hgrc files that expect to find cdm.py in
69*12216Srichlowe@richlowe.net        /opt/onbld/lib/python/onbld/hgext.
70*12216Srichlowe@richlowe.net
710Sstevel@tonic-gate/opt/onbld/man
720Sstevel@tonic-gate	rudimentary man pages for some of the tools.
730Sstevel@tonic-gate
740Sstevel@tonic-gate
750Sstevel@tonic-gateTool Summary
760Sstevel@tonic-gate------------
770Sstevel@tonic-gate
780Sstevel@tonic-gatebldenv
790Sstevel@tonic-gate	companion to 'nightly.' Takes the same environment file you
800Sstevel@tonic-gate	used with 'nightly,' and starts a shell with the environment
810Sstevel@tonic-gate	set up the same way as 'nightly' set it up. This is useful
820Sstevel@tonic-gate	if you're trying to quickly rebuild portions of a workspace
830Sstevel@tonic-gate	built by 'nightly'. 'ws' should not be used for this since it
840Sstevel@tonic-gate	sets the environment up differently and may cause everything
850Sstevel@tonic-gate	to rebuild (because of different -I or -L paths).
860Sstevel@tonic-gate
870Sstevel@tonic-gatebuild_cscope
880Sstevel@tonic-gate	builds cscope databases in the uts, the platform subdirectories
890Sstevel@tonic-gate	of uts, and in usr/src. Uses cscope-fast.
900Sstevel@tonic-gate
917078Smjnelsoncdm
927078Smjnelson	A Mercurial extension providing various commands useful for ON
937078Smjnelson	development
947078Smjnelson
950Sstevel@tonic-gatecheck_rtime
960Sstevel@tonic-gate	checks ELF attributes used by ELF dynamic objects in the proto area.
970Sstevel@tonic-gate	Used by 'nightly's -r option, to check a number of ELF runtime
980Sstevel@tonic-gate	attributes for consistency with common build rules.  nightly uses
990Sstevel@tonic-gate	the -o option to simplify the output for diffing with previous
1000Sstevel@tonic-gate	build results.  It also uses the -i option to obtain NEEDED and RUNPATH
1010Sstevel@tonic-gate	entries, which help detect changes in software dependencies and makes
1020Sstevel@tonic-gate	sure objects don't have any strange runpaths like /opt/SUNWspro/lib.
1030Sstevel@tonic-gate
1040Sstevel@tonic-gatecheckproto
1050Sstevel@tonic-gate	Runs protocmp and protolist on a workspace (or uses the environment
1060Sstevel@tonic-gate	variable CODEMGR_WS to determine the workspace). Checks the proto area
1070Sstevel@tonic-gate	against the packages.
1080Sstevel@tonic-gate
1090Sstevel@tonic-gatecodereview
1100Sstevel@tonic-gate	Given two filenames, creates a postscript file with the file
1110Sstevel@tonic-gate	differences highlighted.
1120Sstevel@tonic-gate
1133824Srotondocodesign
1143824Srotondo	Tools for signing cryptographic modules using the official
1153824Srotondo	Sun release keys stored on a remote signing server. This
1163824Srotondo	directory contains signit, a client program for signing
1173824Srotondo	files with the signing server; signproto, a shell script
1183824Srotondo	that finds crypto modules in $ROOT and signs them using
1193824Srotondo	signit; and codesign_server.pl, the code that runs on the
1203824Srotondo	server. The codesign_server code is not used on an ON
1213824Srotondo	build machine but is kept here for source control purposes.
1223824Srotondo
1237078Smjnelsoncopyrightchk
1247078Smjnelson	Checks that files have appropriate SMI copyright notices.
1257078Smjnelson	Primarily used by wx
1267078Smjnelson
1270Sstevel@tonic-gatecscope-fast
1280Sstevel@tonic-gate	The fast version of cscope that we use internally. Seems to work,
1290Sstevel@tonic-gate	but may need more testing before it's placed in the gate. The source
1300Sstevel@tonic-gate	just really needs to be here.
1310Sstevel@tonic-gate
1320Sstevel@tonic-gatecstyle
1330Sstevel@tonic-gate	checks C source for compliance with OS/Net guidelines.
1340Sstevel@tonic-gate
1350Sstevel@tonic-gatectfconvert
1360Sstevel@tonic-gate	Convert symbolic debugging information in an object file to the Compact
1370Sstevel@tonic-gate	ANSI-C Type Format (CTF).
1380Sstevel@tonic-gate
1390Sstevel@tonic-gatectfdump
1400Sstevel@tonic-gate	Decode and display CTF data stored in a raw file or in an ELF file.
1410Sstevel@tonic-gate
1420Sstevel@tonic-gatectfmerge
1430Sstevel@tonic-gate	Merge the CTF data from one or more object files.
1440Sstevel@tonic-gate
1450Sstevel@tonic-gatedepcheck
1460Sstevel@tonic-gate	A tool to try an assess the dependencies of executables.  This tool
1470Sstevel@tonic-gate	is not a definitive dependency check, but it does use "strings" and
1480Sstevel@tonic-gate	"ldd" to gather as much information as it can.  The dependency check
1490Sstevel@tonic-gate	tool can handle filenames and pkgnames.  Before using the dependency
1500Sstevel@tonic-gate	checker you must build a database which reflects the properties and
1510Sstevel@tonic-gate	files in your system.
1520Sstevel@tonic-gate
1530Sstevel@tonic-gateelfcmp
1540Sstevel@tonic-gate	Compares two ELF modules (e.g. .o files, executables) section by
1550Sstevel@tonic-gate	section.  Useful for determining whether "trivial" changes -
1560Sstevel@tonic-gate	cstyle, lint, etc - actually changed the code.  The -S option
1570Sstevel@tonic-gate	is used to test whether two binaries are the same except for
1580Sstevel@tonic-gate	the elfsign signature.
1590Sstevel@tonic-gate
1600Sstevel@tonic-gateelfsign
1610Sstevel@tonic-gate	Built from the same sources as the shipped elfsign(1), this
1620Sstevel@tonic-gate	version is used in nightly -t builds to assure that the signing
1630Sstevel@tonic-gate	process and format is the same as will be used on the target
1640Sstevel@tonic-gate	system.
1650Sstevel@tonic-gate
1660Sstevel@tonic-gateelfsigncmp
1670Sstevel@tonic-gate	This script can be used in lieu of elfsign during a build.
1680Sstevel@tonic-gate	It uses elfsign to sign a copy of the object and elfcmp -S to
1690Sstevel@tonic-gate	verify that the signing caused no damage before updating
1700Sstevel@tonic-gate	the object to be signed.
1710Sstevel@tonic-gate
17210355SAli.Bahrami@Sun.COMfind_elf
17310355SAli.Bahrami@Sun.COM	Search a directory tree for ELF objects, and produce one line of
17410355SAli.Bahrami@Sun.COM	output per object. Used by check_rtime and interface_check to locate
17510355SAli.Bahrami@Sun.COM	the objects to examine.
17610355SAli.Bahrami@Sun.COM
1770Sstevel@tonic-gatefindunref
1780Sstevel@tonic-gate	Finds all files in a source tree that have access times older than a
1790Sstevel@tonic-gate	certain time and are not in a specified list of exceptions.  Since
1800Sstevel@tonic-gate	'nightly' timestamps the start of the build, and findunref uses its
1810Sstevel@tonic-gate	timestamp (by default), this can be used to find all files that were
1820Sstevel@tonic-gate	unreferenced during a nightly build).  Since some files are only used
1830Sstevel@tonic-gate	during a SPARC or Intel build, 'findunref' needs to be run on
1840Sstevel@tonic-gate	workspaces from both architectures and the results need to be merged.
1850Sstevel@tonic-gate	For instance, if $INTELSRC and $SPARCSRC are set to the usr/src
1860Sstevel@tonic-gate	directories of your Intel and SPARC nightly workspaces, then you
1870Sstevel@tonic-gate	can merge the results like so:
1880Sstevel@tonic-gate
1890Sstevel@tonic-gate	$ findunref $INTELSRC $INTELSRC/tools/findunref/exception_list | \
1900Sstevel@tonic-gate	  sort > ~/unref-i386.out
1910Sstevel@tonic-gate	$ findunref $SPARCSRC $SPARCSRC/tools/findunref/exception_list | \
1920Sstevel@tonic-gate	  sort > ~/unref-sparc.out
1930Sstevel@tonic-gate	$ comm -12 ~/unref-i386.out ~/unref-sparc.out > ~/unref.out
1940Sstevel@tonic-gate
1950Sstevel@tonic-gatehdrchk
1960Sstevel@tonic-gate	checks headers for compliance with OS/Net standards (form, includes,
1970Sstevel@tonic-gate	C++ guards).
1980Sstevel@tonic-gate
1997078Smjnelsonhgsetup
2007078Smjnelson	creates a basic Mercurial configuration for the user.
2017078Smjnelson
2027078Smjnelsonhg-active
2037078Smjnelson	helper used by webrev to generate file lists for Mercurial
2047078Smjnelson	workspaces.
2057078Smjnelson
2060Sstevel@tonic-gateinstall.bin
2070Sstevel@tonic-gate	binary version of /usr/sbin/install. Used to be vastly faster
2080Sstevel@tonic-gate	(since /usr/sbin/install is a shell script), but may only be a bit
2090Sstevel@tonic-gate	faster now. One speedup includes avoiding the name service for the
2100Sstevel@tonic-gate	well-known, never-changing password entries like 'root' and 'sys.'
2110Sstevel@tonic-gate
21210355SAli.Bahrami@Sun.COMinterface_check
21310355SAli.Bahrami@Sun.COM	detects and reports invalid versioning in ELF objects.
21410355SAli.Bahrami@Sun.COM	Optionally generates an interface description file for
21510355SAli.Bahrami@Sun.COM	the workspace.
21610355SAli.Bahrami@Sun.COM
21710355SAli.Bahrami@Sun.COMinterface_cmp
21810355SAli.Bahrami@Sun.COM	Compares two interface description files, as produced by
21910355SAli.Bahrami@Sun.COM	interface_check, and flags invalid deviations in ELF object
22010355SAli.Bahrami@Sun.COM	versioning between them. interface_cmp can be used between Solaris
22110355SAli.Bahrami@Sun.COM	gates to ensure that older releases remain compatible with the
22210355SAli.Bahrami@Sun.COM	development gate. It can also be used to validate new changes to
22310355SAli.Bahrami@Sun.COM	the development gate before they are integrated.
2240Sstevel@tonic-gate
2252217Smeemlintdump
2262217Smeem	dumps the contents of one or more lint libraries; see lintdump(1)
2272217Smeem
2280Sstevel@tonic-gatekeywords
2290Sstevel@tonic-gate	checks files for proper SCCS keywords.
2300Sstevel@tonic-gate
2315311Samwndrgen
2325311Samw	Network Data Language (NDL) RPC protocol compiler to support DCE
2335311Samw	RPC/MSRPC and SMB/CIFS.  ndrgen takes an input protocol definition
2345311Samw	file (say, proto.ndl) and generates an output C source file
2355311Samw	(proto_ndr.c) containing the Network Data Representation (NDR)
2365311Samw	marshalling routines to implement the RPC protocol.
2375311Samw
2380Sstevel@tonic-gatenightly
2390Sstevel@tonic-gate	nightly build script. Takes an environment (or 'env') file describing
2400Sstevel@tonic-gate	such things as the workspace, the parent, and what to build. See
2410Sstevel@tonic-gate	env/developer and env/gatekeeper for sample, hopefully well-commented
2420Sstevel@tonic-gate	env files.
2430Sstevel@tonic-gate
2440Sstevel@tonic-gatepmodes
2450Sstevel@tonic-gate	enforces proper file ownership and permissions in pkgmap and package
2460Sstevel@tonic-gate	prototype* files.  converts files if necessary
2470Sstevel@tonic-gate
2480Sstevel@tonic-gateprotocmp
2490Sstevel@tonic-gate	compares proto lists and the package definitions. Used by nightly
2500Sstevel@tonic-gate	to determine if the proto area matches the packages, and to detect
2510Sstevel@tonic-gate	differences between a childs proto area and a parents.
2520Sstevel@tonic-gate
2530Sstevel@tonic-gateprotocmp.terse
2540Sstevel@tonic-gate	transforms the output of protocmp into something a bit more friendly
2550Sstevel@tonic-gate
2560Sstevel@tonic-gateprotolist
2570Sstevel@tonic-gate	create a list of what's in the proto area, to feed to protocmp.
2580Sstevel@tonic-gate
2597078Smjnelsonrtichk
2607078Smjnelson	checks that a set of CRs have approved RTIs.  Primarily used
2617078Smjnelson	by wx
2627078Smjnelson
2630Sstevel@tonic-gatesccscp
2640Sstevel@tonic-gate	copy a file under SCCS control to another location in a workspace.
2650Sstevel@tonic-gate	also updates teamware's nametable.
2660Sstevel@tonic-gate
2670Sstevel@tonic-gatesccshist
2680Sstevel@tonic-gate	Display the history, comments and diffs, of a file under SCCS
2690Sstevel@tonic-gate	control.
2700Sstevel@tonic-gate
2710Sstevel@tonic-gatesccsmv
2720Sstevel@tonic-gate	rename a file under SCCS control to another location in a workspace.
2730Sstevel@tonic-gate	also updates teamware's nametable.
2740Sstevel@tonic-gate
2750Sstevel@tonic-gatesccsrm
2760Sstevel@tonic-gate	delete a file under SCCS control workspace. also updates teamware's
2770Sstevel@tonic-gate	nametable. Actually renames it to .del-<file>-`date` so that others
2780Sstevel@tonic-gate	will see it move when it is brought over (in case they were working
2790Sstevel@tonic-gate	on it).
2800Sstevel@tonic-gate
2810Sstevel@tonic-gatews
2820Sstevel@tonic-gate	creates a shell with the environment set up to build in the given
2830Sstevel@tonic-gate	workspace. Used mostly for non-full-build workspaces, so it sets up
2840Sstevel@tonic-gate	to pull headers and libraries from the proto area of the parent if
2850Sstevel@tonic-gate	they aren't in the childs proto area.
2860Sstevel@tonic-gate
2870Sstevel@tonic-gatewx
2880Sstevel@tonic-gate	A great workspace tool by bonwick. See wx.README for information
2890Sstevel@tonic-gate	and warnings.
2900Sstevel@tonic-gate
2917078Smjnelsonwx2hg
2927078Smjnelson	Converts a TeamWare workspace under the control of wx to a
2937078Smjnelson	Mercurial workspace, discarding intermediate deltas.
2947078Smjnelson
2950Sstevel@tonic-gatetokenize
2960Sstevel@tonic-gate	Used to build the sun4u boot block.
2970Sstevel@tonic-gate
2980Sstevel@tonic-gatewebrev
2990Sstevel@tonic-gate	Generates a set of HTML pages that show side-by-side diffs of
3000Sstevel@tonic-gate	changes in your workspace, for easy communication of code
3010Sstevel@tonic-gate	review materials.  Can automagically find edited files or use a
3020Sstevel@tonic-gate	manually-generated list; knows how to use wx's active file for
3030Sstevel@tonic-gate	lists of checked-out files and proposed SCCS comments.
3040Sstevel@tonic-gate
3057078Smjnelsonwhich_scm
3067078Smjnelson	Reports the current Source Code Management (SCM) system in use
3077078Smjnelson	and the top-level directory of the workspace.
3087078Smjnelson
3092538Sesaxewsdiff
3102538Sesaxe	Detect object differences between two ON proto areas. Used by
3112538Sesaxe	nightly(1) to determine what changed between two builds. Handy
3122538Sesaxe	for identifying the set of built objects impacted by a given
3132538Sesaxe	source change. This information is needed for patch construction.
3142538Sesaxe
3152538Sesaxe
3160Sstevel@tonic-gateHow to do a full build
3170Sstevel@tonic-gate----------------------
3180Sstevel@tonic-gate
3190Sstevel@tonic-gate1. Find an environment file that might do what you want to do. If you're just
3200Sstevel@tonic-gate   a developer wanting to do a full build in a child of the gate, copy the
3210Sstevel@tonic-gate   'developer' environment file to a new name (private to you and/or the
3220Sstevel@tonic-gate   work being done in this workspace, to avoid collisions with others). Then
3230Sstevel@tonic-gate   edit the file and tailor it to your workspace. Remember that this file
3240Sstevel@tonic-gate   is a shell script, so it can do more than set environment variables.
3250Sstevel@tonic-gate
3262294Smeem2. Login as 'gk' (or root, but your PATH and .make.machines for dmake will
3270Sstevel@tonic-gate   not be right). Run 'nightly' and give it your environment file as an
3280Sstevel@tonic-gate   option. 'nightly' will first look for your environment file in
3290Sstevel@tonic-gate   /opt/onbld/env, and if it's not there then it will look for it as an
3300Sstevel@tonic-gate   absolute or relative path. Some people put their environment files in
3310Sstevel@tonic-gate   their workspace to keep them close.
3320Sstevel@tonic-gate
3330Sstevel@tonic-gate3. When 'nightly' is complete, it will send a summary of what happened to
3340Sstevel@tonic-gate   $MAILTO. Usually, the less info in the mail the better. If you have failures,
3350Sstevel@tonic-gate   you can go look at the full log of what happened, generally in
3360Sstevel@tonic-gate   $CODEMGR_WS/log/log.<date>/nightly.log (the mail_msg it sent and the proto
3370Sstevel@tonic-gate   list are there too). You can also find the individual build logs, like
3380Sstevel@tonic-gate   'make clobber' and 'make install' output in $SRC, under names like
3390Sstevel@tonic-gate   clobber-${MACH}.out and install-${MACH}.out (for a DEBUG build). These
3400Sstevel@tonic-gate   will be smaller than nightly.log, and maybe more searchable.
3410Sstevel@tonic-gate
3420Sstevel@tonic-gateFiles you have to update to add a tool
3430Sstevel@tonic-gate--------------------------------------
3440Sstevel@tonic-gate
3450Sstevel@tonic-gate1.  Add the tool in its appropriate place.
3460Sstevel@tonic-gate2.  Update the Makefile as required.
3470Sstevel@tonic-gate3.  Update usr/src/tools/SUNWonbld/prototype_*.
3482217Smeem4.  Update usr/src/tools/README.tools (this file).
3492217Smeem5.  Repeat 1-4 for any man pages.
350