tools: add fakeroot

SELinux support requires setting the appropriate SELinux security context
to files and directories, which needs to happen at build time in order
to support read-only root filesystem scenarios. In order to create these
security contexts, we will have to run some SELinux-specific tools on
the host machine, but that requires root access. This adds support for
fakeroot, which the build process will use to run the SELinux security
context creation and the image creation.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>

Apply to current master, and adjust commit message

Thomas' original work is available at
http://lists.infradead.org/pipermail/openwrt-devel/2019-November/025976.html.

Signed-off-by: W. Michael Petullo <mike@flyn.org>
[add rules.mk FAKEROOT variable]
Signed-off-by: Paul Spooren <mail@aparcar.org>
[update, fix macos build]
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Thomas Petazzoni
2020-08-07 11:12:59 -10:00
committed by Felix Fietkau
parent e27fbae63c
commit 9e7ef46065
4 changed files with 134 additions and 1 deletions
+1
View File
@@ -264,6 +264,7 @@ endif
BUILD_KEY=$(TOPDIR)/key-build
FAKEROOT:=$(STAGING_DIR_HOST)/bin/fakeroot
TARGET_CC:=$(TARGET_CROSS)gcc
TARGET_CXX:=$(TARGET_CROSS)g++
KPATCH:=$(SCRIPT_DIR)/patch-kernel.sh