ifneq ($(DUMP),)
# Parse generic config that might be set before a .config is generated to modify the
# default package configuration
- GENERIC_CONFIG := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP
- $(foreach config, $(GENERIC_CONFIG), \
+ # 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)) \
)
endif
_ignore = $(foreach p,$(IGNORE_PACKAGES),--ignore $(p))
-prepare-tmpinfo: FORCE
+# Config that will invalidate the .targetinfo as they will affect
+# DEFAULT_PACKAGES.
+# Keep DYNAMIC_DEF_PKG_CONF in sync with target.mk to reflect the same configs
+DYNAMIC_DEF_PKG_CONF := CONFIG_USE_APK CONFIG_SELINUX CONFIG_SMALL_FLASH CONFIG_SECCOMP
+check-dynamic-def-pkg: FORCE
+ @+DEF_PKG_CONFS=""; \
+ if [ -f $(TOPDIR)/.config ]; then \
+ for config in $(DYNAMIC_DEF_PKG_CONF); do \
+ DEF_PKG_CONFS="$$DEF_PKG_CONFS "$$(grep "$$config"=y $(TOPDIR)/.config); \
+ done; \
+ fi; \
+ [ ! -f tmp/.packagedynamicdefault ] || OLD_DEF_PKG_CONFS=$$(cat tmp/.packagedynamicdefault); \
+ [ "$$DEF_PKG_CONFS" = "$$OLD_DEF_PKG_CONFS" ] || rm -rf tmp/info/.targetinfo*; \
+ echo "$$DEF_PKG_CONFS" > tmp/.packagedynamicdefault;
+
+prepare-tmpinfo: check-dynamic-def-pkg FORCE
@+$(MAKE) -r -s $(STAGING_DIR_HOST)/.prereq-build $(PREP_MK)
mkdir -p tmp/info feeds
[ -e $(TOPDIR)/feeds/base ] || ln -sf $(TOPDIR)/package $(TOPDIR)/feeds/base