mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Michael Olbrich <m.olbrich@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: Re: [ptxdist] [PATCH] doc: add section about install_replace
Date: Thu, 5 Jan 2017 17:51:36 +0100	[thread overview]
Message-ID: <20170105165136.p2ac7ccgy2v6jlop@pengutronix.de> (raw)
In-Reply-To: <1482324103-3291-1-git-send-email-post@lespocky.de>

On Wed, Dec 21, 2016 at 01:41:43PM +0100, Alexander Dahl wrote:
> This describes the install_replace macro. Some text stolen from
> rules/post/install.make and the existing documentation of install_lib.

Thanks, applied with some minor clarification.

Michael

> Signed-off-by: Alexander Dahl <post@lespocky.de>
> ---
>  doc/ref_manual.rst | 37 +++++++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> diff --git a/doc/ref_manual.rst b/doc/ref_manual.rst
> index d10f477..0647065 100644
> --- a/doc/ref_manual.rst
> +++ b/doc/ref_manual.rst
> @@ -873,6 +873,43 @@ Note: The package's install stage must be 'DESTDIR' aware to be able to make
>  it install its content into the corresponding packages directory (in our example
>  ``<platform-dir>/packages/foo-1.0.0/`` here).
>  
> +install_replace
> +~~~~~~~~~~~~~~~
> +
> +Usage:
> +
> +.. code-block:: make
> +
> + $(call install_replace, <package>, <filename>, <placeholder>, <value>)
> +
> +Replace placeholder with value in a previously installed file.
> +
> +The parameters and their meanings:
> +
> +**<package>**
> +  Name of the IPKG/OPKG the macro should work on
> +**<filename>**
> +  Absolute filepath in target root filesystem
> +**<placeholder>**
> +  A string in the file which should be replaced. Usually some uppercase word
> +  surrounded by @ signs
> +**<value>**
> +  The value which should appear in the root filesystem instead of the
> +  placeholder, could be some PTXCONF variable
> +
> +The ``install_replace`` macro can be used in targetinstall stage to adapt some
> +template and replace strings with content from menu variables or other
> +sources. For example look at the timezone you set in the ptxdist menu. An
> +``install_replace`` call in ``rules/timezone.make`` replaces the string
> +``@TIMEZONE@`` in the file ``/etc/timezone`` in ``projectroot`` with the
> +content of the menu variable ``PTXCONF_TIMEZONE_LOCALTIME``. A typical call
> +would look like this:
> +
> +.. code-block:: make
> +
> + @$(call install_replace, timezone, /etc/timezone, @TIMEZONE@, \
> +        $(PTXCONF_TIMEZONE_LOCALTIME))
> +
>  
>  .. _param_macros:
>  
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

      reply	other threads:[~2017-01-05 16:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-21 12:41 Alexander Dahl
2017-01-05 16:51 ` Michael Olbrich [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=20170105165136.p2ac7ccgy2v6jlop@pengutronix.de \
    --to=m.olbrich@pengutronix.de \
    --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