1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-16 19:28:26 +02:00

buildroot: isolate the .install stamp files for build variants (#12279)

This fixes missing embedded packages if multiple build variants are selected in
the build config, e.g. missing ppp if CONFIG_PACKAGE_ppp=y and
CONFIG_PACKAGE_ppp-multilink=m .

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34106 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
jow 2012-11-07 16:15:22 +00:00
parent d336a61384
commit 366bfe9f21
3 changed files with 18 additions and 17 deletions

View File

@ -75,22 +75,22 @@ ifeq ($(DUMP),)
IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1) IDIR_$(1):=$(PKG_BUILD_DIR)/ipkg-$(PKGARCH)/$(1)
KEEP_$(1):=$(strip $(call Package/$(1)/conffiles)) KEEP_$(1):=$(strip $(call Package/$(1)/conffiles))
ifeq ($(if $(VARIANT),$(BUILD_VARIANT)),$(VARIANT)) ifeq ($(BUILD_VARIANT),$$(if $$(VARIANT),$$(VARIANT),$(BUILD_VARIANT)))
ifdef Package/$(1)/install ifdef Package/$(1)/install
ifneq ($(CONFIG_PACKAGE_$(1))$(SDK)$(DEVELOPER),) ifneq ($(CONFIG_PACKAGE_$(1))$(SDK)$(DEVELOPER),)
IPKGS += $(1) IPKGS += $(1)
compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed compile: $$(IPKG_$(1)) $(PKG_INFO_DIR)/$(1).provides $(STAGING_DIR_ROOT)/stamp/.$(1)_installed
ifeq ($(CONFIG_PACKAGE_$(1)),y) ifeq ($(CONFIG_PACKAGE_$(1)),y)
.PHONY: $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.$(1) .PHONY: $(PKG_INSTALL_STAMP).$(1)
compile: $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.$(1) compile: $(PKG_INSTALL_STAMP).$(1)
$(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.$(1): $(PKG_INSTALL_STAMP).$(1):
@if [ -f $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean ]; then \ if [ -f $(PKG_INSTALL_STAMP).clean ]; then \
rm -f \ rm -f \
$(PKG_INFO_DIR)/$(PKG_DIR_NAME).install \ $(PKG_INSTALL_STAMP) \
$(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean; \ $(PKG_INSTALL_STAMP).clean; \
fi; \ fi; \
echo "$(1)" >> $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install echo "$(1)" >> $(PKG_INSTALL_STAMP)
endif endif
else else
compile: $(1)-disabled compile: $(1)-disabled

View File

@ -52,6 +52,7 @@ ifneq ($(if $(CONFIG_SRC_TREE_OVERRIDE),$(wildcard ./git-src)),)
endif endif
PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR))) PKG_DIR_NAME:=$(lastword $(subst /,$(space),$(CURDIR)))
PKG_INSTALL_STAMP:=$(PKG_INFO_DIR)/$(PKG_DIR_NAME).$(if $(BUILD_VARIANT),$(BUILD_VARIANT),default).install
include $(INCLUDE_DIR)/download.mk include $(INCLUDE_DIR)/download.mk
include $(INCLUDE_DIR)/quilt.mk include $(INCLUDE_DIR)/quilt.mk
@ -254,8 +255,8 @@ Build/DistCheck=$(call Build/DistCheck/Default,)
.PHONY: prepare-package-install .PHONY: prepare-package-install
prepare-package-install: prepare-package-install:
@mkdir -p $(PKG_INFO_DIR) @mkdir -p $(PKG_INFO_DIR)
@touch $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.clean @touch $(PKG_INSTALL_STAMP).clean
@echo "$(filter-out essential,$(PKG_FLAGS))" > $(PKG_INFO_DIR)/$(PKG_DIR_NAME).install.flags @echo "$(filter-out essential,$(PKG_FLAGS))" > $(PKG_INSTALL_STAMP).flags
$(PACKAGE_DIR): $(PACKAGE_DIR):
mkdir -p $@ mkdir -p $@

View File

@ -60,7 +60,7 @@ OPKG:= \
IPKG_INSTROOT=$(TARGET_DIR) \ IPKG_INSTROOT=$(TARGET_DIR) \
IPKG_CONF_DIR=$(STAGING_DIR)/etc \ IPKG_CONF_DIR=$(STAGING_DIR)/etc \
IPKG_OFFLINE_ROOT=$(TARGET_DIR) \ IPKG_OFFLINE_ROOT=$(TARGET_DIR) \
$(STAGING_DIR_HOST)/bin/opkg \ $(XARGS) $(STAGING_DIR_HOST)/bin/opkg \
--offline-root $(TARGET_DIR) \ --offline-root $(TARGET_DIR) \
--force-depends \ --force-depends \
--force-overwrite \ --force-overwrite \
@ -71,7 +71,7 @@ OPKG:= \
--add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200 --add-arch $(if $(ARCH_PACKAGES),$(ARCH_PACKAGES),$(BOARD)):200
PACKAGE_INSTALL:=$(sort $(foreach pkg,$(package-y),$(lastword $(subst /,$(space),$(pkg))))) PACKAGE_INSTALL:=$(sort $(foreach pkg,$(package-y),$(lastword $(subst /,$(space),$(pkg)))))
PACKAGE_INSTALL_FILES:=$(patsubst %,$(PKG_INFO_DIR)/%.install,$(PACKAGE_INSTALL)) PACKAGE_INSTALL_FILES:=$(patsubst %,$(PKG_INFO_DIR)/%.*.install,$(PACKAGE_INSTALL))
$(curdir)/cleanup: $(TMP_DIR)/.build $(curdir)/cleanup: $(TMP_DIR)/.build
rm -rf $(STAGING_DIR_ROOT) rm -rf $(STAGING_DIR_ROOT)
@ -80,11 +80,11 @@ $(curdir)/install: $(TMP_DIR)/.build
- find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755 - find $(STAGING_DIR_ROOT) -type d | $(XARGS) chmod 0755
rm -rf $(TARGET_DIR) rm -rf $(TARGET_DIR)
[ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp [ -d $(TARGET_DIR)/tmp ] || mkdir -p $(TARGET_DIR)/tmp
$(OPKG) install `cat $(PACKAGE_INSTALL_FILES) | sed -e 's,^\(.*\)$$,$(PACKAGE_DIR)/\1_*.ipk,'` @$(FIND) `sed -e 's|.*|$(PACKAGE_DIR)/&_*.ipk|' $(PACKAGE_INSTALL_FILES)` | sort -u | $(OPKG) install
@for pkg in $(PACKAGE_INSTALL); do \ @for file in $(PACKAGE_INSTALL_FILES); do \
[ -s $(PKG_INFO_DIR)/$${pkg}.install.flags ] || continue; \ [ -s $$file.flags ] || continue; \
for flag in `cat $(PKG_INFO_DIR)/$${pkg}.install.flags`; do \ for flag in `cat $$file.flags`; do \
$(OPKG) flag $$flag `cat $(PKG_INFO_DIR)/$${pkg}.install`; \ $(OPKG) flag $$flag < $$file; \
done; \ done; \
done || true done || true
@-$(MAKE) package/preconfig @-$(MAKE) package/preconfig