[openwrt/openwrt] target.mk: improve handling of default enabled SECCOMP

LEDE Commits lede-commits at lists.infradead.org
Wed Jun 19 07:23:21 PDT 2024


ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/847fad476f3d3652e75daa98822662f654bfd225

commit 847fad476f3d3652e75daa98822662f654bfd225
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Wed Jun 19 16:19:10 2024 +0200

    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 at gmail.com>
---
 include/target.mk | 16 +++++++++++++---
 1 file 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




More information about the lede-commits mailing list