imagebuilder: merge r25078 to align files/ handling with current buildroot
[openwrt.git] / target / imagebuilder / files / Makefile
index b0d0698..4d0f1fe 100644 (file)
@@ -134,6 +134,14 @@ package_install: FORCE
 copy_files: FORCE
        @echo
        @echo Copying extra files
+       @( cd $(USER_FILES); find -type f ) | \
+               ( cd $(TARGET_DIR); while :; do \
+                       read FILE; \
+                       [ -z "$$FILE" ] && break; \
+                       [ -L "$$FILE" ] || continue; \
+                       echo "Removing symlink $(TARGET_DIR)/$$FILE"; \
+                       rm -f "$$FILE"; \
+               done; )
        $(CP) $(USER_FILES)/* $(TARGET_DIR)/
 
 package_postinst: FORCE