summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/prereq-build.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/prereq-build.mk b/include/prereq-build.mk
index a6de9b270..e90c3157b 100644
--- a/include/prereq-build.mk
+++ b/include/prereq-build.mk
@@ -8,6 +8,13 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/prereq.mk
+define Require/non-root
+ [ "$$(shell whoami)" != "root" ]
+endef
+$(eval $(call Require,non-root, \
+ Building OpenWrt as root is not supported! \
+))
+
# Required for the toolchain
define Require/working-make
echo 'all: test' > $(TMP_DIR)/check.mk