1 OpenSolaris Buildable Source
2
3 #ident "@(#)README.opensolaris.tmpl 1.2 07/05/03 SMI"
4
5 Note: if this is your first OpenSolaris installation, please see the
6 currently known issues section below to see the minimum build of
7 Solaris Express - Community Release required to build and install
8 OpenSolaris. Either an initial install or an upgrade will work,
9 provided you use the "Entire Distribution" metacluster.
10
11 This delivery of the Buildable Source consists of 4 or 5 pieces:
12
13 1. encumbered binaries tarball (on-closed-bins-DATE.PLATFORM.tar.bz2)
14 2. compiler (Sun Studio 11 is the preferred compiler, and it is free
15 for OpenSolaris community members. You can also use gcc; more on
16 that below.)
17 3. ON build tools package (SUNWonbld-DATE.PLATFORM.tar.bz2)
18 4. Pre-built BFU archives (on-bfu-DATE.PLATFORM.tar.bz2)
19 5. source tarball (on-src-DATE.tar.bz2; numbered builds only)
20
21 If you just want to install the pre-built archives, you'll need the ON
22 build tools and the BFU archives. The tar file will unpack the
23 archives into archives-DATE/PLATFORM/ (e.g.,
24 archives-20050612/i386/). You should review Section A
25 (changes since the last delivery) and Section B (known issues) before
26 following the BFU instructions in the Developer's Reference
27 (http://www.opensolaris.org/os/community/onnv/devref_toc/).
28
29 If you want to build from source, you will need the source, compiler,
30 ON tools, and "extras" tools. The encumbered binaries tarball contains
31 complete binaries (libraries, kernel modules, commands) that are
32 compatible with the source. These are binaries that cannot be built
33 using only the source tarball for one reason or another. If you wish
34 to build the kernel (or some portion of it), or if you wish to build a
35 complete set of installable archives, you will want the encumbered
36 binaries.
37
38 Currently, to obtain source, you can either download the
39 on-src-DATE.tar.bz2 tarball if you are downloading a build-synchronised
40 delivery. Or, you can checkout from the Mercurial repository at
41 (please see instructions at: http://opensolaris.org/os/project/onnv/)
42
43 The buildable source contains the source for our high key-strength
44 crypto, known as the Encryption Kit (SUNWcry, SUNWcryr, SUNWcryptoint).
45 Please note that certain countries restrict the redistribtuion of
46 high key-strength crypto. If you live in one of these countries,
47 it is your responsibility to ensure that you are complying with your
48 country's laws in this area.
49
50 For general questions on the buildable source, please ask on the
51 OpenSolaris Help discussion list (opensolaris-help <at> opensolaris
52 <dot> org). For detailed comments about the code, please use
53 OpenSolaris Code discussion list. Please note that the mailing lists
54 are configured to only allow posts via the web forum interface or from
55 list subscribers.
56
57
58 Currently Known Issues
59 ----------------------
60 These were some of the major known issues at the time of this
61 delivery. The most recent list is available on the OpenSolaris.org
62 website in the Nevada community at:
63 http://opensolaris.org/os/community/onnv/known_issues/
64
65 The current minimum SXCR build needed to build the OpenSolaris sources
66 is Nevada build 76.
67
68 1. The sources cannot be used to generate Solaris (pkgadd(1m))
69 packages. (CRs 6414822, 6370204.)
70
71 2. "Install -i" has not been tested on all platforms. It is known not
72 to work for the lw8 platform (CR 4818202).
73
74 3. Cross-compilation between SPARC and x86 is not supported. But
75 builds on x86 systems (amd64 or i386) will build both amd64 and
76 i386 binaries.
77
78 This is unlikely to be fixed any time soon. If you want to build
79 both SPARC and x86, your choices are (a) create two workspaces, or
80 (b) access a single workspace using NFS. If you use a single
81 workspace, you'll want to do a "make clean" or "make clobber"
82 before building the other platform. Note that nightly(1) will do a
83 "make clobber" for you.
84
85 4. You may see console warnings like
86
87 Feb 26 13:55:48 magneto sshd[100804]: libpkcs11: Cannot load PKCS#11
88 library /usr/lib/security/pkcs11_softtoken_extra.so. dlerror:
89 ld.so.1: /usr/lib/ssh/sshd: fatal:
90 /usr/lib/security/pkcs11_softtoken_extra.so: open failed: No
91 such file or directory. See cryptoadm(1M). Skipping this plug-in.
92 Feb 26 13:55:48 magneto sshd[100804]: Kerberos mechanism library
93 initialization error: unknown error.
94
95 These messages can be ignored unless you need working crypto (e.g.,
96 Kerberos). To fix, change pkcs11_softtoken_extra.so to
97 pkcs11_softtoken.so in /etc/crypto/pkcs11.conf and do "svcadm
98 restart cryptosvc".
99
100 5. bfu needs to be cleaned up so that it can easily handle flag days
101 when run externally. This has been coded and mostly tested (CR
102 4865419). This will also fix the "could not copy" error messages.
103
104 6. Zones depends on SVR4 packaging data, which is not available in
105 OpenSolaris itself currently. Therefore Zones will not work unless
106 your distribution vendor provides packages. Note that BFU understands
107 Zones, so that BFUing on top of a distribution, such as Solaris Express,
108 that includes package support will work and will also update any
109 existing Zones you may have configured.
110
111
112
113 Installing from Source
114 ----------------------
115
116 Once you have downloaded the tarballs that you need, here are the
117 steps to build the sources.
118
119 Suppose you are using /export/testws as your workspace.
120
121 1. cd to /export/testws and unpack the sources and encumbered
122 binaries, e.g.,
123
124 $ bzcat on-src-DATE.tar.bz2 | tar xf -
125 $ bzcat on-closed-bins-DATE.PLATFORM.tar.bz2 | tar xf -
126
127 The sources will unpack into "usr/src" and the binaries will unpack
128 into "closed/root_PLATFORM" (i.e., closed/root_i386 or
129 closed/root_sparc).
130
131 2. Install the compiler according to the instructions at the download
132 site. (Of course, if the compilers have not changed since you last
133 installed them, there is no need to install them again.) The result
134 should have the compilers installed in /opt/SUNWspro.
135
136 Please note that the compiler that comes with the Solaris Developer
137 Express release is Studio 12, which is not the standard compiler
138 for OpenSolaris code. If you use Studio 12, you will need to set
139 __SSNEXT to the null string in your environment file. Please do
140 report problems with Studio 12, particularly if the problem goes
141 away when you use Studio 11 (the current standard compiler).
142
143 If you already have the Studio 11 compiler installed, you can use
144 it, provided you have the following patches installed:
145
146 SPARC:
147 120760-07 Sun Studio 11: Compiler Common patch for Sun C C++ F77 F95
148 121017-02 Sun Studio 11: Patch for Sun C++ 5.8 compiler
149 121021-02 Sun Studio 11: Patch for Fortran 95 Dynamic Libraries
150 121019-02 Sun Studio 11: Patch for Fortran 95 8.2 Compiler
151 121015-02 Sun Studio 11: Patch for Sun C 5.8 compiler
152
153 x86:
154 120759-06 Sun Studio 11_x86: Sun Compiler Common patch for x86 backend
155 121016-02 Sun Studio 11_x86: Patch for Sun C_x86 5.8 Compiler
156 121018-02 Sun Studio 11_x86: Patch for Sun C++ 5.8 compiler
157
158 You may find it easier to install the Studio 11 compilers using the
159 tarballs, rather than installing them as packages.
160
161 3a. Remove the existing onbld tools, if any.
162
163 - If this is the first time you are installing build tools, skip ahead
164 to step 3b.
165
166 - Otherwise, use pkgrm(1M) to remove the old package.
167
168 3b. Install the current onbld tools.
169
170 - The SUNWonbld package is a pkgadd-format directory that has been
171 archived using tar and bzip2. Unpack it in a temporary directory and
172 use pkgadd(1M) to install it. For example:
173
174 # cd /var/tmp
175 # bzip2 -dc /path/to/SUNWonbld-DATE.PLATFORM.tar.bz2 | tar xf -
176 # pkgadd -d onbld SUNWonbld
177
178 4. Update your environment and login dot-files if this is the first
179 time you have installed the compiler and/or build tools.
180
181 - Add /opt/SUNWspro/bin and /opt/onbld/bin to your $PATH.
182 - Either remove /usr/ucb from your $PATH, or put it at the end.
183
184 5. Create an environment file to guide tools like nightly(1) and
185 bldenv(1).
186
187 - copy /export/testws/usr/src/tools/env/opensolaris.sh to
188 /export/testws. It doesn't have to go in /export/testws, but
189 that's a convenient place to put it. Nor do you have to keep the
190 name opensolaris.sh, but that's the name we'll use in these notes.
191
192 Then make the following changes in your opensolaris.sh:
193
194 - change GATE to the name of the top-level directory (e.g.,
195 "testws").
196
197 - change CODEMGR_WS to the top-level path (e.g., "/export/testws").
198
199 - change STAFFER to your login.
200
201 - (optional) customize VERSION. This is the string that "uname -v"
202 will print.
203
204 6. To build a complete set of archives, cd to /export/testws, utter
205
206 nightly ./opensolaris.sh &
207
208 and find something else to work on for a few hours. You can
209 monitor the build's progress using ptree(1). nightly(1) will send
210 mail to $MAILTO when it has finished.
211
212 The results mail from nightly(1) will have an overview of the build
213 results. A copy of the mail text and a more detailed log file will
214 be available in the workspace (/export/testws/log/log.<mmdd>).
215 Pieces of the detailed log are also available under usr/src. For
216 example, usr/src/install-i386.out will have the log from the x86
217 "make install" part of the build.
218
219 By default nightly(1) will do a "clobber" build, which includes a
220 "make clobber" and blowing away any files that earlier builds
221 installed into $ROOT (/export/testws/proto/root_PLATFORM). To
222 bypass these steps, do an incremental build with "nightly -i
223 ./opensolaris.sh &".
224
225 7. To build a specific component, first use bldenv(1) to set up
226 various environment variables, then cd to the subtree that you want
227 to build. For example:
228
229 $ cd /export/testws
230 $ bldenv -d ./opensolaris.sh
231 [status information from bldenv]
232 $ cd usr/src/cmd/vi
233 $ dmake all
234
235 To build the kernel, run dmake(1) from usr/src/uts.
236
237 If you encounter errors, try running with a clean environment:
238 $ env - HOME=$HOME SHELL=$SHELL DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY TERM=$TERM LOGNAME=$LOGNAME LANG=C LC_ALL=C PAGER=less MANPATH=$MANPATH /opt/onbld/bin/bldenv ./opensolaris.sh
239
240 Please see the Developer's Reference for information on how to install
241 kernels (using Install(1)) and archives (using BFU).
242
243