Extended package list cascading

This commit is contained in:
Matthias Schiffer 2013-02-19 00:12:23 +01:00
parent 441d991156
commit a8acbf7c4f
3 changed files with 21 additions and 17 deletions

View File

@ -97,12 +97,10 @@ gluon_prepared_stamp := $(GLUON_BUILDDIR)/$(BOARD)/prepared
define GluonProfile
image/$(1): $(gluon_prepared_stamp)
$(MAKE) -C $(GLUON_BUILDERDIR) image \
PROFILE="$(1)" \
$(if $(2),PACKAGES="$(2)")
$(MAKE) -C $(GLUON_BUILDERDIR) image PROFILE="$(1)"
PROFILES += $(1)
PROFILE_PACKAGES += $(filter-out -%,$(2))
PROFILE_PACKAGES += $(filter-out -%,$(2)) $(GLUON_$(1)_SITE_PACKAGES)
endef
include $(GLUONDIR)/profiles.mk
@ -126,7 +124,7 @@ feeds: FORCE
$(SUBMAKE) prepare-tmpinfo OPENWRT_BUILD=0
config: FORCE
echo -e 'CONFIG_TARGET_$(BOARD)=y\nCONFIG_TARGET_ROOTFS_JFFS2=n\n$(subst ${space},\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(GLUON_PACKAGES) $(PROFILE_PACKAGES)))' > .config
echo -e 'CONFIG_TARGET_$(BOARD)=y\nCONFIG_TARGET_ROOTFS_JFFS2=n\n$(subst ${space},\n,$(patsubst %,CONFIG_PACKAGE_%=m,$(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES) $(PROFILE_PACKAGES)))' > .config
$(SUBMAKE) defconfig OPENWRT_BUILD=0
toolchain: $(toolchain/stamp-install) $(tools/stamp-install)

View File

@ -62,18 +62,19 @@ endef
include $(INCLUDE_DIR)/target.mk
BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $(USER_PACKAGES) $($(PROFILE)_PACKAGES) kernel)
# "-pkgname" in the package list means remove "pkgname" from the package list
BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
PACKAGES:=
define GluonProfile
GLUON_$(1)_DEFAULT_PACKAGES := $(2)
endef
include $(GLUONDIR)/profiles.mk
# Generate Gluon package list
$(eval $(call merge-lists,GLUON_PACKAGES,GLUON_DEFAULT_PACKAGES GLUON_SITE_PACKAGES GLUON_$(PROFILE)_DEFAULT_PACKAGES GLUON_$(PROFILE)_SITE_PACKAGES))
image/%:: FORCE
$(MAKE) assemble_image PROFILE="$(patsubst image/%,%,$@)"
assemble_image: FORCE
echo 'Building images for $(BOARD)$(if $($(PROFILE)_NAME), - $($(PROFILE)_NAME))'
echo 'Packages: $(BUILD_PACKAGES)'
echo
rm -rf $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR)
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(TARGET_DIR)/tmp
$(OPKG) update
@ -92,7 +93,8 @@ endef
package_install: FORCE
$(OPKG) install $(PACKAGE_DIR)/libc_*.ipk
$(OPKG) install $(PACKAGE_DIR)/kernel_*.ipk
$(OPKG) install $(BUILD_PACKAGES)
$(OPKG) install $(DEFAULT_PACKAGES) $($(PROFILE)_PACKAGES)
$(OPKG) install $(GLUON_PACKAGES)
rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock
copy_files: FORCE
@ -126,7 +128,7 @@ build_image: FORCE
PROFILE="$(PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)"
image: FORCE
$(MAKE) image/$(PROFILE) OPENWRT_VERBOSE="$(OPENWRT_VERBOSE)" $(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)")
$(MAKE) image/$(PROFILE) OPENWRT_VERBOSE="$(OPENWRT_VERBOSE)"
.SILENT: prepare image

View File

@ -17,10 +17,14 @@ $(GLUON_SITEDIR)/site.mk:
-include $(GLUON_SITEDIR)/site.mk
define merge-lists
$(1) :=
$(foreach var,$(2),$(1) := $$(sort $$(filter-out -% $$(patsubst -%,%,$$(filter -%,$$($(var)))),$$($(1)) $$($(var))))
)
endef
GLUON_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables
GLUON_PACKAGES := $(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES)
DEFAULT_PACKAGES.gluon := $(GLUON_PACKAGES)
DEVICE_TYPE := gluon
override DEFAULT_PACKAGES.router :=
endif #__gluon_inc