mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Felix Mellmann <flix.ptxdist@benfm.de>
To: ptxdist@pengutronix.de
Cc: Christian Melki <christian.melki@t2data.com>
Subject: Re: [ptxdist] [RFC: PATCH] rootfs: Add possibility to add custom directories and files.
Date: Wed, 12 Jan 2022 12:56:03 +0100	[thread overview]
Message-ID: <5c0c2254-f614-8780-a62a-07f117245b59@benfm.de> (raw)
In-Reply-To: <52388d18-f324-414b-ed70-25b5f35f262e@t2data.com>

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

      reply	other threads:[~2022-01-12 11:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-11  9:58 Christian Melki
2022-01-11 14:16 ` Felix Mellmann
2022-01-12 11:46   ` Christian Melki
2022-01-12 11:56     ` Felix Mellmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5c0c2254-f614-8780-a62a-07f117245b59@benfm.de \
    --to=flix.ptxdist@benfm.de \
    --cc=christian.melki@t2data.com \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox