Hi Dmitrios,
On 06.04.22 23:21, Dimitrios Bouras wrote:
> Hello,
>
> Currently it is possible to patch ("on the fly", e.g. by editing in
> place using "sed") file sw-description just before it's added into the
> SWU cpio archive because do_swupdate() copies it from $WORKDIR to $S (=
> ${WORKDIR}/${PN}).
>
> Unfortunately the same is not true for any other local file because
> swupdate_add_src_uri() (called by do_swupdate) copies everything else
> directly from SRC_URI, instead of from $WORKDIR (contrary to usual
> practice).
Well, you want to add some hacks...
>
> I understand there are advantages in doing things this way. I'm looking
> for an elegant "work-around" to patch local source files before they are
> copied from SRC_URI into $S (in preparation for the call to cpio for
> producing the .swu file).
A SWU is a "deployment" file: this means we have already built and we
need to pack all together in an update package (the SWU). With this
goal, sw-description is handled separately because it is often a
template. It is still possible to pick up file added to SRC_URI, but
they are thought as all artifacts : they are ready to be deployed.
If you need to change, you have to follow the general rule in OE: you
create a package and you deploy an artifact. So if you need to patch a
script, you create a package for this script, you add a task to patch
it, and then you add a do_deploy() to put the resulting file into
DEPLOYDIR. In fact, meta-swupdate expects that artifacts are in the
deploy directory. You add them your script to SWUPDATE_IMAGES, that's all.
>
> A bit of background for context: the files I'm interested in patching
> via "sed" are in fact scripts that have fall-back defaults saved in
> variables. It is desirable to generate (and "hard-code") such defaults
> automatically during build time.
See above.
Best regards,
Stefano Babic
>
> Many thanks,
> Dimitri
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "swupdate" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
swupdate+u...@googlegroups.com
> <mailto:
swupdate+u...@googlegroups.com>.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/swupdate/CAExTYs0mnoYaDhMrY7D260tT4EDE3nJjoVt7dXxzV03wdEHP5w%40mail.gmail.com
> <
https://groups.google.com/d/msgid/swupdate/CAExTYs0mnoYaDhMrY7D260tT4EDE3nJjoVt7dXxzV03wdEHP5w%40mail.gmail.com?utm_medium=email&utm_source=footer>.
--
=====================================================================
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone:
+49-8142-66989-53 Fax:
+49-8142-66989-80 Email:
sba...@denx.de
=====================================================================