From e7d836f78d231fa6d2cfc3f75caf6a72028d3391 Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Sun, 30 Nov 2014 02:31:37 +0000 Subject: [PATCH] Make nfs server components conditional according to MK_NFS_SERVER --- etc/rc.d/Makefile | 9 ++++++--- include/Makefile | 6 +++++- share/mk/src.opts.mk | 1 + sys/conf/kern.opts.mk | 1 + sys/modules/Makefile | 7 +++++-- tools/build/mk/OptionalObsoleteFiles.inc | 18 ++++++++++++++++++ tools/build/options/WITHOUT_NFS_SERVER | 6 ++++++ usr.sbin/Makefile | 19 +++++++++++++------ 8 files changed, 55 insertions(+), 12 deletions(-) create mode 100644 tools/build/options/WITHOUT_NFS_SERVER diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index 987c5727c15d..ee8e02484367 100644 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -74,9 +74,6 @@ FILES= DAEMON \ netwait \ newsyslog \ nfsclient \ - nfscbd \ - nfsd \ - nfsuserd \ nisdomain \ ${_nscd} \ nsswitch \ @@ -235,6 +232,12 @@ _kpasswdd= kpasswdd _othermta= othermta .endif +.if ${MK_NFS_SERVER} != "no" +FILES+= nfscbd +FILES+= nfsd +FILES+= nfsuserd +.endif + .if ${MK_NTP} != "no" FILES+= ntpd FILES+= ntpdate diff --git a/include/Makefile b/include/Makefile index 0e9e9a5f79ed..a5e2a1c9395c 100644 --- a/include/Makefile +++ b/include/Makefile @@ -37,7 +37,7 @@ LHDRS= aio.h errno.h fcntl.h linker_set.h poll.h stdatomic.h stdint.h \ syslog.h ucontext.h LDIRS= cam geom net net80211 netinet netinet6 \ - netipsec netsmb nfs nfsclient nfsserver sys vm + netipsec netsmb nfs nfsclient sys vm LSUBDIRS= cam/ata cam/scsi \ dev/acpica dev/agp dev/an dev/bktr dev/ciss dev/filemon dev/firewire \ @@ -79,6 +79,10 @@ LDIRS+= netgraph LSUBDIRS+= netgraph/netflow .endif +.if ${MK_NFS_SERVER} != "no" +LDIRS+= nfsserver +.endif + .if ${MK_USB} != "no" LSUBDIRS+= dev/usb .endif diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 7889ee4e609e..3e110c188667 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -128,6 +128,7 @@ __DEFAULT_YES_OPTIONS = \ NETCAT \ NETGRAPH \ NETGRAPH_SUPPORT \ + NFS_SERVER \ NLS_CATALOGS \ NS_CACHING \ NTP \ diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index c2d10d8b0aa0..43a0d822084e 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -34,6 +34,7 @@ __DEFAULT_YES_OPTIONS = \ IPFILTER \ KERNEL_SYMBOLS \ NETGRAPH \ + NFS_SERVER \ PF \ SOURCELESS_HOST \ SOURCELESS_UCODE \ diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 34a66ff20eba..85ab32722357 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -251,10 +251,8 @@ SUBDIR= \ nfscl \ nfsclient \ nfscommon \ - nfsd \ nfslock \ nfslockd \ - nfsserver \ nfssvc \ nge \ nmdm \ @@ -441,6 +439,11 @@ _nandsim= nandsim _netgraph= netgraph .endif +.if ${MK_NFS_SERVER} != "no" || defined(ALL_MODULES) +SUBDIR+= nfsd +SUBDIR+= nfsserver +.endif + .if (${MK_PF} != "no" && (${MK_INET_SUPPORT} != "no" || \ ${MK_INET6_SUPPORT} != "no")) || defined(ALL_MODULES) _pf= pf diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index 3ed1d5b7529d..f2ea43a58449 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -4083,6 +4083,24 @@ OLD_FILES+=usr/share/man/man8/ndisgen.8.gz OLD_FILES+=usr/share/misc/windrv_stub.c .endif +.if ${MK_NFS_SERVER} == no +OLD_FILES+=etc/rc.d/nfscbd +OLD_FILES+=etc/rc.d/nfsd +OLD_FILES+=etc/rc.d/nfsuserd +OLD_FILES+=usr/sbin/nfscbd +OLD_FILES+=usr/sbin/nfsd +OLD_FILES+=usr/sbin/nfsdumpstate +OLD_FILES+=usr/sbin/nfsrevoke +OLD_FILES+=usr/sbin/nfsuserd +OLD_FILES+=usr/share/man/man4/nfsv4.4.gz +OLD_FILES+=usr/share/man/man5/stablerestart.5.gz +OLD_FILES+=usr/share/man/man8/nfscbd.8.gz +OLD_FILES+=usr/share/man/man8/nfsd.8.gz +OLD_FILES+=usr/share/man/man8/nfsdumpstate.8.gz +OLD_FILES+=usr/share/man/man8/nfsrevoke.8.gz +OLD_FILES+=usr/share/man/man8/nfsuserd.8.gz +.endif + .if ${MK_NETCAT} == no OLD_FILES+=usr/bin/nc OLD_FILES+=usr/share/man/man1/nc.1.gz diff --git a/tools/build/options/WITHOUT_NFS_SERVER b/tools/build/options/WITHOUT_NFS_SERVER new file mode 100644 index 000000000000..61b8159d96c9 --- /dev/null +++ b/tools/build/options/WITHOUT_NFS_SERVER @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr nfsd 8 , +.Xr nfsdumpstate 8 , +.Xr nfsuserd 8 , +and associated programs. diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index c412682f4dcc..c030a03bb94d 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -45,17 +45,11 @@ SUBDIR= adduser \ mtest \ ${_mtree} \ newsyslog \ - nfscbd \ - nfsd \ - nfsdumpstate \ - nfsrevoke \ - nfsuserd \ nmtree \ nologin \ ${_pc_sysinstall} \ pciconf \ periodic \ - powerd \ procctl \ pstat \ pw \ @@ -96,6 +90,11 @@ SUBDIR+= accton SUBDIR+= sa .endif +.if ${MK_ACPI} != "no" || ${MK_APM} != "no" +SUBDIR+= powerd +SUBDIR+= zzz +.endif + .if ${MK_AMD} != "no" SUBDIR+= amd .endif @@ -234,6 +233,14 @@ SUBDIR+= ngctl SUBDIR+= nghook .endif +.if ${MK_NFS_SERVER} != "no" +SUBDIR+= nfscbd +SUBDIR+= nfsd +SUBDIR+= nfsdumpstate +SUBDIR+= nfsrevoke +SUBDIR+= nfsuserd +.endif + .if ${MK_NIS} != "no" SUBDIR+= rpc.yppasswdd SUBDIR+= rpc.ypupdated