myos/make/apps/myos/setup.mk

51 lines
1.5 KiB
Makefile
Raw Normal View History

2021-07-11 09:56:03 +02:00
##
# SETUP
2022-11-16 17:34:30 +01:00
# target setup-binfmt: Install binfmt abstraction layer
.PHONY: setup-binfmt
setup-binfmt:
ifeq ($(SETUP_BINFMT),true)
$(call docker-run,--install $(SETUP_BINFMT_ARCH),--privileged tonistiigi/binfmt)
endif
2021-07-11 09:56:03 +02:00
# target setup-docker-group: Call ansible to add user in docker group if needed
.PHONY: setup-docker-group
setup-docker-group:
ifneq ($(DOCKER),)
ifeq ($(or $(filter $(USER),$(subst $(comma), ,$(shell awk -F':' '$$1 == "docker" {print $$4}' /etc/group))),$(filter 0,$(UID))),)
$(call ansible-user-add-groups,$(USER),docker)
$(call WARNING,user,$(USER),added in group,docker)
endif
2022-07-06 23:27:41 +02:00
ifeq ($(filter 0 $(DOCKER_GID),$(GIDS)),)
2021-07-11 09:56:03 +02:00
$(call ERROR,YOU MUST LOGOUT NOW AND LOGIN BACK TO GET DOCKER GROUP MEMBERSHIP)
endif
endif
2022-10-12 02:50:02 +02:00
# target setup-nfsd: Call setup-nfsd-osx if SETUP_NFSD=true and SYSTEM=Darwin
2021-07-11 09:56:03 +02:00
.PHONY: setup-nfsd
setup-nfsd:
ifeq ($(SETUP_NFSD),true)
2022-10-12 02:50:02 +02:00
ifeq ($(SYSTEM),Darwin)
2021-07-11 09:56:03 +02:00
$(call setup-nfsd-osx)
endif
endif
# target setup-sysctl: Add sysctl config for each SETUP_SYSCTL_CONFIG
.PHONY: setup-sysctl
setup-sysctl:
ifeq ($(SETUP_SYSCTL),true)
2022-05-09 02:32:23 +02:00
$(RUN) $(SUDO) sysctl -q -w $(SETUP_SYSCTL_CONFIG)
2021-07-11 09:56:03 +02:00
endif
2022-11-16 17:34:30 +01:00
# target setup-ufw: Install ufw-docker
.PHONY: setup-ufw
setup-ufw:
ifeq ($(SETUP_UFW),true)
$(call app-install,$(SETUP_UFW_REPOSITORY))
$(call app-bootstrap,$(lastword $(subst /, ,$(SETUP_UFW_REPOSITORY))))
$(call app-build)
$(eval DOCKER_RUN_OPTIONS := --rm --cap-add NET_ADMIN -v /etc/ufw:/etc/ufw --network host)
$(call app-up)
$(call ufw-docker,install)
endif