This allows managing several different folder for varying env profiles.

Signed-off-by: John Crispin <[email protected]>
---
 config/Config-images.in | 6 ++++++
 package/Makefile        | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/config/Config-images.in b/config/Config-images.in
index 8548c7cd24..a618da1b6c 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -286,4 +286,10 @@ menu "Target Images"
                  it will be mounted by PARTUUID which makes the kernel find the
                  appropriate disk automatically.
 
+       config TARGET_ROOTFS_INCLUDE_FOLDER
+               string "RootFS include folder"
+               default "files"
+               help
+                 Override the folder that is included into the RootFS by 
default.
+
 endmenu
diff --git a/package/Makefile b/package/Makefile
index abbf5f91f2..9899d4b48a 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -32,6 +32,10 @@ ifneq ($(IGNORE_ERRORS),)
   $(curdir)/builddirs-ignore-host-compile := $(package-ignore-subdirs)
 endif
 
+ifeq ($(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER),"")
+CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER:=files
+endif
+
 PACKAGE_INSTALL_FILES:= \
        $(foreach pkg,$(sort $(package-y)), \
                $(foreach variant, \
@@ -75,8 +79,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if 
$(CONFIG_TARGET_PER_DE
        done || true
 
        $(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
-
-       $(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
+       $(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/$(call qstrip, 
$(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER)))
 
 $(curdir)/index: FORCE
        @echo Generating package index...
-- 
2.20.1


_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to