public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: "Hombourger, Cedric" <Cedric_Hombourger@mentor.com>
Cc: Maksim Osipov <mosipov@ilbers.de>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Subject: Re: [PATCH v3 2/2] isar-image: refactor do_rootfs()
Date: Thu, 8 Nov 2018 09:28:51 +0100	[thread overview]
Message-ID: <8cf7ef04-b74b-caea-53f0-55971dedecac@siemens.com> (raw)
In-Reply-To: <b85f0cae962041ceb18efc653d91839a@svr-ies-mbx-02.mgc.mentorg.com>

On 08.11.18 08:59, Hombourger, Cedric wrote:
> Hi Jan,
> 
>> Why making this a python function?
> 
> To align with Yocto and ease extension of do_rootfs should we need to (we probably want to have some guidelines for public APIs and one of them should be: make them Python functions because it allows children classes to use the full Python paradigm instead of the somewhat limited shell environment)

That is not the actual reason why Yocto did this. The reason, which would have 
helped me to understand the design, is that it allows downstream to define the 
language of the subfunctions freely. bb.build.exec_func will take care of 
calling the function as shell or as python, whatever the user chose.

But, as the subfunctions are shell code, appending/prepending still requires 
shell. If you do that for the rootfs function, that must now be python, even if 
shell would be more appropriate. Here, it is impossible with bitbake to provide 
freedom. If you want flexibility, you better model this with tasks. That is 
something to consider seriously if there is a hooking use case.

> 
>> What is the reasoning for the chosen split-up?
> 
> If you are referring to the split of do_rootfs() into smaller functions, the primary objective was the reduction of the function complexity. Another candidate for such refactoring is IMO setup_root_file_system(): it's a function doing dozens of little things. It also allows classes inheriting from isar-image to hook themselves at specific points in the do_rootfs flow instead of being limited to pre-processing and post-processing extension points (do_rootfs_prepend / do_rootfs_append).

I'm not against breaking this task up, but the question is where, and also how. 
And that should be driven by foreseeable use cases.

Eg., isar_image_conf_rootfs seems pointless at this stage because there is 
already DISTRO_CONFIG_SCRIPT to do customizations. If we want that thing to be 
extensible (rather than just replaceable), we need something else.

isar_image_gen_fstab is possibly something we do not want users to play with 
because that could easily conflict with what wic does.

> 
>> These are all recipe APIs, so we must be more careful with such declarations.
> 
> You are right. If isar-image-base was viewed as an API, we probably want to highlight the change in the ChangeLog. I can do that.

Once it is clear why and how a user should overload / append to those APIs.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux

  reply	other threads:[~2018-11-08  8:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 16:12 [PATCH 0/4] add support for OE's ROOTFS_*_COMMAND Cedric Hombourger
2018-10-29 16:13 ` [PATCH 1/4] isar-image-base: introduce and use isar-image class Cedric Hombourger
2018-11-09 13:42   ` Baurzhan Ismagulov
2018-10-29 16:13 ` [PATCH 2/4] isar-image: refactor do_rootfs() Cedric Hombourger
2018-11-29 15:06   ` Jan Kiszka
2018-10-29 16:13 ` [PATCH 3/4] base: add 'lib' folder of each layer to python's module search path Cedric Hombourger
2018-10-29 16:13 ` [PATCH 4/4] isar-image: add support for OE's ROOTFS_*_COMMAND Cedric Hombourger
2018-10-29 16:45 ` [PATCH 0/4] " Henning Schild
2018-10-29 16:55   ` Hombourger, Cedric
2018-10-30  9:25     ` Henning Schild
2018-10-30 11:02       ` Hombourger, Cedric
2018-10-30 12:41         ` Henning Schild
2018-10-30 12:45           ` Hombourger, Cedric
2018-10-31  6:10           ` [PATCH v2 0/2] introduce isar-image class Cedric Hombourger
2018-10-31  6:10             ` [PATCH v2 1/2] isar-image-base: introduce and use " Cedric Hombourger
2018-10-31  6:10             ` [PATCH v2 2/2] isar-image: refactor do_rootfs() Cedric Hombourger
2018-10-31  6:39             ` [PATCH v2 0/2] introduce isar-image class Jan Kiszka
2018-10-31  6:51               ` chombourger
2018-11-01 11:43                 ` Maxim Yu. Osipov
2018-11-09 13:26                 ` Baurzhan Ismagulov
2018-11-01 10:13               ` [PATCH v3 1/2] isar-image-base: introduce and use " Cedric Hombourger
2018-11-01 10:13                 ` [PATCH v3 2/2] isar-image: refactor do_rootfs() Cedric Hombourger
2018-11-07 13:20                   ` Jan Kiszka
2018-11-08  7:59                     ` Hombourger, Cedric
2018-11-08  8:28                       ` Jan Kiszka [this message]
2018-11-07 18:45                   ` Henning Schild
2018-11-07 19:46                     ` Cedric Hombourger
2018-11-07 20:16                       ` Cedric Hombourger
2018-11-08  6:52                         ` Jan Kiszka
2018-11-08  8:13                         ` Henning Schild
2018-11-07 13:07                 ` [PATCH v3 1/2] isar-image-base: introduce and use isar-image class Maxim Yu. Osipov

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=8cf7ef04-b74b-caea-53f0-55971dedecac@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=Cedric_Hombourger@mentor.com \
    --cc=isar-users@googlegroups.com \
    --cc=mosipov@ilbers.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