From dcb884549ad8dffcbea36175f6f4b912177993bd Mon Sep 17 00:00:00 2001 From: Leandro Santiago Date: Tue, 11 Feb 2025 15:59:47 +0100 Subject: [PATCH] Allow building when SELinux is not used Add `USE_SELINUX` variable to `make all` --- CONTRIBUTING.md | 6 ++++++ mk/podman.mk | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a891987..9b0e48f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -118,6 +118,12 @@ To start the compilation of the default recipes run the command below: make all ``` +In case your operating system does not use SELinux, you must set the `USE_SELINUX` to `0` when calling `make all`, otherwise you might experience errors: + +```sh +make all USE_SELINUX=0 +``` + You can find the build system organization and commands on the [Build System](https://doc.redox-os.org/book/build-system-reference.html) page. ## Developer FAQ diff --git a/mk/podman.mk b/mk/podman.mk index 3bea7df..abd2b1e 100644 --- a/mk/podman.mk +++ b/mk/podman.mk @@ -5,10 +5,19 @@ IMAGE_TAG?=redox-base ## Working Directory in Podman CONTAINER_WORKDIR?=/mnt/redox + +## Flag passed to the Podman volumes. :Z can be used only with SELinux +USE_SELINUX=1 +ifeq ($(USE_SELINUX),1) +PODMAN_VOLUME_FLAG=:Z +else +PODMAN_VOLUME_FLAG= +endif + ## Podman Home Directory PODMAN_HOME?=$(ROOT)/build/podman ## Podman command with its many arguments -PODMAN_VOLUMES?=--volume $(ROOT):$(CONTAINER_WORKDIR):Z --volume $(PODMAN_HOME):/home:Z +PODMAN_VOLUMES?=--volume $(ROOT):$(CONTAINER_WORKDIR)$(PODMAN_VOLUME_FLAG) --volume $(PODMAN_HOME):/home$(PODMAN_VOLUME_FLAG) PODMAN_ENV?=--env PATH=/home/poduser/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin --env PODMAN_BUILD=0 PODMAN_CONFIG?=--env ARCH=$(ARCH) --env BOARD=$(BOARD) --env CONFIG_NAME=$(CONFIG_NAME) --env FILESYSTEM_CONFIG=$(FILESYSTEM_CONFIG) PODMAN_OPTIONS?=--rm --workdir $(CONTAINER_WORKDIR) --userns keep-id --user `id -u` --interactive --tty --env TERM=$(TERM)