ar71xx: Add support for wdr7500v3
[openwrt/openwrt.git] / target / imagebuilder / Makefile
index 1f97cb861331d6f3b1375579143e9e19f60b3f6d..7f48ed885f4e0d49abee9c62bb5af48a764b22b1 100644 (file)
@@ -9,6 +9,7 @@ include $(TOPDIR)/rules.mk
 include $(INCLUDE_DIR)/kernel.mk
 include $(INCLUDE_DIR)/host.mk
 include $(INCLUDE_DIR)/version.mk
+include $(INCLUDE_DIR)/feeds.mk
 
 override MAKEFLAGS=
 
@@ -33,8 +34,28 @@ $(BIN_DIR)/$(IB_NAME).tar.bz2: clean
                $(TMP_DIR)/.targetinfo \
                $(TMP_DIR)/.packageinfo \
                $(PKG_BUILD_DIR)/
+
+ifeq ($(CONFIG_IB_STANDALONE),)
+       echo '## Remote package repositories' >> $(PKG_BUILD_DIR)/repositories.conf
+       $(call FeedSourcesAppend,$(PKG_BUILD_DIR)/repositories.conf)
+endif
+
+       echo ''                                                        >> $(PKG_BUILD_DIR)/repositories.conf
+       echo '## This is the local package repository, do not remove!' >> $(PKG_BUILD_DIR)/repositories.conf
+       echo 'src imagebuilder file:packages'                          >> $(PKG_BUILD_DIR)/repositories.conf
+
        $(VERSION_SED) $(PKG_BUILD_DIR)/repositories.conf
+
+ifeq ($(CONFIG_IB_STANDALONE),)
+       (cd $(PACKAGE_DIR); $(FIND) -type f -name 'libc_*.ipk' -or -name 'kernel_*.ipk' -or -name 'kmod-*.ipk') | \
+               while read path; do \
+                       mkdir -p "$(PKG_BUILD_DIR)/packages/$${path%/*}"; \
+                       cp "$(PACKAGE_DIR)/$$path" "$(PKG_BUILD_DIR)/packages/$$path"; \
+               done
+else
        $(CP) $(PACKAGE_DIR) $(PKG_BUILD_DIR)/packages
+endif
+
        $(CP) $(TOPDIR)/target/linux $(PKG_BUILD_DIR)/target/
        if [ -d $(TOPDIR)/staging_dir/host/lib/grub ]; then \
                $(CP) $(TOPDIR)/staging_dir/host/lib/grub/ $(PKG_BUILD_DIR)/staging_dir/host/lib; \