mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [RFC: PATCH] rootfs: Add possibility to add custom directories and files.
@ 2022-01-11  9:58 Christian Melki
  2022-01-11 14:16 ` Felix Mellmann
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Melki @ 2022-01-11  9:58 UTC (permalink / raw)
  To: ptxdist

Add two custom targets in the rootfs configuration.
Rationale behind this is that I often find myself maintaining
a copy of a package ruleset just to be able to copy a file or add
a directory.
These changes are often things that are project specific and
are useless upstream.
Now this type of project specific maintenance can go away.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/rootfs.in   | 20 ++++++++++++++++++++
 rules/rootfs.make |  5 +++++
 2 files changed, 25 insertions(+)

diff --git a/rules/rootfs.in b/rules/rootfs.in
index 34e9bdcff..3183abc6b 100644
--- a/rules/rootfs.in
+++ b/rules/rootfs.in
@@ -257,6 +257,15 @@ config ROOTFS_VAR_TMP
 	  available at run-time.
 
 endmenu
+
+config ROOTFS_CUSTOM_DIRS
+	string "custom directories"
+	default ""
+	help
+	  Create custom directories in the root filesystem.
+	  Directories will be created with a standard 0755 permission.
+	  Multiple directories can be specified, separated by spaces.
+
 endif # ROOTFS
 
 # ----------------------------------------------------------------------------
@@ -488,4 +497,15 @@ choice
 		  If enabled, no /init will be install.
 endchoice
 
+config ROOTFS_CUSTOM_FILES
+	string "custom files"
+	default ""
+	help
+	  Copy custom files from projectroot to the root filesystem.
+	  Files will be created with a standard 0644 permission.
+	  Multiple files can be specified, separated by spaces.
+	  Use this if you want to add various scripts, data files,
+	  etc but to not wish to maintain a copy of a package file
+	  solely for that purpose.
+
 endmenu
diff --git a/rules/rootfs.make b/rules/rootfs.make
index 1c1e5501c..55fb06486 100644
--- a/rules/rootfs.make
+++ b/rules/rootfs.make
@@ -145,6 +145,8 @@ ifdef PTXCONF_ROOTFS_VAR_OVERLAYFS
 	@$(call install_link, rootfs, ../var.mount, \
 		/usr/lib/systemd/system/local-fs.target.requires/var.mount)
 endif
+	@$(foreach customdir, $(call remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_DIRS)), \
+		$(call install_copy, rootfs, 0, 0, 0755, $(customdir))$(ptx/nl))
 
 #	#
 #	# install files in rootfs
@@ -277,6 +279,9 @@ ifdef PTXCONF_ROOTFS_INIT_BIN
 	@$(call install_alternative, rootfs, 0, 0, 0755, /init)
 endif
 
+	@$(foreach customfiles, $(call remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_FILES)), \
+		$(call install_alternative, rootfs, 0, 0, 0644, $(customfiles))$(ptx/nl))
+
 	@$(call install_finish, rootfs)
 
 	@$(call touch)
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [RFC: PATCH] rootfs: Add possibility to add custom directories and files.
  2022-01-11  9:58 [ptxdist] [RFC: PATCH] rootfs: Add possibility to add custom directories and files Christian Melki
@ 2022-01-11 14:16 ` Felix Mellmann
  2022-01-12 11:46   ` Christian Melki
  0 siblings, 1 reply; 4+ messages in thread
From: Felix Mellmann @ 2022-01-11 14:16 UTC (permalink / raw)
  To: ptxdist

Thumbs up! I've never realized, that it would be so easy to get a 
universal solution for this common problem.

Maybe one could extend this idea by using references to external text 
files (i.e. configs/files.<platform> and configs/directories.<platform>) 
which contain the file names/globs and directory names. Actually editing 
those information within menuconfig isn't really neat nowadays.

Best regards,

Felix

On 11.01.22 10:58, Christian Melki wrote:
> Add two custom targets in the rootfs configuration.
> Rationale behind this is that I often find myself maintaining
> a copy of a package ruleset just to be able to copy a file or add
> a directory.
> These changes are often things that are project specific and
> are useless upstream.
> Now this type of project specific maintenance can go away.
>
> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>   rules/rootfs.in   | 20 ++++++++++++++++++++
>   rules/rootfs.make |  5 +++++
>   2 files changed, 25 insertions(+)
>
> diff --git a/rules/rootfs.in b/rules/rootfs.in
> index 34e9bdcff..3183abc6b 100644
> --- a/rules/rootfs.in
> +++ b/rules/rootfs.in
> @@ -257,6 +257,15 @@ config ROOTFS_VAR_TMP
>   	  available at run-time.
>   
>   endmenu
> +
> +config ROOTFS_CUSTOM_DIRS
> +	string "custom directories"
> +	default ""
> +	help
> +	  Create custom directories in the root filesystem.
> +	  Directories will be created with a standard 0755 permission.
> +	  Multiple directories can be specified, separated by spaces.
> +
>   endif # ROOTFS
>   
>   # ----------------------------------------------------------------------------
> @@ -488,4 +497,15 @@ choice
>   		  If enabled, no /init will be install.
>   endchoice
>   
> +config ROOTFS_CUSTOM_FILES
> +	string "custom files"
> +	default ""
> +	help
> +	  Copy custom files from projectroot to the root filesystem.
> +	  Files will be created with a standard 0644 permission.
> +	  Multiple files can be specified, separated by spaces.
> +	  Use this if you want to add various scripts, data files,
> +	  etc but to not wish to maintain a copy of a package file
> +	  solely for that purpose.
> +
>   endmenu
> diff --git a/rules/rootfs.make b/rules/rootfs.make
> index 1c1e5501c..55fb06486 100644
> --- a/rules/rootfs.make
> +++ b/rules/rootfs.make
> @@ -145,6 +145,8 @@ ifdef PTXCONF_ROOTFS_VAR_OVERLAYFS
>   	@$(call install_link, rootfs, ../var.mount, \
>   		/usr/lib/systemd/system/local-fs.target.requires/var.mount)
>   endif
> +	@$(foreach customdir, $(call remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_DIRS)), \
> +		$(call install_copy, rootfs, 0, 0, 0755, $(customdir))$(ptx/nl))
>   
>   #	#
>   #	# install files in rootfs
> @@ -277,6 +279,9 @@ ifdef PTXCONF_ROOTFS_INIT_BIN
>   	@$(call install_alternative, rootfs, 0, 0, 0755, /init)
>   endif
>   
> +	@$(foreach customfiles, $(call remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_FILES)), \
> +		$(call install_alternative, rootfs, 0, 0, 0644, $(customfiles))$(ptx/nl))
> +
>   	@$(call install_finish, rootfs)
>   
>   	@$(call touch)

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [RFC: PATCH] rootfs: Add possibility to add custom directories and files.
  2022-01-11 14:16 ` Felix Mellmann
