diff mbox series

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

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

Commit Message

John Crispin June 4, 2019, 5:55 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        | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Jo-Philipp Wich June 4, 2019, 7:04 a.m. UTC | #1
Hi,

comments inline.

~ Jo

On 6/4/19 7:55 AM, John Crispin wrote:
> 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        | 2 +-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> 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..054e5b5820 100644
> --- a/package/Makefile
> +++ b/package/Makefile
> @@ -76,7 +76,7 @@ $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
>  
>  	$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
>  
> -	$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
> +	$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/$(if ifeq "$(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER)" "",files,$(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER)))

I don't think that $(if ifeq ...) is a valid Make construct, to me it looks
as if it'll simply always evaluate to $(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER).
Also don't we need to filter this through the "qstrip" macro? The .config
symbol will contain leading and trailing quotes for string value options.

>  
>  $(curdir)/index: FORCE
>  	@echo Generating package index...
>
diff mbox series

Patch

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..054e5b5820 100644
--- a/package/Makefile
+++ b/package/Makefile
@@ -76,7 +76,7 @@  $(curdir)/install: $(TMP_DIR)/.build $(curdir)/merge $(if $(CONFIG_TARGET_PER_DE
 
 	$(CP) $(TARGET_DIR) $(TARGET_DIR_ORIG)
 
-	$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/files)
+	$(call prepare_rootfs,$(TARGET_DIR),$(TOPDIR)/$(if ifeq "$(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER)" "",files,$(CONFIG_TARGET_ROOTFS_INCLUDE_FOLDER)))
 
 $(curdir)/index: FORCE
 	@echo Generating package index...