[OpenWrt-Devel,V2,1/2] image: make the folder that gets included intot he RootFS configurable
diff mbox series

Message ID 20190605063239.27540-1-john@phrozen.org
State New
Delegated to: John Crispin
Headers show
Series
  • [OpenWrt-Devel,V2,1/2] image: make the folder that gets included intot he RootFS configurable
Related show

Commit Message

John Crispin June 5, 2019, 6:32 a.m. UTC
This allows managing several different folder for varying env profiles.

Signed-off-by: John Crispin <john@phrozen.org>
---
 config/Config-images.in | 6 ++++++
 package/Makefile        | 7 +++++--
 2 files changed, 11 insertions(+), 2 deletions(-)

Comments

Karl Palsson June 5, 2019, 10:20 a.m. UTC | #1
John Crispin <john@phrozen.org> wrote:
> This allows managing several different folder for varying env
> profiles.

This is neat, very cool! Thanks for this, I hadn't even thought
it could be done so simply.

Cheers,
Karl Palsson

Patch
diff mbox series

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...