Skip to content

Commit

Permalink
target.mk: improve handling of default enabled SECCOMP
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Ansuel committed Jun 19, 2024
1 parent 3b83d39 commit 847fad4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions include/target.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 847fad4

Please sign in to comment.