@ 2022-01-12 11:46   ` Christian Melki
  2022-01-12 11:56     ` Felix Mellmann
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Melki @ 2022-01-12 11:46 UTC (permalink / raw)
  To: flix.ptxdist; +Cc: ptxdist

Hi.

Yeah. Strings are not pretty. It was merely a suggestion.
File input sounds better.

But not sure what you mean with configs? config? Without s?
Also not sure if that's pretty within the rulesfile.
But the project configuration dir would work if that's ok?

$(call ptx/in-platformconfigdir, somefile) ?

Regards,
Christian

On 1/11/22 3:16 PM, Felix Mellmann wrote:
> Thumbs up! I've never realized, that it would be so easy to get a 
> universal solution for this common problem.
> 
> Maybe one could extend this idea by using references to external text 
> files (i.e. configs/files.<platform> and configs/directories.<platform>) 
> which contain the file names/globs and directory names. Actually editing 
> those information within menuconfig isn't really neat nowadays.
> 
> Best regards,
> 
> Felix
> 
> On 11.01.22 10:58, Christian Melki wrote:
>> Add two custom targets in the rootfs configuration.
>> Rationale behind this is that I often find myself maintaining
>> a copy of a package ruleset just to be able to copy a file or add
>> a directory.
>> These changes are often things that are project specific and
>> are useless upstream.
>> Now this type of project specific maintenance can go away.
>>
>> Signed-off-by: Christian Melki <christian.melki@t2data.com>
>> ---
>>   rules/rootfs.in   | 20 ++++++++++++++++++++
>>   rules/rootfs.make |  5 +++++
>>   2 files changed, 25 insertions(+)
>>
>> diff --git a/rules/rootfs.in b/rules/rootfs.in
>> index 34e9bdcff..3183abc6b 100644
>> --- a/rules/rootfs.in
>> +++ b/rules/rootfs.in
>> @@ -257,6 +257,15 @@ config ROOTFS_VAR_TMP
>>         available at run-time.
>>   endmenu
>> +
>> +config ROOTFS_CUSTOM_DIRS
>> +    string "custom directories"
>> +    default ""
>> +    help
>> +      Create custom directories in the root filesystem.
>> +      Directories will be created with a standard 0755 permission.
>> +      Multiple directories can be specified, separated by spaces.
>> +
>>   endif # ROOTFS
>>   # 
>> ---------------------------------------------------------------------------- 
>>
>> @@ -488,4 +497,15 @@ choice
>>             If enabled, no /init will be install.
>>   endchoice
>> +config ROOTFS_CUSTOM_FILES
>> +    string "custom files"
>> +    default ""
>> +    help
>> +      Copy custom files from projectroot to the root filesystem.
>> +      Files will be created with a standard 0644 permission.
>> +      Multiple files can be specified, separated by spaces.
>> +      Use this if you want to add various scripts, data files,
>> +      etc but to not wish to maintain a copy of a package file
>> +      solely for that purpose.
>> +
>>   endmenu
>> diff --git a/rules/rootfs.make b/rules/rootfs.make
>> index 1c1e5501c..55fb06486 100644
>> --- a/rules/rootfs.make
>> +++ b/rules/rootfs.make
>> @@ -145,6 +145,8 @@ ifdef PTXCONF_ROOTFS_VAR_OVERLAYFS
>>       @$(call install_link, rootfs, ../var.mount, \
>>           /usr/lib/systemd/system/local-fs.target.requires/var.mount)
>>   endif
>> +    @$(foreach customdir, $(call 
>> remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_DIRS)), \
>> +        $(call install_copy, rootfs, 0, 0, 0755, $(customdir))$(ptx/nl))
>>   #    #
>>   #    # install files in rootfs
>> @@ -277,6 +279,9 @@ ifdef PTXCONF_ROOTFS_INIT_BIN
>>       @$(call install_alternative, rootfs, 0, 0, 0755, /init)
>>   endif
>> +    @$(foreach customfiles, $(call 
>> remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_FILES)), \
>> +        $(call install_alternative, rootfs, 0, 0, 0644, 
>> $(customfiles))$(ptx/nl))
>> +
>>       @$(call install_finish, rootfs)
>>       @$(call touch)
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to 
> ptxdist-request@pengutronix.de

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ptxdist] [RFC: PATCH] rootfs: Add possibility to add custom directories and files.
  2022-01-12 11:46   ` Christian Melki
@ 2022-01-12 11:56     ` Felix Mellmann
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Mellmann @ 2022-01-12 11:56 UTC (permalink / raw)
  To: ptxdist; +Cc: Christian Melki

