Print this page
NEX-13644 File access audit logging
Reviewed by: Gordon Ross <gordon.ross@nexenta.com>
Reviewed by: Roman Strashkin <roman.strashkin@nexenta.com>
Reviewed by: Saso Kiselkov <saso.kiselkov@nexenta.com>
Reviewed by: Rick McNeal <rick.mcneal@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
NEX-3486 Backport illumos 5321 Convenience scripts to build...
5321 Convenience scripts to build/clean smbsrv, idmap, zfs
Reviewed by: Alek Pinchuk <alek.pinchuk@nexenta.com>
Reviewed by: Ilya Usvyatsky <ilya.usvyatsky@nexenta.com>
Reviewed by: Kevin Crowe <kevin.crowe@nexenta.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Conflicts:
usr/src/tools/quick/make-idmap
usr/src/tools/quick/make-smbsrv
usr/src/tools/quick/make-zfs
OS-139 POSIX write should imply DELETE_CHILD on directories - and some additional considerations
OS-3 Convenience scripts to build/clean smbsrv, zfs
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/tools/quick/make-zfs
+++ new/usr/src/tools/quick/make-zfs
1 1 #!/bin/ksh
2 2 #
3 3 # This file and its contents are supplied under the terms of the
|
↓ open down ↓ |
3 lines elided |
↑ open up ↑ |
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 -# Copyright 2014 Nexenta Systems, Inc. All rights reserved.
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 [ -n "$SRC" ] || {
24 24 echo "SRC not set. Run 'ws' or 'bldenv' first."
25 25 exit 1
26 26 }
27 27
28 28 cpu=`uname -p`
29 29 case $cpu in
30 30 i386)
31 31 x=intel
32 + kmdb_arch="amd64"
32 33 mdb_arch="ia32 amd64"
33 34 arch32=i86
34 35 arch64=amd64
35 36 ;;
36 37 sparc)
37 38 x=sparc
38 - mdb_arch=v9
39 + kmdb_arch=v9
40 + mdb_arch="v7 v9"
39 41 arch32=sparc
40 42 arch64=sparcv9
41 43 ;;
42 44 *) echo "Huh?" ; exit 1;;
43 45 esac
44 46
45 47 ################################################################
46 48
47 49 build_tools() {
48 50 test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets ||
49 51 (cd $SRC/tools && $make install)
50 52 (cd $SRC/common/mapfiles; $make install)
51 53 }
52 54
53 55 clobber_tools() {
54 56 (cd $SRC/tools && $make clobber)
55 57 (cd $SRC/common/mapfiles; $make clobber)
56 58 }
57 59
58 60 ################################################################
59 61
60 62 do_hdrs() {
61 63
62 64 targ=$1
63 65 if [ "$targ" = clobber ]
64 66 then
65 67 (cd $SRC/uts && $make -k clobber_h)
66 68 (cd $SRC/head && $make clobber)
67 69 fi
68 70
69 71 if [ "$targ" = install ]
70 72 then
71 73 targ=install_h
72 74
73 75 # Just the parts of "make sgs" we need, and
74 76 # skip them if they appear to be done.
75 77 # ... stuff under $SRC
76 78 test -f $SRC/uts/common/sys/priv_names.h ||
77 79 (cd $SRC/uts && $make -k all_h)
78 80
|
↓ open down ↓ |
30 lines elided |
↑ open up ↑ |
79 81 test -f $SRC/head/rpcsvc/nispasswd.h ||
80 82 (cd $SRC/head && $make -k install_h)
81 83
82 84 # ... stuff under $ROOT (proto area)
83 85 test -d $ROOT/usr/include/sys ||
84 86 (cd $SRC && $make rootdirs)
85 87 test -f $ROOT/usr/include/sys/types.h ||
86 88 (cd $SRC/uts && $make -k install_h)
87 89 test -f $ROOT/usr/include/rpcsvc/daemon_utils.h ||
88 90 (cd $SRC/head && $make install_h)
91 + (cd $SRC/uts/common/c2 && $make -k install_h)
89 92
90 93 # always update the sys headers to be safe
91 94 (cd $SRC/uts/common/sys && $make -k install_h)
92 95
93 96 fi
94 97
95 98 # Need some library headers too...
96 99 for lib in \
97 100 libbsm \
98 101 libcmdutils \
99 102 libcryptoutil \
100 103 libdevid \
101 104 libdiskmgt \
102 105 libidmap \
103 106 libpam \
104 107 libsec \
105 108 libscf \
106 109 libshare \
107 110 libuutil \
108 111 libzpool \
109 112 libzfs_core \
110 113 libzfs \
111 114 libzfs_jni
112 115 do
113 116 (cd $SRC/lib/$lib && $make $targ)
114 117 done
115 118 # Should fix the Makefile here so all_h or install_h works.
116 119 (cd $SRC/lib/libzpool/$cpu && $make ../common/zfs.h)
117 120 }
118 121
119 122 ################################################################
120 123
121 124 do_kern() {
122 125 case $1 in
123 126 lint) targ=modlintlib ;;
124 127 *) targ=$1 ;;
125 128 esac
126 129 (cd $SRC/uts/$x/zfs && $make $targ)
127 130 }
128 131
129 132 ################################################################
130 133 #
131 134 # Build all libraries used by the other targets in here.
132 135 #
133 136 # Run this once (at least) in each new workspace where you
134 137 # will run "make-zfs install", if you want to avoid linking
135 138 # against the libraries from your build host.
136 139 #
137 140 do_deplibs() {
138 141
139 142 # install all the lib headers
140 143 if [ "$1" = install ] ; then
141 144 (cd $SRC/lib && $make install_h)
142 145 fi
143 146
144 147 # Wow, building libc takes a while. Really want that?
145 148 for lib in \
146 149 libc \
147 150 libavl \
148 151 libnvpair \
149 152 libsec \
150 153 libcmdutils \
151 154 libdevinfo \
152 155 libuutil \
153 156 libbrand \
154 157 libzonecfg \
155 158 libinetutil \
156 159 libdladm \
157 160 libdlpi \
158 161 libdiskmgt \
159 162 libumem \
160 163 libdisasm \
161 164 libidmap \
162 165 libdevid \
163 166 libsaveargs
164 167 do
165 168 (cd $SRC/lib/$lib && $make $1)
166 169 done
167 170 }
168 171
169 172 ################################################################
170 173
171 174 do_libs() {
172 175
173 176 for lib in \
174 177 libavl \
175 178 libcmdutils \
176 179 libuutil \
177 180 libzpool \
178 181 libzfs_core \
179 182 libzfs \
180 183 libzfs_jni \
181 184 pyzfs
182 185 do
183 186 (cd $SRC/lib/$lib && $make $1)
184 187 done
185 188 (cd $SRC/lib/libshare && $make $1 PLUGINS=)
186 189 }
187 190
188 191 ################################################################
189 192
190 193 do_cmds() {
191 194
192 195 for cmd in \
193 196 availdevs \
194 197 isaexec \
195 198 fstyp \
196 199 zdb \
197 200 zfs \
198 201 zhack \
199 202 zinject \
200 203 zpool \
201 204 ztest \
202 205 zstreamdump \
203 206 pyzfs
204 207 do
205 208 (cd $SRC/cmd/$cmd && $make $1)
206 209 done
207 210
208 211 case $1 in
209 212 install)
210 213 # mount programs need fslib.o
211 214 (cd $SRC/cmd/fs.d/zfs && $make $1)
212 215 # Build just the ZFS devfsadm module
213 216 (cd $SRC/cmd/devfsadm/$cpu && $make SUNW_zfs_link.so \
214 217 ${ROOT}/usr/lib/devfsadm/linkmod \
215 218 ${ROOT}/usr/lib/devfsadm/linkmod/SUNW_zfs_link.so )
216 219 ;;
217 220 clean|clobber)
|
↓ open down ↓ |
119 lines elided |
↑ open up ↑ |
218 221 (cd $SRC/cmd/fs.d/zfs && $make clobber)
219 222 (cd $SRC/cmd/fs.d && $make ${1}_local)
220 223 (cd $SRC/cmd/devfsadm && $make $1)
221 224 ;;
222 225 esac
223 226
224 227 (cd $SRC/cmd/syseventd/modules/zfs_mod && $make $1)
225 228
226 229 # Build the MDB modules, WITH the linktest
227 230 (cd $SRC/cmd/mdb/tools && $make $1)
228 -for a in $mdb_arch
231 +
232 +# kmdb_arch is 64-bit only
233 +for a in $kmdb_arch
229 234 do
230 235 case $1 in
231 236 install|lint)
232 237 (cd $SRC/cmd/mdb/$x/$a/kmdb &&
233 238 $make kmdb_modlinktest.o )
234 239 ;;
235 240 clean|clobber)
236 241 (cd $SRC/cmd/mdb/$x/$a/kmdb &&
237 242 $make -k $1 )
238 243 ;;
239 244 esac
240 245
241 246 (cd $SRC/cmd/mdb/$x/$a/zfs &&
242 247 $make $1 KMDB_LINKTEST_ENABLE= )
243 248
249 +done
250 +
251 +# mdb_arch is both 32-bit & 64-bit
252 +for a in $mdb_arch
253 +do
244 254 (cd $SRC/cmd/mdb/$x/$a/libzpool &&
245 255 $make $1 )
246 256
247 257 done
248 258 }
249 259
250 260 ################################################################
251 261
252 262 do_mans() {
253 263
254 264 case "$1" in
255 265 install)
256 266 (cd $SRC/man/man1m && make \
257 267 $ROOT/usr/share/man/man1m/zdb.1m \
258 268 $ROOT/usr/share/man/man1m/zfs.1m \
259 269 $ROOT/usr/share/man/man1m/zfs-program.1m \
260 270 $ROOT/usr/share/man/man1m/zpool.1m )
261 271 (cd $SRC/man/man5 && make \
262 272 $ROOT/usr/share/man/man5/zpool-features.5 )
263 273 ;;
264 274 lint)
265 275 (cd $SRC/man/man1m && make zdb.1m.check zfs.1m.check zfs-program.1m.check \
266 276 zpool.1m.check)
267 277 (cd $SRC/man/man5 && make zpool-features.5.check)
268 278 ;;
269 279 *)
270 280 (cd $SRC/man/man1m && make $1)
271 281 (cd $SRC/man/man5 && make $)
272 282 ;;
273 283 esac
274 284 }
275 285
276 286 ################################################################
277 287 # This builds $SRC/TAGS (and cscope.files) in a helpful order.
278 288
279 289 do_tags() {
280 290 (cd $SRC ;
281 291 find uts/common/sys -name '*.[ch]' -print |sort
282 292 find uts/common/fs/zfs -name '*.[ch]' -print |sort
283 293 find lib/libzpool -name '*.[ch]' -print |sort
284 294 find lib/libzfs -name '*.[ch]' -print |sort
285 295 find cmd/zpool -name '*.[ch]' -print |sort
286 296 find cmd/zfs -name '*.[ch]' -print |sort
287 297 find cmd/zdb -name '*.[ch]' -print |sort
288 298 find cmd/zhack -name '*.[ch]' -print |sort
289 299 find cmd/zinject -name '*.[ch]' -print |sort
290 300 find cmd/ztest -name '*.[ch]' -print |sort
291 301 find common/zfs -name '*.[ch]' -print |sort
292 302 echo cmd/mdb/common/modules/zfs/zfs.c
293 303 ) > $SRC/cscope.files
294 304
295 305 (cd $SRC ;
296 306 exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files
|
↓ open down ↓ |
43 lines elided |
↑ open up ↑ |
297 307 cscope -b )
298 308 }
299 309
300 310 ################################################################
301 311 # This creates a tarfile one can use to update a test machine.
302 312
303 313 do_tar() {
304 314 git_rev=`git rev-parse --short=8 HEAD`
305 315 files="
306 316 kernel/drv/$arch64/zfs
307 -kernel/drv/zfs
308 317 kernel/fs/$arch64/zfs
309 -kernel/fs/zfs
310 318 kernel/kmdb/$arch64/zfs
311 -kernel/kmdb/zfs
312 319 lib/$arch64/libzfs.so.1
313 320 lib/$arch64/libzfs_core.so.1
314 321 lib/libzfs.so.1
315 322 lib/libzfs_core.so.1
316 323 usr/bin/$arch32/ztest
317 324 usr/bin/$arch64/ztest
318 325 usr/lib/$arch64/libzfs_jni.so.1
319 326 usr/lib/$arch64/libzpool.so.1
320 327 usr/lib/devfsadm/linkmod/SUNW_zfs_link.so
321 328 usr/lib/fs/zfs/bootinstall
322 329 usr/lib/fs/zfs/fstyp.so.1
323 330 usr/lib/libzfs_jni.so.1
324 331 usr/lib/libzpool.so.1
325 332 usr/lib/mdb/kvm/$arch64/zfs.so
326 -usr/lib/mdb/kvm/zfs.so
327 333 usr/lib/mdb/proc/$arch64/libzpool.so
328 334 usr/lib/mdb/proc/libzpool.so
329 335 sbin/zfs
330 336 sbin/zpool
331 337 usr/lib/sysevent/modules/zfs_mod.so
332 338 usr/lib/zfs/availdevs
333 339 usr/lib/zfs/pyzfs.py
334 340 usr/lib/zfs/pyzfs.pyc
335 341 usr/sbin/$arch32/zdb
336 342 usr/sbin/$arch64/zdb
337 343 usr/sbin/$arch32/zhack
338 344 usr/sbin/$arch64/zhack
339 345 usr/sbin/$arch32/zinject
340 346 usr/sbin/$arch64/zinject
341 347 usr/sbin/zstreamdump
342 348 usr/share/man/man1m/zdb.1m
343 349 usr/share/man/man1m/zfs.1m
344 350 usr/share/man/man1m/zfs-program.1m
345 351 usr/share/man/man1m/zpool.1m
346 352 usr/share/man/man5/zpool-features.5
347 353 "
348 354 (cd $ROOT && tar cfj ../../zfs-${git_rev}.tar.bz2 $files)
349 355 }
350 356
351 357 ################################################################
352 358
353 359 if [ "$1" = "" ]; then
354 360 set '?' # force usage
355 361 fi
356 362
357 363 set -x
358 364
359 365 for arg
360 366 do
361 367 case "$arg" in
362 368 install)
363 369 build_tools
364 370 set -e
365 371 do_hdrs $arg
366 372 do_kern $arg
367 373 do_libs $arg
368 374 do_cmds $arg
369 375 do_mans $arg
370 376 ;;
371 377 lint)
372 378 do_kern $arg
373 379 do_libs $arg
374 380 do_cmds $arg
375 381 do_mans $arg
376 382 ;;
377 383 clean)
378 384 do_mans $arg
379 385 do_cmds $arg
380 386 do_libs $arg
381 387 do_kern $arg
382 388 ;;
383 389 clobber)
384 390 do_mans $arg
385 391 do_cmds $arg
386 392 do_libs $arg
387 393 do_kern $arg
388 394 do_hdrs $arg
389 395 clobber_tools
390 396 ;;
391 397 deplibs)
392 398 build_tools
393 399 set -e
394 400 do_hdrs install
395 401 do_deplibs install
396 402 ;;
397 403 tags)
398 404 do_tags
399 405 ;;
400 406 tar)
401 407 do_tar
402 408 ;;
403 409 *)
404 410 echo "Usage: $0 {install|lint|clean|clobber|deplibs|tags|tar}";
405 411 exit 1;
406 412 ;;
407 413 esac
408 414 done
|
↓ open down ↓ |
72 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX