Yocto Project Discussions
 help / color / mirror / Atom feed
From: Felix Kuhlmann <felix-kuhlmann@gmx.de>
To: yocto@lists.yoctoproject.org,
	Josef Holzmayr <jester@theyoctojester.info>
Subject: Re: [yocto] Question regarding executing an install script during the build of an image
Date: Mon, 21 Oct 2024 13:40:52 +0200	[thread overview]
Message-ID: <ZxY9xINxSRyuHZdh@fedora> (raw)
In-Reply-To: <CAEt6NwrhEanG17jKXLR5vzL+YGeOT9zX_6aS189OV9vkcE8=6g@mail.gmail.com>

Hi Marco, hi Josef,

thank you very much for your input.

I greatly underestimated the work needed for using the given installer script in the yocto context.
I'm glad that you showed me the implications of my plan beforehand, this saves me a few wasted hours :D

Greetings,
Felix

Am Mon, Oct 21, 2024 at 11:39:14AM +0200 schrieb Josef Holzmayr:
> Hi Felix,
>
> I presume you are talking about
> https://github.com/thiagoralves/OpenPLC_v3/tree/master? In that case, what
> *actually* runs in that installation script is
> https://github.com/thiagoralves/OpenPLC_v3/blob/master/background_installer.sh,
> which is a highly general purpose distribution targeted approach, which
> basically relies on being able to pull in packages at random. This is
> nowhere near reproducible, and therefore will cause you a lot of pain if
> you want to put it into a recipe. So what you really need to do is:
> 1. make sure that all dependencies are already available as recipes so you
> can treat them as DEPENDS/RDEPENDS. The entry point for working through it
> is probably
> https://github.com/thiagoralves/OpenPLC_v3/blob/b2ef6d15d0ec92110cf44ad3f58e364db60dec72/background_installer.sh#L241
> 2. factor out the hidden systemd service into a proper file and use the
> systemd.bbclass mechanisms to install it:
> https://github.com/thiagoralves/OpenPLC_v3/blob/b2ef6d15d0ec92110cf44ad3f58e364db60dec72/background_installer.sh#L215
> 3. understand whatever magic is needed additionally, starting point
> probably is
> https://github.com/thiagoralves/OpenPLC_v3/blob/b2ef6d15d0ec92110cf44ad3f58e364db60dec72/background_installer.sh#L250
>
> Plus whatever goes wrong along the way. :-(
>
> Greetz,
> Josef
>
> On Sun, Oct 20, 2024 at 11:20 AM Marco Cavallini via lists.yoctoproject.org
> <koansoftware=gmail.com@lists.yoctoproject.org> wrote:
>
> > Hello Felix,
> > probably I don't have enough details to give you a complete hint.
> > However, the solution usually suggested is to create your own recipe,
> > perhaps using "recipetool create" [1] and then adapt its content (this is
> > what I usually explain during my Yocto training courses).
> > Then you can include in your recipe the installation and the management of
> > a launcher script and its systemd service for example (if you are using
> > systemd) [2].
> >
> > [1]
> > https://docs.yoctoproject.org/next/dev-manual/new-recipe.html?highlight=systemd
> > [2]
> > https://wiki.koansoftware.com/index.php/Add_a_systemd_service_file_into_a_Yocto_image
> >
> > Marco Cavallini
> > Yocto Project ambassador
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > You automatically follow any topics you start or reply to.
> > View/Reply Online (#64055):
> > https://lists.yoctoproject.org/g/yocto/message/64055
> > Mute This Topic: https://lists.yoctoproject.org/mt/109099192/4689568
> > Group Owner: yocto+owner@lists.yoctoproject.org
> > Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [
> > jester@theyoctojester.info]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
> >


      reply	other threads:[~2024-10-21 11:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-19 11:50 Question regarding executing an install script during the build of an image Felix Kuhlmann
2024-10-20  9:19 ` [yocto] " Marco Cavallini
2024-10-21  9:39   ` Josef Holzmayr
2024-10-21 11:40     ` Felix Kuhlmann [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=ZxY9xINxSRyuHZdh@fedora \
    --to=felix-kuhlmann@gmx.de \
    --cc=jester@theyoctojester.info \
    --cc=yocto@lists.yoctoproject.org \
    /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