From 9e1122e3b4a9eeeb270429e896f363dea9264906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robin=20Bj=C3=B6rklin?= Date: Sun, 24 Oct 2021 15:13:47 -0700 Subject: [PATCH] chore: handle selinux when needed --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 657074e..9e5e4fe 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ BINARY = throttle_fstrim PROFILE ?= dev DOCKER = $(shell bash -c 'basename $$(which podman 2> /dev/null) 2> /dev/null || echo docker') +SELINUX = $(shell bash -c '( [ "$$(getenforce)" = "Enforcing" ] && echo -n ":z") || echo -n ""') .PHONY: deps build image @@ -17,4 +18,4 @@ clean: rm -rf _build docker-%: image - $(DOCKER) run --rm -ti --volume $(PWD):/build --workdir /build throttle-fstrim-build make $* PROFILE=$(PROFILE) + $(DOCKER) run --rm -ti --volume $(PWD):/build$(SELINUX) --workdir /build throttle-fstrim-build make $* PROFILE=$(PROFILE)