myos/make/apps/myos/def.setup.mk

19 lines
1.1 KiB
Makefile
Raw Normal View History

2022-05-08 00:37:46 +02:00
ENV_VARS += SETUP_SYSCTL_CONFIG
2022-05-09 15:33:46 +02:00
SETUP_BINFMT ?= false
SETUP_BINFMT_ARCH ?= all
2021-07-11 09:56:03 +02:00
SETUP_NFSD ?= false
SETUP_NFSD_OSX_CONFIG ?= nfs.server.bonjour=0 nfs.server.mount.regular_files=1 nfs.server.mount.require_resv_port=0 nfs.server.nfsd_threads=16 nfs.server.async=1
SETUP_SYSCTL ?= false
2022-05-08 00:37:46 +02:00
SETUP_SYSCTL_CONFIG ?= vm.max_map_count=262144 vm.overcommit_memory=1 fs.file-max=8388608 net.core.rmem_max=2500000
2021-06-06 16:29:54 +02:00
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