Hi Christian,

you got me right. I was thinking of text files lying within the project 
configuration dir with optionally added platform identifier. Then the 
mechanism is roughly the same as for debian packages, i.e. 
debian/install.libfoo-dev , debian/dirs.libfoo1 and so on (if I remember 
right).

Actually I don't disagree with your patch and appreciate that, as it 
already helps in common cases with very low effort.

Best regards,

Felix

On 12.01.22 12:46, Christian Melki wrote:
> Hi.
>
> Yeah. Strings are not pretty. It was merely a suggestion.
> File input sounds better.
>
> But not sure what you mean with configs? config? Without s?
> Also not sure if that's pretty within the rulesfile.
> But the project configuration dir would work if that's ok?
>
> $(call ptx/in-platformconfigdir, somefile) ?
>
> Regards,
> Christian
>
> On 1/11/22 3:16 PM, Felix Mellmann wrote:
>> Thumbs up! I've never realized, that it would be so easy to get a 
>> universal solution for this common problem.
>>
>> Maybe one could extend this idea by using references to external text 
>> files (i.e. configs/files.<platform> and 
>> configs/directories.<platform>) which contain the file names/globs 
>> and directory names. Actually editing those information within 
>> menuconfig isn't really neat nowadays.
>>
>> Best regards,
>>
>> Felix
>>
>> On 11.01.22 10:58, Christian Melki wrote:
>>> Add two custom targets in the rootfs configuration.
>>> Rationale behind this is that I often find myself maintaining
>>> a copy of a package ruleset just to be able to copy a file or add
>>> a directory.
>>> These changes are often things that are project specific and
>>> are useless upstream.
>>> Now this type of project specific maintenance can go away.
>>>
>>> Signed-off-by: Christian Melki <christian.melki@t2data.com>
>>> ---
>>>   rules/rootfs.in   | 20 ++++++++++++++++++++
>>>   rules/rootfs.make |  5 +++++
>>>   2 files changed, 25 insertions(+)
>>>
>>> diff --git a/rules/rootfs.in b/rules/rootfs.in
>>> index 34e9bdcff..3183abc6b 100644
>>> --- a/rules/rootfs.in
>>> +++ b/rules/rootfs.in
>>> @@ -257,6 +257,15 @@ config ROOTFS_VAR_TMP
>>>         available at run-time.
>>>   endmenu
>>> +
>>> +config ROOTFS_CUSTOM_DIRS
>>> +    string "custom directories"
>>> +    default ""
>>> +    help
>>> +      Create custom directories in the root filesystem.
>>> +      Directories will be created with a standard 0755 permission.
>>> +      Multiple directories can be specified, separated by spaces.
>>> +
>>>   endif # ROOTFS
>>>   # 
>>> ---------------------------------------------------------------------------- 
>>>
>>> @@ -488,4 +497,15 @@ choice
>>>             If enabled, no /init will be install.
>>>   endchoice
>>> +config ROOTFS_CUSTOM_FILES
>>> +    string "custom files"
>>> +    default ""
>>> +    help
>>> +      Copy custom files from projectroot to the root filesystem.
>>> +      Files will be created with a standard 0644 permission.
>>> +      Multiple files can be specified, separated by spaces.
>>> +      Use this if you want to add various scripts, data files,
>>> +      etc but to not wish to maintain a copy of a package file
>>> +      solely for that purpose.
>>> +
>>>   endmenu
>>> diff --git a/rules/rootfs.make b/rules/rootfs.make
>>> index 1c1e5501c..55fb06486 100644
>>> --- a/rules/rootfs.make
>>> +++ b/rules/rootfs.make
>>> @@ -145,6 +145,8 @@ ifdef PTXCONF_ROOTFS_VAR_OVERLAYFS
>>>       @$(call install_link, rootfs, ../var.mount, \
>>> /usr/lib/systemd/system/local-fs.target.requires/var.mount)
>>>   endif
>>> +    @$(foreach customdir, $(call 
>>> remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_DIRS)), \
>>> +        $(call install_copy, rootfs, 0, 0, 0755, 
>>> $(customdir))$(ptx/nl))
>>>   #    #
>>>   #    # install files in rootfs
>>> @@ -277,6 +279,9 @@ ifdef PTXCONF_ROOTFS_INIT_BIN
>>>       @$(call install_alternative, rootfs, 0, 0, 0755, /init)
>>>   endif
>>> +    @$(foreach customfiles, $(call 
>>> remove_quotes,$(PTXCONF_ROOTFS_CUSTOM_FILES)), \
>>> +        $(call install_alternative, rootfs, 0, 0, 0644, 
>>> $(customfiles))$(ptx/nl))
>>> +
>>>       @$(call install_finish, rootfs)
>>>       @$(call touch)
>>
>> _______________________________________________
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>> To unsubscribe, send a mail with subject "unsubscribe" to 
>> ptxdist-request@pengutronix.de

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-01-12 11:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-11  9:58 [ptxdist] [RFC: PATCH] rootfs: Add possibility to add custom directories and files Christian Melki
2022-01-11 14:16 ` Felix Mellmann
2022-01-12 11:46   ` Christian Melki
2022-01-12 11:56     ` Felix Mellmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox