[openwrt/openwrt] include/rootfs.mk: pass additional files dir to prepare_rootfs as an argument

LEDE Commits lede-commits at lists.infradead.org
Wed Mar 7 01:00:11 PST 2018


neoraider pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/cf1c7c0f17a45bba3e7ce1a3cd3f8f7efa7196c4

commit cf1c7c0f17a45bba3e7ce1a3cd3f8f7efa7196c4
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Tue Mar 6 21:06:30 2018 +0100

    include/rootfs.mk: pass additional files dir to prepare_rootfs as an argument
    
    Signed-off-by: Matthias Schiffer <mschiffer at universe-factory.net>
---
 include/image.mk  | 2 +-
 include/rootfs.mk | 6 +++---
 package/Makefile  | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/include/image.mk b/include/image.mk
index 723e4f1..1cd8b75 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -305,7 +305,7 @@ target-dir-%: FORCE
 			$(call opkg_package_files,$(mkfs_packages_add)))
 	-$(CP) -T $(mkfs_cur_target_dir).opkg/ $(mkfs_cur_target_dir)/etc/opkg/
 	rm -rf $(mkfs_cur_target_dir).opkg $(mkfs_cur_target_dir).conf
-	$(call prepare_rootfs,$(mkfs_cur_target_dir))
+	$(call prepare_rootfs,$(mkfs_cur_target_dir),$(TOPDIR)/files)
 
 $(KDIR)/root.%: kernel_prepare
 	$(call Image/mkfs/$(word 1,$(target_params)),$(target_params))
diff --git a/include/rootfs.mk b/include/rootfs.mk
index a3a08c2..bf26dd2 100644
--- a/include/rootfs.mk
+++ b/include/rootfs.mk
@@ -63,9 +63,9 @@ ifdef CONFIG_CLEAN_IPKG
 endif
 
 define prepare_rootfs
-	@if [ -d $(TOPDIR)/files ]; then \
-		$(call file_copy,$(TOPDIR)/files/.,$(1)); \
-	fi
+	$(if $(2), at if [ -d '$(2)' ]; then \
+		$(call file_copy,$(2)/.,$(1)); \
+	fi)
 	@mkdir -p $(1)/etc/rc.d
 	@mkdir -p $(1)/var/lock
 	@( \
diff --git a/package/Makefile b/package/Makefile
index 0aefbb8..a83b350 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -75,7 +75,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
 
 	$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
 
-	$(call prepare_rootfs,$(TARGET_DIR))
+	$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
 
 $(curdir)/index: FORCE
 	@echo Generating package index...



More information about the lede-commits mailing list