#!/bin/ksh # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright 2014 Nexenta Systems, Inc. All rights reserved. # # Use distributed make (dmake) by default. make=${MAKE:-dmake} CLOSED_IS_PRESENT=no export CLOSED_IS_PRESENT # Do this if you want to use dbx or gdb # export SOURCEDEBUG=yes [ -n "$SRC" ] || { echo "SRC not set. Run 'ws' or 'bldenv' first." exit 1 } cpu=`uname -p` case $cpu in i386) x=intel mdb_arch="ia32 amd64" arch64=amd64 ;; sparc) x=sparc mdb_arch=v9 arch64=sparcv9 ;; *) echo "Huh?" ; exit 1;; esac ################################################################ build_tools() { test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets || (cd $SRC/tools && $make install) (cd $SRC/common/mapfiles; $make install) } clobber_tools() { (cd $SRC/tools && $make clobber) (cd $SRC/common/mapfiles; $make clobber) } ################################################################ do_hdrs() { targ=$1 if [ "$targ" = clobber ] then (cd $SRC/uts && $make -k clobber_h) (cd $SRC/head && $make clobber) fi if [ "$targ" = install ] then targ=install_h # Just the parts of "make sgs" we need, and # skip them if they appear to be done. # ... stuff under $SRC test -f $SRC/uts/common/sys/priv_names.h || (cd $SRC/uts && $make -k all_h) test -f $SRC/head/rpcsvc/nispasswd.h || (cd $SRC/head && $make -k install_h) # ... stuff under $ROOT (proto area) test -d $ROOT/usr/include/sys || (cd $SRC && $make rootdirs) test -f $ROOT/usr/include/sys/types.h || (cd $SRC/uts && $make -k install_h) test -f $ROOT/usr/include/rpcsvc/daemon_utils.h || (cd $SRC/head && $make install_h) # system headers (cd $SRC/uts/common/sys && $make -k install_h) fi # Need some library headers too... for lib in \ libgss \ libkrb5 do (cd $SRC/lib/$lib && $make $targ) done } ################################################################ do_kern() { case $1 in lint) targ=modlintlib ;; *) targ=$1 ;; esac ( unset SOURCEDEBUG ; (cd $SRC/uts/$x/kgssapi && $make $targ) ) } ################################################################ do_libs() { for lib in \ libgss do (cd $SRC/lib/$lib && $make $1) done # For some reason, mech_krb5 does not build for debug. # It also takes forever to lint. skip that. if [ "$1" != "lint" ]; then (cd $SRC/lib/gss_mechs/mech_krb5 && unset SOURCEDEBUG && $make $1) (cd $SRC/lib/gss_mechs/mech_spnego && $make $1) fi } ################################################################ do_cmds() { (cd $SRC/cmd/gss && $make $1) } ################################################################ # This builds $SRC/TAGS (and cscope.files) in a helpful order. do_tags() { (cd $SRC ; find uts/common/sys -name '*.[ch]' -print |sort find uts/common/net -name '*.[ch]' -print |sort find uts/common/netinet -name '*.[ch]' -print |sort find uts/common/gssapi -name '*.[ch]' -print |sort find head -name '*.h' -print |sort find lib/gss_mechs -name '*.[ch]' -print |sort find cmd/gss -name '*.[ch]' -print |sort ) > $SRC/cscope.files (cd $SRC ; exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files cscope -b ) } ################################################################ # This creates a tarfile one can use to update a test machine. do_tar() { git_rev=`git rev-parse --short=8 HEAD` files=" usr/lib/gss/gssd usr/lib/gss/mech_krb5.so.1 usr/lib/$arch64/gss/mech_krb5.so.1 usr/lib/gss/mech_spnego.so.1 usr/lib/$arch64/gss/mech_spnego.so.1 usr/lib/libgss.so.1 usr/lib/$arch64/libgss.so.1 " (cd $ROOT && tar cfj ../../gss-${git_rev}.tar.bz2 $files) } ################################################################ if [ "$1" = "" ]; then set '?' # force usage fi set -x for arg do case "$arg" in build|install) arg=install build_tools set -e do_hdrs $arg do_kern $arg do_libs $arg do_cmds $arg ;; lint) do_kern $arg do_libs $arg do_cmds $arg ;; clean) do_cmds $arg do_libs $arg do_kern $arg ;; clobber) do_cmds $arg do_libs $arg do_kern $arg do_hdrs $arg clobber_tools ;; tags) do_tags ;; tar) do_tar ;; *) echo "Usage: $0 {build|lint|clean|clobber|tags|tar}"; exit 1; ;; esac done #!/bin/ksh # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright 2018 Nexenta Systems, Inc. All rights reserved. # # Use distributed make (dmake) by default. make=${MAKE:-dmake} CLOSED_IS_PRESENT=no export CLOSED_IS_PRESENT # Do this if you want to use dbx or gdb # export SOURCEDEBUG=yes [ -n "$SRC" ] || { echo "SRC not set. Run 'ws' or 'bldenv' first." exit 1 } cpu=`uname -p` case $cpu in i386) x=intel mdb_arch="ia32 amd64" arch64=amd64 ;; sparc) x=sparc mdb_arch=v9 arch64=sparcv9 ;; *) echo "Huh?" ; exit 1;; esac ################################################################ build_tools() { test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets || (cd $SRC/tools && $make install) (cd $SRC/common/mapfiles; $make install) } clobber_tools() { (cd $SRC/tools && $make clobber) (cd $SRC/common/mapfiles; $make clobber) } ################################################################ do_hdrs() { targ=$1 if [ "$targ" = clobber ] then (cd $SRC/uts && $make -k clobber_h) (cd $SRC/head && $make clobber) fi if [ "$targ" = install ] then targ=install_h # Just the parts of "make sgs" we need, and # skip them if they appear to be done. # ... stuff under $SRC test -f $SRC/uts/common/sys/priv_names.h || (cd $SRC/uts && $make -k all_h) test -f $SRC/head/rpcsvc/nispasswd.h || (cd $SRC/head && $make -k install_h) # ... stuff under $ROOT (proto area) test -d $ROOT/usr/include/sys || (cd $SRC && $make rootdirs) test -f $ROOT/usr/include/sys/types.h || (cd $SRC/uts && $make -k install_h) test -f $ROOT/usr/include/rpcsvc/daemon_utils.h || (cd $SRC/head && $make install_h) # system and smbsrv headers (we need to build libsmb) (cd $SRC/uts/common/sys && $make -k install_h) (cd $SRC/uts/common/smb && $make -k install_h) (cd $SRC/uts/common/smbsrv && $make -k install_h) fi # Need some library headers too... for lib in \ libads \ libbsm \ libcmdutils \ libcryptoutil \ libdevid \ libgss \ libkrb5 \ libldap5 \ libidmap \ libsmbfs \ libsqlite \ libuutil do (cd $SRC/lib/$lib && $make $targ) done } ################################################################ do_kern() { case $1 in lint) targ=modlintlib ;; *) targ=$1 ;; esac ( unset SOURCEDEBUG ; (cd $SRC/uts/$x/idmap && $make $targ) ) } ################################################################ do_libs() { for lib in \ libavl \ libcmdutils \ libldap5 \ libadutils \ libuutil \ libidmap \ libads \ libsmbfs \ libsqlite \ nsswitch/ad do (cd $SRC/lib/$lib && $make $1) done # need libsmb for cmd/idmap/idmapd (and libsmbfs for libsmb) (cd $SRC/lib/smbsrv/libsmb && $make $1) } ################################################################ do_cmds() { (cd $SRC/cmd/idmap && $make $1) } ################################################################ # This builds $SRC/TAGS (and cscope.files) in a helpful order. do_tags() { (cd $SRC ; find uts/common/sys -name '*.[ch]' -print |sort find uts/common/net -name '*.[ch]' -print |sort find uts/common/netinet -name '*.[ch]' -print |sort find uts/common/rpcsvc -name '*.[ch]' -print |sort find uts/common/idmap -name '*.[ch]' -print |sort find head -name '*.h' -print |sort find lib/libidmap -name '*.[ch]' -print |sort find lib/libadutils -name '*.[ch]' -print |sort find lib/libldap5 -name '*.[ch]' -print |sort find cmd/idmap -name '*.[ch]' -print |sort ) > $SRC/cscope.files (cd $SRC ; exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files cscope -b ) } ################################################################ # This creates a tarfile one can use to update a test machine. do_tar() { git_rev=`git rev-parse --short=8 HEAD` files=" kernel/misc/amd64/idmap lib/svc/manifest/system/idmap.xml usr/lib/idmapd usr/lib/libads.so.1 usr/lib/$arch64/libads.so.1 usr/lib/libadutils.so.1 usr/lib/$arch64/libadutils.so.1 usr/lib/libidmap.so.1 usr/lib/$arch64/libidmap.so.1 usr/lib/libldap.so.5 usr/lib/$arch64/libldap.so.5 usr/lib/nss_ad.so.1 usr/lib/$arch64/nss_ad.so.1 usr/bin/test-getdc usr/sbin/idmap usr/sbin/nltest " (cd $ROOT && tar cfj ../../idmap-${git_rev}.tar.bz2 $files) } ################################################################ if [ "$1" = "" ]; then set '?' # force usage fi set -x for arg do case "$arg" in build|install) arg=install build_tools set -e do_hdrs $arg do_kern $arg do_libs $arg do_cmds $arg ;; lint) do_kern $arg do_libs $arg do_cmds $arg ;; clean) do_cmds $arg do_libs $arg do_kern $arg ;; clobber) do_cmds $arg do_libs $arg do_kern $arg do_hdrs $arg clobber_tools ;; tags) do_tags ;; tar) do_tar ;; *) echo "Usage: $0 {build|lint|clean|clobber|tags|tar}"; exit 1; ;; esac done #!/bin/ksh # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright 2021 Tintri by DDN, Inc. All rights reserved. # # Use normal make (not dmake) by default. make=${MAKE:-make} # Set this if you want to use dbx or gdb: # export SOURCEDEBUG=yes [ -n "$SRC" ] || { echo "SRC not set. Run 'ws' or 'bldenv' first." exit 1 } cpu=`uname -p` case $cpu in i386) x=intel kmdb_arch="amd64" mdb_arch="ia32 amd64" arch64=amd64 ;; sparc) x=sparc kmdb_arch=v9 mdb_arch="v7 v9" arch64=sparcv9 ;; *) echo "Unknown architecture" ; exit 1;; esac ################################################################ build_tools() { test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets || (cd $SRC/tools && $make install) (cd $SRC/common/mapfiles; $make install) } clobber_tools() { (cd $SRC/tools && $make clobber) (cd $SRC/common/mapfiles; $make clobber) } # end build_tools() ################################################################ do_hdrs() { targ=$1 if [ "$targ" = clobber ] then (cd $SRC/uts && $make -k clobber_h) (cd $SRC/head && $make clobber) fi if [ "$targ" = install ] then targ=install_h # Just the parts of "make sgs" we need, and # skip them if they appear to be done. # ... stuff under $SRC test -f $SRC/uts/common/sys/priv_names.h || (cd $SRC/uts && $make -k all_h) test -f $SRC/head/rpcsvc/nispasswd.h || (cd $SRC/head && $make -k $targ) # ... stuff under $ROOT (proto area) test -d $ROOT/usr/include/sys || (cd $SRC && $make rootdirs) test -f $ROOT/usr/include/sys/types.h || (cd $SRC/uts && $make -k $targ) test -f $ROOT/usr/include/rpcsvc/daemon_utils.h || (cd $SRC/head && $make $targ) # always update the NFS (kernel) headers to be safe (cd $SRC/uts/common/gssapi && $make -k $targ) (cd $SRC/uts/common/sys && $make -k $targ) (cd $SRC/uts/common/nfs && $make -k $targ) fi # Need some library headers too... for lib in \ libcmdutils \ libcryptoutil \ libidmap \ libpam \ libsec \ libzfs_core \ libzfs \ libshare \ libuutil \ librpcsvc \ libmapid do (cd $SRC/lib/$lib && $make $targ) done } # end do_hdrs() ################################################################ do_kern() { case $1 in *) targ=$1 ;; esac ( unset SOURCEDEBUG ; (cd $SRC/uts/$x/nfs && $make $targ) ; (cd $SRC/uts/$x/nfs_dlboot && $make $targ) ; (cd $SRC/uts/$x/nfssrv && $make $targ) ; (cd $SRC/uts/$x/klmmod && $make $targ) ; (cd $SRC/uts/$x/klmops && $make $targ) ) } # end do_kern() ################################################################ # Note lib1 builds prerequisite libraries not delivered by the # tar file we create below. To accelerate clean/install, we # skip these on clean (but still nuke them for clobber) do_lib1() { for lib in \ libavl \ libuutil \ libcmdutils \ libidmap \ libzfs_core \ libzfs do (cd $SRC/lib/$lib && $make $1) done } # lib2 builds stuff we include in the tar file, # or that we don't mind rebuilding after clean. do_lib2() { for lib in \ librpcsvc \ libmapid do (cd $SRC/lib/$lib && $make $1) done (cd $SRC/lib/libshare && $make $1 PLUGINS=nfs) } # end do_lib1() and do_lib2() ################################################################ do_cmds() { case $1 in install) # mount programs need fslib.o (cd $SRC/cmd/fs.d && $make fslib.o) (cd $SRC/cmd/fs.d/nfs && $make $1 catalog) ;; clean|clobber) (cd $SRC/cmd/fs.d/nfs && $make $1) (cd $SRC/cmd/fs.d && $make ${1}_local) ;; esac # Build the MDB modules, WITH the linktest (cd $SRC/cmd/mdb/tools && $make $1) # kmdb_arch is 64-bit only for a in $kmdb_arch do case $1 in install|lint) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make kmdb_modlinktest.o ) ;; clean|clobber) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make -k $1 ) ;; esac (cd $SRC/cmd/mdb/$x/$a/nfs && $make $1 KMDB_LINKTEST_ENABLE= ) (cd $SRC/cmd/mdb/$x/$a/klmmod && $make $1 KMDB_LINKTEST_ENABLE= ) done } # end do_cmds() ################################################################ # This builds $SRC/TAGS (and cscope.files) in a helpful order. do_tags() { (cd $SRC ; find uts/common/sys -name '*.[ch]' -print |sort find uts/common/net -name '*.[ch]' -print |sort find uts/common/netinet -name '*.[ch]' -print |sort find uts/common/nfs -name '*.[ch]' -print |sort find uts/common/rpc -name '*.[ch]' -print |sort find uts/common/klm -name '*.[ch]' -print |sort find uts/common/fs/nfs -name '*.[ch]' -print |sort find uts/common/gssapi -name '*.[ch]' -print |sort find head -name '*.h' -print |sort find cmd/fs.d/nfs -name '*.[ch]' -print |sort ) > $SRC/cscope.files (cd $SRC ; exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files cscope -b ) } #end do_tags() ################################################################ # This creates tarfiles one can use to update a test machine. do_tar() { git_rev=`git rev-parse --short=8 HEAD` # NFS (everything) files=" kernel/kmdb/$arch64/klmmod kernel/kmdb/$arch64/nfs kernel/misc/$arch64/klmmod kernel/misc/$arch64/klmops kernel/misc/$arch64/nfs_dlboot kernel/misc/$arch64/nfssrv kernel/fs/$arch64/nfs kernel/sys/$arch64/nfs lib/svc/manifest/network/nfs/cbd.xml lib/svc/manifest/network/nfs/client.xml lib/svc/manifest/network/nfs/mapid.xml lib/svc/manifest/network/nfs/nfslogd.xml lib/svc/manifest/network/nfs/nlockmgr.xml lib/svc/manifest/network/nfs/rquota.xml lib/svc/manifest/network/nfs/server.xml lib/svc/manifest/network/nfs/status.xml lib/svc/method/nfs-client lib/svc/method/nfs-server lib/svc/method/nlockmgr usr/bin/nfsstat usr/lib/fs/nfs/$arch64/libshare_nfs.so.1 usr/lib/fs/nfs/libshare_nfs.so.1 usr/lib/fs/nfs/dfmounts usr/lib/fs/nfs/dfshares usr/lib/fs/nfs/nfsfind usr/lib/fs/nfs/showmount usr/lib/fs/nfs/umount usr/lib/mdb/kvm/$arch64/klmmod.so usr/lib/mdb/kvm/$arch64/nfs.so usr/lib/nfs/libmapid.so.1 usr/lib/nfs/lockd usr/lib/nfs/mountd usr/lib/nfs/nfs4cbd usr/lib/nfs/nfsd usr/lib/nfs/nfslogd usr/lib/nfs/nfsmapid usr/lib/nfs/rquotad usr/lib/nfs/statd usr/lib/reparse/$arch64/libnfs_basic.so.1 usr/lib/reparse/libnfs_basic.so.1 usr/sbin/clear_locks usr/sbin/exportfs usr/sbin/nfsref " (cd $ROOT && tar cfj ../../nfs-${git_rev}.tar.bz2 $files) # KLM kmod files=" kernel/misc/$arch64/klmmod kernel/misc/$arch64/klmops " (cd $ROOT && tar cfj ../../klm-${git_rev}.tar.bz2 $files) } # end do_tar() ################################################################ if [ "$1" = "" ]; then set '?' # force usage fi set -x for arg do case "$arg" in install) build_tools set -e do_hdrs $arg do_kern $arg do_lib1 $arg do_lib2 $arg do_cmds $arg ;; clean) # intentionally skip: lib1, hdrs, tools do_cmds $arg do_lib2 $arg do_kern $arg ;; clobber) do_cmds $arg do_lib2 $arg do_lib1 $arg do_kern $arg do_hdrs $arg clobber_tools ;; tags) do_tags ;; tar) do_tar ;; *) echo "Usage: $0 {install|clean|clobber|tags|tar}"; exit 1; ;; esac done #!/bin/ksh # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright 2017 Nexenta Systems, Inc. All rights reserved. # # Use ordinary make (not dmake) by default. make=${MAKE:-make} # Do this if you want to use dbx or gdb # export SOURCEDEBUG=yes [ -n "$SRC" ] || { echo "SRC not set. Run 'ws' or 'bldenv' first." exit 1 } cpu=`uname -p` case $cpu in i386) x=intel kmdb_arch="amd64" mdb_arch="ia32 amd64" arch64=amd64 ;; sparc) x=sparc kmdb_arch=v9 mdb_arch="v7 v9" arch64=sparcv9 ;; *) echo "Huh?" ; exit 1;; esac ################################################################ build_tools() { test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets || (cd $SRC/tools && $make install) (cd $SRC/common/mapfiles; $make install) } clobber_tools() { (cd $SRC/tools && $make clobber) (cd $SRC/common/mapfiles; $make clobber) } ################################################################ do_hdrs() { targ=$1 if [ "$targ" = clobber ] then (cd $SRC/uts && $make -k clobber_h) (cd $SRC/head && $make clobber) fi if [ "$targ" = install ] then targ=install_h # Just the parts of "make sgs" we need, and # skip them if they appear to be done. # ... stuff under $SRC test -f $SRC/uts/common/sys/priv_names.h || (cd $SRC/uts && $make -k all_h) test -f $SRC/head/rpcsvc/nispasswd.h || (cd $SRC/head && $make -k install_h) # ... stuff under $ROOT (proto area) test -d $ROOT/usr/include/sys || (cd $SRC && $make rootdirs) test -f $ROOT/usr/include/sys/types.h || (cd $SRC/uts && $make -k install_h) test -f $ROOT/usr/include/rpcsvc/daemon_utils.h || (cd $SRC/head && $make install_h) # always update the smb headers to be safe (cd $SRC/uts/common/smb && $make -k install_h) fi # Need some library headers too... for lib in \ libcmdutils \ libcryptoutil \ libfakekernel \ libmlrpc \ libpam \ libsec \ libshare \ libsmbfs \ passwdutil do (cd $SRC/lib/$lib && $make $targ) done } ################################################################ do_kern() { case $1 in lint) targ=modlintlib ;; *) targ=$1 ;; esac ( unset SOURCEDEBUG ; (cd $SRC/uts/$x/nsmb && $make $targ) ; (cd $SRC/uts/$x/smbfs && $make $targ) ) } ################################################################ # Note lib1 builds prerequisite libraries not delivered by the # tar file we create below. To accelerate clean/install, we # skip these on clean (but still nuke them for clobber) do_lib1() { for lib in \ libavl \ libcmdutils do (cd $SRC/lib/$lib && $make $1) done } # lib2 builds stuff we include in the tar file, # or that we don't mind rebuilding after clean. do_lib2() { (cd $SRC/lib/libsmbfs && $make $1) [ "$1" = install ] && (cd $SRC/lib/libsmbfs && $make _msg) for lib in \ libfakekernel \ libsmbfs \ libmlrpc \ smbclnt do (cd $SRC/lib/$lib && $make $1) done (cd $SRC/lib/libshare && $make $1 PLUGINS=smbfs) (cd $SRC/lib/passwdutil && $make $1) (cd $SRC/lib/pam_modules/smbfs && $make $1) } ################################################################ do_cmds() { case $1 in install) # mount programs need fslib.o (cd $SRC/cmd/fs.d && $make fslib.o) (cd $SRC/cmd/fs.d/smbclnt && $make $1 catalog) ;; clean|clobber) (cd $SRC/cmd/fs.d/smbclnt && $make $1) (cd $SRC/cmd/fs.d && $make ${1}_local) ;; esac # Build the MDB modules, WITH the linktest (cd $SRC/cmd/mdb/tools && $make $1) # kmdb_arch is 64-bit only for a in $kmdb_arch do case $1 in install|lint) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make kmdb_modlinktest.o ) ;; clean|clobber) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make -k $1 ) ;; esac (cd $SRC/cmd/mdb/$x/$a/nsmb && $make $1 KMDB_LINKTEST_ENABLE= ) (cd $SRC/cmd/mdb/$x/$a/smbfs && $make $1 KMDB_LINKTEST_ENABLE= ) done # mdb_arch is both 32-bit & 64-bit for a in $mdb_arch do (cd $SRC/cmd/mdb/$x/$a/libfknsmb && $make $1 ) (cd $SRC/cmd/mdb/$x/$a/libfksmbfs && $make $1 ) done } ################################################################ # This builds $SRC/TAGS (and cscope.files) in a helpful order. do_tags() { (cd $SRC ; find uts/common/sys -name '*.[ch]' -print |sort find uts/common/net -name '*.[ch]' -print |sort find uts/common/netinet -name '*.[ch]' -print |sort find uts/common/smb -name '*.[ch]' -print |sort find uts/common/netsmb -name '*.[ch]' -print |sort find uts/common/fs/smbclnt -name '*.[ch]' -print |sort find head -name '*.h' -print |sort find lib/smbclnt -name '*.[ch]' -print |sort find lib/libsmbfs -name '*.[ch]' -print |sort find cmd/fs.d/smbclnt -name '*.[ch]' -print |sort find common/smbclnt -name '*.[ch]' -print |sort ) > $SRC/cscope.files (cd $SRC ; exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files cscope -b ) } ################################################################ # This creates a tarfile one can use to update a test machine. do_tar() { git_rev=`git rev-parse --short=8 HEAD` files=" etc/security/exec_attr.d/SUNWsmbfs lib/svc/manifest/network/smb/client.xml lib/svc/method/smb-client usr/bin/smbutil usr/kernel/drv/$arch64/nsmb usr/kernel/fs/$arch64/smbfs usr/kernel/kmdb/$arch64/nsmb usr/kernel/kmdb/$arch64/smbfs usr/lib/$arch64/libsmbfs.so.1 usr/lib/fs/smbfs/$arch64/libshare_smbfs.so.1 usr/lib/fs/smbfs/chacl usr/lib/fs/smbfs/dfshares usr/lib/fs/smbfs/libshare_smbfs.so.1 usr/lib/fs/smbfs/lsacl usr/lib/fs/smbfs/mount usr/lib/fs/smbfs/share usr/lib/fs/smbfs/umount usr/lib/fs/smbfs/unshare usr/lib/libmlrpc.so.2 usr/lib/libsmbfs.so.1 usr/lib/mdb/kvm/$arch64/nsmb.so usr/lib/mdb/kvm/$arch64/smbfs.so usr/lib/security/$arch64/pam_smbfs_login.so.1 usr/lib/security/pam_smbfs_login.so.1 usr/lib/smbfs/smbiod usr/lib/smbfs/smbiod-svc " (cd $ROOT && tar cfj ../../smbclnt-${git_rev}.tar.bz2 $files) } ################################################################ if [ "$1" = "" ]; then set '?' # force usage fi set -x for arg do case "$arg" in install) build_tools set -e do_hdrs $arg do_kern $arg do_lib1 $arg do_lib2 $arg do_cmds $arg ;; lint) do_kern $arg do_lib1 $arg do_lib2 $arg do_cmds $arg ;; clean) # intentionally skip: lib1, hdrs, tools do_cmds $arg do_lib2 $arg do_kern $arg ;; clobber) do_cmds $arg do_lib2 $arg do_lib1 $arg do_kern $arg do_hdrs $arg clobber_tools ;; tags) do_tags ;; tar) do_tar ;; *) echo "Usage: $0 {install|lint|clean|clobber|tags|tar}"; exit 1; ;; esac done #!/bin/ksh # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright 2022 Tintri by DDN, Inc. All rights reserved. # # Use normal make (not dmake) by default. make=${MAKE:-make} CLOSED_IS_PRESENT=no export CLOSED_IS_PRESENT # Do this if you want to use dbx or gdb # export SOURCEDEBUG=yes [ -n "$SRC" ] || { echo "SRC not set. Run 'ws' or 'bldenv' first." exit 1 } cpu=`uname -p` case $cpu in i386) x=intel kmdb_arch="amd64" mdb_arch="ia32 amd64" arch64=amd64 ;; sparc) x=sparc kmdb_arch=v9 mdb_arch="v7 v9" arch64=sparcv9 ;; *) echo "Huh?" ; exit 1;; esac ################################################################ build_tools() { test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets || (cd $SRC/tools && $make install) (cd $SRC/common/mapfiles; $make install) } clobber_tools() { (cd $SRC/tools && $make clobber) (cd $SRC/common/mapfiles; $make clobber) } ################################################################ do_hdrs() { targ=$1 if [ "$targ" = clobber ] then (cd $SRC/uts && $make -k clobber_h) (cd $SRC/head && $make clobber) fi if [ "$targ" = install ] then targ=install_h # Just the parts of "make sgs" we need, and # skip them if they appear to be done. # ... stuff under $SRC test -f $SRC/uts/common/sys/priv_names.h || (cd $SRC/uts && $make -k all_h) test -f $SRC/head/rpcsvc/nispasswd.h || (cd $SRC/head && $make -k $targ) # ... stuff under $ROOT (proto area) test -d $ROOT/usr/include/sys || (cd $SRC && $make rootdirs) test -f $ROOT/usr/include/sys/types.h || (cd $SRC/uts && $make -k $targ) test -f $ROOT/usr/include/rpcsvc/daemon_utils.h || (cd $SRC/head && $make $targ) # always update the sys,smbsrv headers to be safe (cd $SRC/uts/common/gssapi && $make -k $targ) (cd $SRC/uts/common/sys && $make -k $targ) (cd $SRC/uts/common/smb && $make -k $targ) (cd $SRC/uts/common/smbsrv && $make -k $targ) (cd $SRC/uts/common/c2 && $make -k $targ) fi if [ "$targ" = lint ] then targ=check (cd $SRC/uts/common/smb && $make -k $targ) (cd $SRC/uts/common/smbsrv && $make -k $targ) fi # Need some library headers too... for lib in \ libc \ libnsl \ libnvpair \ libsocket \ \ libads \ libbrand \ libbsm \ libcmdutils \ libcryptoutil \ libdevid \ libdisasm \ libfakekernel \ libgss \ libidmap \ libinetutil \ libipsecutil \ libkrb5 \ libmlrpc \ libofmt \ libpam \ libsaveargs \ libsec \ libscf \ libshare \ libsmbfs \ libsqlite \ libuutil \ libzfs_core \ libzfs \ passwdutil \ pkcs11 \ smbsrv do (cd $SRC/lib/$lib && $make $targ) done } ################################################################ do_kern() { case $1 in lint) targ=modlintlib ;; *) targ=$1 ;; esac ( unset SOURCEDEBUG ; export NO_GENUNIX_UNIQUIFY= ; (cd $SRC/uts/$x/smbsrv && $make $targ) ) } ################################################################ # # Build all libraries used by the other targets in here. # # Run this once (at least) in each new workspace where you # will run "make-smbsrv install", if you want to avoid linking # against the libraries from your build host. # do_deplibs() { (cd $SRC/lib/ssp_ns && $make $1) (cd $SRC/lib/libc && $make $1) for lib in \ libm \ libmd \ libnsl \ libnvpair \ libsocket \ libavl \ libgss \ libgen \ libkrb5 \ libkstat \ libcmdutils \ libresolv2 \ libldap5 \ libsldap \ libreparse \ libpam \ libuutil \ libidmap \ libinetutil \ libdlpi \ libbsm \ libsec \ libsecdb \ libsqlite \ libumem \ libuuid \ libsaveargs \ libproc \ libscf \ libcryptoutil \ libmd5 \ libzfs_core \ libzfs \ pkcs11/libpkcs11 do # So we don't have to build EVERYTHING, set LDCHECKS= # when building the dependent libraries. (cd $SRC/lib/$lib && LDCHECKS='' $make $1) done } ################################################################ do_libs() { for lib in \ libfakekernel \ libads \ libidmap \ libofmt \ libsmbfs \ libmlrpc do (cd $SRC/lib/$lib && $make $1) done (cd $SRC/lib/libshare && $make $1 PLUGINS=smb) (cd $SRC/lib/smbsrv && $make $1) (cd $SRC/lib/passwdutil && $make $1) (cd $SRC/lib/pam_modules/smb && $make $1) } ################################################################ do_cmds() { (cd $SRC/cmd/smbsrv && $make $1) # Build the MDB modules, WITH the linktest (cd $SRC/cmd/mdb/tools && $make $1) # kmdb_arch is 64-bit only for a in $kmdb_arch do case $1 in install|lint) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make kmdb_modlinktest.o ) ;; clean|clobber) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make -k $1 ) ;; esac (cd $SRC/cmd/mdb/$x/$a/smbsrv && $make $1 KMDB_LINKTEST_ENABLE= ) done # mdb_arch is both 32-bit & 64-bit for a in $mdb_arch do # We build these libraries (to the proto area), so we need to # build the mdb modules for all dependent libraries too. for lib in libfksmbsrv libmlsvc list libavl do (cd $SRC/cmd/mdb/$x/$a/$lib && $make $1 ) done done } ################################################################ do_tests() { for d in test/test-runner test/libmlrpc-tests test/smbsrv-tests do [ -f $SRC/$d/Makefile ] && (cd $SRC/$d && $make $1) done } ################################################################ # This builds $SRC/TAGS (and cscope.files) in a helpful order. do_tags() { (cd $SRC ; find uts/common/sys -name '*.[ch]' -print |sort find uts/common/net -name '*.[ch]' -print |sort find uts/common/netinet -name '*.[ch]' -print |sort find uts/common/smb -name '*.[ch]' -print |sort find uts/common/smbsrv -name '*.ndl' -print |sort find uts/common/smbsrv -name '*.[ch]' -print |sort find uts/common/fs/smbsrv -name '*.[ch]' -print |sort find uts/common/gssapi -name '*.[ch]' -print |sort find common/smbsrv -name '*.[ch]' -print |sort find head -name '*.h' -print |sort find lib/smbsrv -name '*.[ch]' -print |sort find lib/libsmbfs -name '*.[ch]' -print |sort find lib/libmlrpc -name '*.ndl' -print |sort find lib/libmlrpc -name '*.[ch]' -print |sort find lib/libads -name '*.[ch]' -print |sort find lib/libgss -name '*.[ch]' -print |sort find cmd/smbsrv -name '*.[ch]' -print |sort ) > $SRC/cscope.files (cd $SRC ; exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files cscope -b ) } ################################################################ # This creates a tarfile one can use to update a test machine. do_tar() { git_rev=`git rev-parse --short=8 HEAD` files=" lib/svc/manifest/network/smb/server.xml usr/kernel/drv/$arch64/smbsrv usr/kernel/kmdb/$arch64/smbsrv usr/lib/fs/smb/$arch64/libshare_smb.so.1 usr/lib/fs/smb/libshare_smb.so.1 usr/lib/libsmbfs.so.1 usr/lib/mdb/kvm/$arch64/smbsrv.so usr/lib/mdb/proc/libmlsvc.so usr/lib/reparse/libreparse_smb.so.1 usr/lib/security/pam_smb_passwd.so.1 usr/lib/smbsrv/dtrace usr/lib/libmlrpc.so.2 usr/lib/smbsrv/libmlsvc.so.1 usr/lib/smbsrv/libsmb.so.1 usr/lib/smbsrv/libsmbns.so.1 usr/lib/smbsrv/nvlprint usr/lib/smbsrv/smbd usr/sbin/smbadm usr/sbin/smbstat " (cd $ROOT && tar cfj ../../smbsrv-${git_rev}.tar.bz2 $files) } ################################################################ if [ "$1" = "" ]; then set '?' # force usage fi set -x for arg do case "$arg" in install) build_tools set -e do_hdrs $arg do_kern $arg do_libs $arg do_cmds $arg do_tests $arg ;; lint) do_hdrs $arg do_kern $arg do_libs $arg do_cmds $arg ;; clean) # intentionally skip: deplib, hdrs, tools do_tests $arg do_cmds $arg do_libs $arg do_kern $arg ;; clobber) do_tests $arg do_cmds $arg do_libs $arg do_deplibs $arg do_kern $arg do_hdrs $arg clobber_tools ;; deplibs) build_tools set -e do_hdrs install do_deplibs install ;; tags) do_tags ;; tar) do_tar ;; *) echo "Usage: $0 {install|lint|clean|clobber|deplibs|tags|tar}"; exit 1; ;; esac done #!/bin/ksh # # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright 2018 Nexenta Systems, Inc. All rights reserved. # # Use distributed make (dmake) by default. make=${MAKE:-dmake} CLOSED_IS_PRESENT=no export CLOSED_IS_PRESENT [ -n "$SRC" ] || { echo "SRC not set. Run 'ws' or 'bldenv' first." exit 1 } cpu=`uname -p` case $cpu in i386) x=intel kmdb_arch="amd64" mdb_arch="ia32 amd64" arch32=i86 arch64=amd64 ;; sparc) x=sparc kmdb_arch=v9 mdb_arch="v7 v9" arch32=sparc arch64=sparcv9 ;; *) echo "Huh?" ; exit 1;; esac ################################################################ build_tools() { test -f $SRC/tools/proto/root_i386-nd/opt/onbld/bin/genoffsets || (cd $SRC/tools && $make install) (cd $SRC/common/mapfiles; $make install) } clobber_tools() { (cd $SRC/tools && $make clobber) (cd $SRC/common/mapfiles; $make clobber) } ################################################################ do_hdrs() { targ=$1 if [ "$targ" = clobber ] then (cd $SRC/uts && $make -k clobber_h) (cd $SRC/head && $make clobber) fi if [ "$targ" = install ] then targ=install_h # Just the parts of "make sgs" we need, and # skip them if they appear to be done. # ... stuff under $SRC test -f $SRC/uts/common/sys/priv_names.h || (cd $SRC/uts && $make -k all_h) test -f $SRC/head/rpcsvc/nispasswd.h || (cd $SRC/head && $make -k install_h) # ... stuff under $ROOT (proto area) test -d $ROOT/usr/include/sys || (cd $SRC && $make rootdirs) test -f $ROOT/usr/include/sys/types.h || (cd $SRC/uts && $make -k install_h) test -f $ROOT/usr/include/rpcsvc/daemon_utils.h || (cd $SRC/head && $make install_h) # always update the sys headers to be safe (cd $SRC/uts/common/sys && $make -k install_h) fi # Need some library headers too... for lib in \ libbsm \ libcmdutils \ libcryptoutil \ libdevid \ libdiskmgt \ libidmap \ libpam \ libsec \ libscf \ libshare \ libuutil \ libzpool \ libzfs_core \ libzfs \ libzfs_jni do (cd $SRC/lib/$lib && $make $targ) done # Should fix the Makefile here so all_h or install_h works. (cd $SRC/lib/libzpool/$cpu && $make ../common/zfs.h) } ################################################################ do_kern() { case $1 in lint) targ=modlintlib ;; *) targ=$1 ;; esac (cd $SRC/uts/$x/zfs && $make $targ) } ################################################################ # # Build all libraries used by the other targets in here. # # Run this once (at least) in each new workspace where you # will run "make-zfs install", if you want to avoid linking # against the libraries from your build host. # do_deplibs() { # install all the lib headers if [ "$1" = install ] ; then (cd $SRC/lib && $make install_h) fi # Wow, building libc takes a while. Really want that? for lib in \ libc \ libavl \ libnvpair \ libsec \ libcmdutils \ libdevinfo \ libuutil \ libbrand \ libzonecfg \ libinetutil \ libdladm \ libdlpi \ libdiskmgt \ libumem \ libdisasm \ libidmap \ libdevid \ libsaveargs do (cd $SRC/lib/$lib && $make $1) done } ################################################################ do_libs() { for lib in \ libavl \ libcmdutils \ libuutil \ libzpool \ libzfs_core \ libzfs \ libzfs_jni do (cd $SRC/lib/$lib && $make $1) done (cd $SRC/lib/libshare && $make $1 PLUGINS=) } ################################################################ do_cmds() { for cmd in \ availdevs \ isaexec \ fstyp \ zdb \ zfs \ zhack \ zinject \ zpool \ ztest \ zstreamdump do (cd $SRC/cmd/$cmd && $make $1) done case $1 in install) # mount programs need fslib.o (cd $SRC/cmd/fs.d/zfs && $make $1) # Build just the ZFS devfsadm module (cd $SRC/cmd/devfsadm/$cpu && $make SUNW_zfs_link.so \ ${ROOT}/usr/lib/devfsadm/linkmod \ ${ROOT}/usr/lib/devfsadm/linkmod/SUNW_zfs_link.so ) ;; clean|clobber) (cd $SRC/cmd/fs.d/zfs && $make clobber) (cd $SRC/cmd/fs.d && $make ${1}_local) (cd $SRC/cmd/devfsadm && $make $1) ;; esac (cd $SRC/cmd/syseventd/modules/zfs_mod && $make $1) # Build the MDB modules, WITH the linktest (cd $SRC/cmd/mdb/tools && $make $1) # kmdb_arch is 64-bit only for a in $kmdb_arch do case $1 in install|lint) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make kmdb_modlinktest.o ) ;; clean|clobber) (cd $SRC/cmd/mdb/$x/$a/kmdb && $make -k $1 ) ;; esac (cd $SRC/cmd/mdb/$x/$a/zfs && $make $1 KMDB_LINKTEST_ENABLE= ) done # mdb_arch is both 32-bit & 64-bit for a in $mdb_arch do (cd $SRC/cmd/mdb/$x/$a/libzpool && $make $1 ) done } ################################################################ do_mans() { case "$1" in install) (cd $SRC/man/man8 && make \ $ROOT/usr/share/man/man8/zdb.8 \ $ROOT/usr/share/man/man8/zfs.8 \ $ROOT/usr/share/man/man8/zfs-program.8 \ $ROOT/usr/share/man/man8/zpool.8 \ $ROOT/usr/share/man/man8/ztest.8 ) (cd $SRC/man/man7 && make \ $ROOT/usr/share/man/man7/zpool-features.7 ) ;; lint) (cd $SRC/man/man8 && make zdb.8.check zfs.8.check zfs-program.8.check \ zpool.8.check ztest.8.check) (cd $SRC/man/man7 && make zpool-features.7.check) ;; *) (cd $SRC/man/man8 && make $1) (cd $SRC/man/man7 && make $) ;; esac } ################################################################ # This builds $SRC/TAGS (and cscope.files) in a helpful order. do_tags() { (cd $SRC ; find uts/common/sys -name '*.[ch]' -print |sort find uts/common/fs/zfs -name '*.[ch]' -print |sort find lib/libzpool -name '*.[ch]' -print |sort find lib/libzfs -name '*.[ch]' -print |sort find cmd/zpool -name '*.[ch]' -print |sort find cmd/zfs -name '*.[ch]' -print |sort find cmd/zdb -name '*.[ch]' -print |sort find cmd/zhack -name '*.[ch]' -print |sort find cmd/zinject -name '*.[ch]' -print |sort find cmd/ztest -name '*.[ch]' -print |sort find common/zfs -name '*.[ch]' -print |sort echo cmd/mdb/common/modules/zfs/zfs.c ) > $SRC/cscope.files (cd $SRC ; exctags -e --langmap=c:+.ndl -h ndl -L - < cscope.files cscope -b ) } ################################################################ # This creates a tarfile one can use to update a test machine. do_tar() { git_rev=`git rev-parse --short=8 HEAD` files=" kernel/drv/$arch64/zfs kernel/fs/$arch64/zfs kernel/kmdb/$arch64/zfs lib/$arch64/libzfs.so.1 lib/$arch64/libzfs_core.so.1 lib/libzfs.so.1 lib/libzfs_core.so.1 usr/bin/$arch32/ztest usr/bin/$arch64/ztest usr/lib/$arch64/libzfs_jni.so.1 usr/lib/$arch64/libzpool.so.1 usr/lib/devfsadm/linkmod/SUNW_zfs_link.so usr/lib/fs/zfs/bootinstall usr/lib/fs/zfs/fstyp.so.1 usr/lib/libzfs_jni.so.1 usr/lib/libzpool.so.1 usr/lib/mdb/kvm/$arch64/zfs.so usr/lib/mdb/proc/$arch64/libzpool.so usr/lib/mdb/proc/libzpool.so sbin/zfs sbin/zpool usr/lib/sysevent/modules/zfs_mod.so usr/lib/zfs/availdevs usr/sbin/$arch32/zdb usr/sbin/$arch64/zdb usr/sbin/$arch32/zhack usr/sbin/$arch64/zhack usr/sbin/$arch32/zinject usr/sbin/$arch64/zinject usr/sbin/zstreamdump usr/share/man/man8/zdb.8 usr/share/man/man8/zfs.8 usr/share/man/man8/zfs-program.8 usr/share/man/man8/zpool.8 usr/share/man/man8/ztest.8 usr/share/man/man7/zpool-features.7 " (cd $ROOT && tar cfj ../../zfs-${git_rev}.tar.bz2 $files) } ################################################################ if [ "$1" = "" ]; then set '?' # force usage fi set -x for arg do case "$arg" in install) build_tools set -e do_hdrs $arg do_kern $arg do_libs $arg do_cmds $arg do_mans $arg ;; lint) do_kern $arg do_libs $arg do_cmds $arg do_mans $arg ;; clean) do_mans $arg do_cmds $arg do_libs $arg do_kern $arg ;; clobber) do_mans $arg do_cmds $arg do_libs $arg do_kern $arg do_hdrs $arg clobber_tools ;; deplibs) build_tools set -e do_hdrs install do_deplibs install ;; tags) do_tags ;; tar) do_tar ;; *) echo "Usage: $0 {install|lint|clean|clobber|deplibs|tags|tar}"; exit 1; ;; esac done