summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Marangi <ansuelsmth@gmail.com>2024-06-19 16:19:10 +0200
committerChristian Marangi <ansuelsmth@gmail.com>2024-06-19 16:19:10 +0200
commit847fad476f3d3652e75daa98822662f654bfd225 (patch)
tree63f01cc2e5f2bde6cfa430e6bbc90ee30170ab22
parent3b83d393ddcd09e9ceb6ce04559d8f4a697f817f (diff)
downloadopenwrt-847fad476f3d3652e75daa98822662f654bfd225.tar.gz
openwrt-847fad476f3d3652e75daa98822662f654bfd225.tar.bz2
openwrt-847fad476f3d3652e75daa98822662f654bfd225.zip
target.mk: improve handling of default enabled SECCOMP
Handling default packages selection is really problematic and error prone. In all the changes, the SECCOMP config is enabled by default if supported by the target. This is problematic for the scenario of the first .config creation where this option will be enabled by default but the package default are already being parsed. This cause the reparsing of the default package on the next command and the "outdated config" error. To better handle this special case, add additiona logic to match the dependency in the config and check if CONFIG_SECCOMP should be enabled by default in the scenario where a .config needs to be init and doesn't exist. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
-rw-r--r--include/target.mk16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/target.mk b/include/target.mk
index 4eccff3cd9..386abf2ef1 100644
--- a/include/target.mk
+++ b/include/target.mk
@@ -11,9 +11,19 @@ ifneq ($(DUMP),)
# default package configuration
# Keep DYNAMIC_DEF_PKG_CONF in sync with toplevel.mk to reflect the same configs
DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP
- $(foreach config, $(DYNAMIC_DEF_PKG_CONF), \
- $(eval $(config) := $(shell grep "$(config)=y" $(TOPDIR)/.config 2>/dev/null)) \
- )
+ ifneq ($(wildcard $(TOPDIR)/.config),)
+ $(foreach config, $(DYNAMIC_DEF_PKG_CONF), \
+ $(eval $(config) := $(shell grep "$(config)=y" $(TOPDIR)/.config 2>/dev/null)) \
+ )
+ # Init config that are enabled by default. Dependency are checked matching the one in
+ # the config.
+ else
+ ifeq ($(filter $(BOARD), uml),)
+ ifneq ($(filter $(ARCH), aarch64 arm armeb mips mipsel mips64 mips64el i386 powerpc x86_64),)
+ CONFIG_SECCOMP := y
+ endif
+ endif
+ endif
endif
# default device type