Extended package list cascading
This commit is contained in:
parent
441d991156
commit
a8acbf7c4f
8
Makefile
8
Makefile
@ -97,12 +97,10 @@ gluon_prepared_stamp := $(GLUON_BUILDDIR)/$(BOARD)/prepared
|
|||||||
|
|
||||||
define GluonProfile
|
define GluonProfile
|
||||||
image/$(1): $(gluon_prepared_stamp)
|
image/$(1): $(gluon_prepared_stamp)
|
||||||
$(MAKE) -C $(GLUON_BUILDERDIR) image \
|
$(MAKE) -C $(GLUON_BUILDERDIR) image PROFILE="$(1)"
|
||||||
PROFILE="$(1)" \
|
|
||||||
$(if $(2),PACKAGES="$(2)")
|
|
||||||
|
|
||||||
PROFILES += $(1)
|
PROFILES += $(1)
|
||||||
PROFILE_PACKAGES += $(filter-out -%,$(2))
|
PROFILE_PACKAGES += $(filter-out -%,$(2)) $(GLUON_$(1)_SITE_PACKAGES)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
include $(GLUONDIR)/profiles.mk
|
include $(GLUONDIR)/profiles.mk
|
||||||
@ -126,7 +124,7 @@ feeds: FORCE
|
|||||||
$(SUBMAKE) prepare-tmpinfo OPENWRT_BUILD=0
|
$(SUBMAKE) prepare-tmpinfo OPENWRT_BUILD=0
|
||||||
|
|
||||||
config: FORCE
|
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
|
$(SUBMAKE) defconfig OPENWRT_BUILD=0
|
||||||
|
|
||||||
toolchain: $(toolchain/stamp-install) $(tools/stamp-install)
|
toolchain: $(toolchain/stamp-install) $(tools/stamp-install)
|
||||||
|
@ -62,18 +62,19 @@ endef
|
|||||||
|
|
||||||
include $(INCLUDE_DIR)/target.mk
|
include $(INCLUDE_DIR)/target.mk
|
||||||
|
|
||||||
BUILD_PACKAGES:=$(sort $(DEFAULT_PACKAGES) $(USER_PACKAGES) $($(PROFILE)_PACKAGES) kernel)
|
define GluonProfile
|
||||||
# "-pkgname" in the package list means remove "pkgname" from the package list
|
GLUON_$(1)_DEFAULT_PACKAGES := $(2)
|
||||||
BUILD_PACKAGES:=$(filter-out $(filter -%,$(BUILD_PACKAGES)) $(patsubst -%,%,$(filter -%,$(BUILD_PACKAGES))),$(BUILD_PACKAGES))
|
endef
|
||||||
PACKAGES:=
|
|
||||||
|
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
|
image/%:: FORCE
|
||||||
$(MAKE) assemble_image PROFILE="$(patsubst image/%,%,$@)"
|
$(MAKE) assemble_image PROFILE="$(patsubst image/%,%,$@)"
|
||||||
|
|
||||||
assemble_image: FORCE
|
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)
|
rm -rf $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR)
|
||||||
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(TARGET_DIR)/tmp
|
mkdir -p $(TARGET_DIR) $(BIN_DIR) $(TMP_DIR) $(TARGET_DIR)/tmp
|
||||||
$(OPKG) update
|
$(OPKG) update
|
||||||
@ -92,7 +93,8 @@ endef
|
|||||||
package_install: FORCE
|
package_install: FORCE
|
||||||
$(OPKG) install $(PACKAGE_DIR)/libc_*.ipk
|
$(OPKG) install $(PACKAGE_DIR)/libc_*.ipk
|
||||||
$(OPKG) install $(PACKAGE_DIR)/kernel_*.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
|
rm -f $(TARGET_DIR)/usr/lib/opkg/lists/* $(TARGET_DIR)/tmp/opkg.lock
|
||||||
|
|
||||||
copy_files: FORCE
|
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)"
|
PROFILE="$(PROFILE)" KDIR="$(PROFILE_KDIR)" TARGET_DIR="$(TARGET_DIR)" BIN_DIR="$(BIN_DIR)" TMP_DIR="$(TMP_DIR)"
|
||||||
|
|
||||||
image: FORCE
|
image: FORCE
|
||||||
$(MAKE) image/$(PROFILE) OPENWRT_VERBOSE="$(OPENWRT_VERBOSE)" $(if $(PACKAGES),USER_PACKAGES="$(PACKAGES)")
|
$(MAKE) image/$(PROFILE) OPENWRT_VERBOSE="$(OPENWRT_VERBOSE)"
|
||||||
|
|
||||||
.SILENT: prepare image
|
.SILENT: prepare image
|
||||||
|
|
||||||
|
@ -17,10 +17,14 @@ $(GLUON_SITEDIR)/site.mk:
|
|||||||
|
|
||||||
-include $(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_DEFAULT_PACKAGES := gluon-core kmod-ipv6 firewall ip6tables
|
||||||
|
|
||||||
GLUON_PACKAGES := $(GLUON_DEFAULT_PACKAGES) $(GLUON_SITE_PACKAGES)
|
override DEFAULT_PACKAGES.router :=
|
||||||
DEFAULT_PACKAGES.gluon := $(GLUON_PACKAGES)
|
|
||||||
DEVICE_TYPE := gluon
|
|
||||||
|
|
||||||
endif #__gluon_inc
|
endif #__gluon_inc
|
||||||
|
Loading…
Reference in New Issue
Block a user