2021-05-31 03:45:39 +02:00
|
|
|
##
|
|
|
|
# SETUP
|
|
|
|
|
|
|
|
.PHONY: setup-sysctl
|
|
|
|
setup-sysctl:
|
|
|
|
ifeq ($(SETUP_SYSCTL),true)
|
2021-06-14 12:52:48 +02:00
|
|
|
$(foreach config,$(SETUP_SYSCTL_CONFIG),$(call docker-run,sysctl -q -w $(config),--privileged alpine) &&) true
|
2021-05-31 03:45:39 +02:00
|
|
|
endif
|
|
|
|
|
2021-06-06 16:29:54 +02:00
|
|
|
.PHONY: setup-nfsd
|
|
|
|
setup-nfsd:
|
|
|
|
ifeq ($(SETUP_NFSD),true)
|
|
|
|
ifeq ($(HOST_SYSTEM),DARWIN)
|
|
|
|
$(call setup-nfsd-osx)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2021-05-31 03:45:39 +02:00
|
|
|
define setup-nfsd-osx
|
2021-06-12 03:13:01 +02:00
|
|
|
$(call INFO,setup-nfsd-osx,$(1)$(comma) $(2)$(comma) $(3))
|
2021-05-31 03:45:39 +02:00
|
|
|
$(eval dir:=$(or $(1),$(MONOREPO_DIR)))
|
|
|
|
$(eval uid:=$(or $(2),$(UID)))
|
|
|
|
$(eval gid:=$(or $(3),$(GID)))
|
2021-06-14 12:52:48 +02:00
|
|
|
grep "$(dir)" /etc/exports >/dev/null 2>&1 || printf "$(dir) -alldirs -mapall=$(uid):$(gid) localhost\n" |sudo tee -a /etc/exports >/dev/null
|
|
|
|
$(foreach config,$(SETUP_NFSD_OSX_CONFIG),grep "$(config)" /etc/nfs.conf >/dev/null 2>&1 || printf "$(config)\n" |sudo tee -a /etc/nfs.conf >/dev/null &&) true
|
2021-05-31 03:45:39 +02:00
|
|
|
nfsd status >/dev/null || sudo nfsd enable
|
|
|
|
showmount -e localhost |grep "$(dir)" >/dev/null 2>&1 || sudo nfsd restart
|
|
|
|
endef
|