From: Christian Marangi Date: Wed, 19 Jun 2024 14:19:10 +0000 (+0200) Subject: target.mk: improve handling of default enabled SECCOMP X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=847fad476f3d;p=openwrt%2Fstaging%2Fxback.git 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 --- 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