Print this page
1575 untangle libmlrpc ... (smbsrv)
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/tools/quick/make-smbsrv
+++ new/usr/src/tools/quick/make-smbsrv
1 1 #!/bin/ksh
2 2 #
3 3 # This file and its contents are supplied under the terms of the
4 4 # Common Development and Distribution License ("CDDL"), version 1.0.
5 5 # You may only use this file in accordance with the terms of version
6 6 # 1.0 of the CDDL.
7 7 #
8 8 # A full copy of the text of the CDDL should have accompanied this
9 9 # source. A copy of the CDDL is also available via the Internet at
10 10 # http://www.illumos.org/license/CDDL.
11 11 #
12 12
13 13 #
14 14 # Copyright 2018 Nexenta Systems, Inc. All rights reserved.
15 15 #
16 16
17 17 # Use distributed make (dmake) by default.
18 18 make=${MAKE:-dmake}
19 19
20 20 CLOSED_IS_PRESENT=no
21 21 export CLOSED_IS_PRESENT
22 22
23 23 # Do this if you want to use dbx or gdb
24 24 # export SOURCEDEBUG=yes
25 25
26 26 [ -n "$SRC" ] || {
27 27 echo "SRC not set. Run 'ws' or 'bldenv' first."
28 28 exit 1
29 29 }
30 30
31 31 cpu=`uname -p`
32 32 case $cpu in
33 33 i386)
34 34 x=intel
35 35 kmdb_arch="amd64"
36 36 mdb_arch="ia32 amd64"
37 37 arch64=amd64
38 38 ;;
39 39 sparc)
40 40 x=sparc
41 41 kmdb_arch=v9
42 42 mdb_arch="v7 v9"
43 43 arch64=sparcv9
44 44 ;;
45 45 *) echo "Huh?" ; exit 1;;
46 46 esac
47 47
48 48 ################################################################
49 49
50 50 build_tools() {
51 51 test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets ||
52 52 (cd $SRC/tools && $make install)
53 53 (cd $SRC/common/mapfiles; $make install)
54 54 }
55 55
56 56 clobber_tools() {
57 57 (cd $SRC/tools && $make clobber)
58 58 (cd $SRC/common/mapfiles; $make clobber)
59 59 }
60 60
61 61 ################################################################
62 62
63 63 do_hdrs() {
64 64
65 65 targ=$1
66 66 if [ "$targ" = clobber ]
67 67 then
68 68 (cd $SRC/uts && $make -k clobber_h)
69 69 (cd $SRC/head && $make clobber)
70 70 fi
71 71
72 72 if [ "$targ" = install ]
73 73 then
74 74 targ=install_h
75 75
76 76 # Just the parts of "make sgs" we need, and
77 77 # skip them if they appear to be done.
78 78 # ... stuff under $SRC
79 79 test -f $SRC/uts/common/sys/priv_names.h ||
80 80 (cd $SRC/uts && $make -k all_h)
81 81
82 82 test -f $SRC/head/rpcsvc/nispasswd.h ||
83 83 (cd $SRC/head && $make -k install_h)
84 84
85 85 # ... stuff under $ROOT (proto area)
86 86 test -d $ROOT/usr/include/sys ||
87 87 (cd $SRC && $make rootdirs)
88 88 test -f $ROOT/usr/include/sys/types.h ||
89 89 (cd $SRC/uts && $make -k install_h)
90 90 test -f $ROOT/usr/include/rpcsvc/daemon_utils.h ||
91 91 (cd $SRC/head && $make install_h)
92 92
93 93 # always update the smbsrv headers to be safe
94 94 (cd $SRC/uts/common/gssapi && $make -k install_h)
95 95 (cd $SRC/uts/common/sys && $make -k install_h)
96 96 (cd $SRC/uts/common/smb && $make -k install_h)
97 97 (cd $SRC/uts/common/smbsrv && $make -k install_h)
98 98
99 99 fi
100 100
101 101 # Need some library headers too...
102 102 for lib in \
103 103 libads \
104 104 libbsm \
105 105 libcmdutils \
106 106 libcryptoutil \
107 107 libdevid \
108 108 libfakekernel \
109 109 libgss \
110 110 libkrb5 \
111 111 libidmap \
112 112 libpam \
113 113 libsec \
114 114 libscf \
115 115 libshare \
116 116 libsmbfs \
117 117 libsqlite \
118 118 libuutil \
119 119 passwdutil \
120 120 smbsrv
121 121 do
122 122 (cd $SRC/lib/$lib && $make $targ)
123 123 done
124 124 }
125 125
126 126 ################################################################
127 127
128 128 do_kern() {
129 129 case $1 in
130 130 lint) targ=modlintlib ;;
131 131 *) targ=$1 ;;
132 132 esac
133 133 ( unset SOURCEDEBUG ;
134 134 (cd $SRC/uts/$x/nsmb && $make $targ) ;
135 135 (cd $SRC/uts/$x/smbfs && $make $targ) ;
136 136 (cd $SRC/uts/$x/smbsrv && $make $targ) )
137 137 }
138 138
139 139 ################################################################
140 140
141 141 # Note lib1 builds prerequisite libraries not delivered by the
142 142 # tar file we create below. To accelerate clean/install, we
143 143 # skip these on clean (but still nuke them for clobber)
144 144
145 145 do_lib1() {
146 146
147 147 for lib in \
148 148 libavl \
149 149 libgss \
150 150 libkrb5 \
151 151 libcmdutils \
152 152 libsqlite \
153 153 libuutil
154 154 do
155 155 (cd $SRC/lib/$lib && $make $1)
156 156 done
157 157 }
158 158
159 159 # lib2 builds stuff we include in the tar file,
160 160 # or that we don't mind rebuilding after clean.
161 161
162 162 do_lib2() {
163 163
164 164 for lib in \
165 165 libfakekernel \
166 166 libads \
167 167 libsmbfs
168 168 do
169 169 (cd $SRC/lib/$lib && $make $1)
170 170 done
171 171
172 172 (cd $SRC/lib/libshare && $make $1 PLUGINS=smb)
173 173 (cd $SRC/lib/smbsrv && $make $1)
174 174 (cd $SRC/lib/passwdutil && $make $1)
175 175 (cd $SRC/lib/pam_modules/smb && $make $1)
176 176
177 177 }
178 178
179 179 ################################################################
180 180
181 181 do_cmds() {
182 182
183 183 case $1 in
184 184 install)
185 185 # mount programs need fslib.o
186 186 (cd $SRC/cmd/fs.d && $make fslib.o)
187 187 (cd $SRC/cmd/fs.d/smbclnt && $make $1 catalog)
188 188 ;;
189 189 clean|clobber)
190 190 (cd $SRC/cmd/fs.d/smbclnt && $make $1)
191 191 (cd $SRC/cmd/fs.d && $make ${1}_local)
192 192 ;;
193 193 esac
194 194
195 195 (cd $SRC/cmd/devfsadm && $make $1)
196 196 (cd $SRC/cmd/smbsrv && $make $1)
197 197
198 198 # Build the MDB modules, WITH the linktest
199 199 (cd $SRC/cmd/mdb/tools && $make $1)
200 200
201 201 # kmdb_arch is 64-bit only
202 202 for a in $kmdb_arch
203 203 do
204 204 case $1 in
205 205 install|lint)
206 206 (cd $SRC/cmd/mdb/$x/$a/kmdb &&
207 207 $make kmdb_modlinktest.o )
208 208 ;;
209 209 clean|clobber)
210 210 (cd $SRC/cmd/mdb/$x/$a/kmdb &&
211 211 $make -k $1 )
212 212 ;;
213 213 esac
214 214 (cd $SRC/cmd/mdb/$x/$a/nsmb &&
215 215 $make $1 KMDB_LINKTEST_ENABLE= )
216 216 (cd $SRC/cmd/mdb/$x/$a/smbfs &&
217 217 $make $1 KMDB_LINKTEST_ENABLE= )
218 218 (cd $SRC/cmd/mdb/$x/$a/smbsrv &&
219 219 $make $1 KMDB_LINKTEST_ENABLE= )
220 220 done
221 221
222 222 # mdb_arch is both 32-bit & 64-bit
223 223 for a in $mdb_arch
224 224 do
225 225 (cd $SRC/cmd/mdb/$x/$a/libfksmbsrv &&
226 226 $make $1 )
227 227
228 228 # We build these libraries (to the proto area), so we need to
229 229 # build the mdb modules too so mdb will load them.
230 230 (cd $SRC/cmd/mdb/$x/$a/libcmdutils &&
231 231 $make $1 )
232 232 (cd $SRC/cmd/mdb/$x/$a/libavl &&
233 233 $make $1 )
234 234
235 235 done
236 236
237 237 (cd $SRC/cmd/Adm/sun && $make $1)
238 238
239 239 # Deal with mode 0400 file annoyance...
240 240 # See usr/src/cmd/Adm/sun/Makefile
241 241 if [ $1 = install ]; then
242 242 chmod a+r $ROOT/var/smb/smbpasswd
243 243 fi
244 244 }
245 245
246 246
247 247 ################################################################
248 248 # This builds $SRC/TAGS (and cscope.files) in a helpful order.
249 249
250 250 do_tags() {
251 251 (cd $SRC ;
252 252 find uts/common/sys -name '*.[ch]' -print |sort
253 253 find uts/common/net -name '*.[ch]' -print |sort
254 254 find uts/common/netinet -name '*.[ch]' -print |sort
255 255 find uts/common/smb -name '*.[ch]' -print |sort
256 256 find uts/common/smbsrv -name '*.ndl' -print |sort
257 257 find uts/common/smbsrv -name '*.[ch]' -print |sort
258 258 find uts/common/fs/smbsrv -name '*.[ch]' -print |sort
259 259 find uts/common/gssapi -name '*.[ch]' -print |sort
260 260 find head -name '*.h' -print |sort
261 261 find lib/smbsrv -name '*.[ch]' -print |sort
262 262 find lib/libsmbfs -name '*.[ch]' -print |sort
263 263 find lib/libads -name '*.[ch]' -print |sort
264 264 find lib/libgss -name '*.[ch]' -print |sort
265 265 find cmd/smbsrv -name '*.[ch]' -print |sort
266 266 find common/smbsrv -name '*.[ch]' -print |sort
267 267 ) > $SRC/cscope.files
268 268
269 269 (cd $SRC ;
270 270 exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files
271 271 cscope -b )
272 272 }
273 273
274 274 ################################################################
275 275 # This creates a tarfile one can use to update a test machine.
276 276
277 277 do_tar() {
278 278 git_rev=`git rev-parse --short=8 HEAD`
279 279 files="
↓ open down ↓ |
279 lines elided |
↑ open up ↑ |
280 280 lib/svc/manifest/network/smb/server.xml
281 281 usr/kernel/drv/$arch64/smbsrv
282 282 usr/kernel/kmdb/$arch64/smbsrv
283 283 usr/lib/fs/smb/$arch64/libshare_smb.so.1
284 284 usr/lib/fs/smb/libshare_smb.so.1
285 285 usr/lib/libsmbfs.so.1
286 286 usr/lib/mdb/kvm/$arch64/smbsrv.so
287 287 usr/lib/reparse/libreparse_smb.so.1
288 288 usr/lib/security/pam_smb_passwd.so.1
289 289 usr/lib/smbsrv/dtrace
290 -usr/lib/smbsrv/libmlrpc.so.1
290 +usr/lib/libmlrpc.so.1
291 291 usr/lib/smbsrv/libmlsvc.so.1
292 292 usr/lib/smbsrv/libsmb.so.1
293 293 usr/lib/smbsrv/libsmbns.so.1
294 294 usr/lib/smbsrv/smbd
295 295 usr/sbin/devfsadm
296 296 usr/sbin/smbadm
297 297 usr/sbin/smbstat
298 298 "
299 299
300 300 (cd $ROOT && tar cfj ../../smbsrv-${git_rev}.tar.bz2 $files)
301 301 }
302 302
303 303 ################################################################
304 304
305 305 if [ "$1" = "" ]; then
306 306 set '?' # force usage
307 307 fi
308 308
309 309 set -x
310 310
311 311 for arg
312 312 do
313 313 case "$arg" in
314 314 install)
315 315 build_tools
316 316 set -e
317 317 do_hdrs $arg
318 318 do_kern $arg
319 319 do_lib1 $arg
320 320 do_lib2 $arg
321 321 do_cmds $arg
322 322 ;;
323 323 lint)
324 324 do_kern $arg
325 325 do_lib1 $arg
326 326 do_lib2 $arg
327 327 do_cmds $arg
328 328 ;;
329 329 clean)
330 330 # intentionally skip: lib1, hdrs, tools
331 331 do_cmds $arg
332 332 do_lib2 $arg
333 333 do_kern $arg
334 334 ;;
335 335 clobber)
336 336 do_cmds $arg
337 337 do_lib2 $arg
338 338 do_lib1 $arg
339 339 do_kern $arg
340 340 do_hdrs $arg
341 341 clobber_tools
342 342 ;;
343 343 tags)
344 344 do_tags
345 345 ;;
346 346 tar)
347 347 do_tar
348 348 ;;
349 349 *)
350 350 echo "Usage: $0 {install|lint|clean|clobber|tags|tar}";
351 351 exit 1;
352 352 ;;
353 353 esac
354 354 done
↓ open down ↓ |
54 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX