imagebuilder: fix broken image generation with external targets
[openwrt/staging/chunkeey.git] / target / imagebuilder / Makefile
index 0580e41c5790d8989ec2daf38e89e046cd1c0862..3bbadc7204d1e8859cbf363ae3101b753b08422f 100644 (file)
@@ -46,12 +46,16 @@ ifeq ($(CONFIG_IB_STANDALONE),)
        $(VERSION_SED_SCRIPT) $(PKG_BUILD_DIR)/repositories.conf
 endif
 
-ifeq ($(CONFIG_BUILDBOT),)
        $(INSTALL_DIR) $(PKG_BUILD_DIR)/packages
+       # create an empty package index so `opkg` doesn't report an error
+       touch $(PKG_BUILD_DIR)/packages/Packages
+       $(INSTALL_DATA) ./files/README.md $(PKG_BUILD_DIR)/packages/
+
        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
 
+ifeq ($(CONFIG_BUILDBOT),)
   ifeq ($(CONFIG_IB_STANDALONE),)
        $(FIND) $(call FeedPackageDir,libc) -type f \
                \( -name 'libc_*.ipk' -or -name 'kernel_*.ipk' -or -name 'kmod-*.ipk' \) \
@@ -74,7 +78,7 @@ ifneq ($(CONFIG_SIGNATURE_CHECK),)
        $(CP) -L $(STAGING_DIR_ROOT)/usr/sbin/opkg-key $(PKG_BUILD_DIR)/scripts/
 endif
 
-       $(CP) $(TOPDIR)/target/linux $(PKG_BUILD_DIR)/target/
+       $(CP) -L $(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; \
        fi