public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Claudius Heine <claudius.heine.ext@siemens.com>,
	isar-users <isar-users@googlegroups.com>,
	Claudius Heine <ch@denx.de>,
	Henning Schild <henning.schild@siemens.com>,
	Andreas Reichel <Andreas.Reichel@tngtech.com>
Subject: Re: [RFC] Interface for installing bootloaders
Date: Wed, 5 Sep 2018 09:47:45 +0200	[thread overview]
Message-ID: <c4947fbb-53b2-c8a4-f728-2e041e89c665@siemens.com> (raw)
In-Reply-To: <11e15a42-0fa6-cda7-c9c0-4c60ea2b551c@siemens.com>

On 2018-09-05 09:34, Claudius Heine wrote:
> Hi Jan,
> 
> On 2018-09-05 08:08, Jan Kiszka wrote:
>> On 2018-09-04 11:27, Claudius Heine wrote:
>>> Hi Jan,
>>>
>>> On 2018-09-04 09:17, [ext] Jan Kiszka wrote:
>>>> Hi all,
>>>>
>>>> for installing a bootloader into an image, a number of packages have 
>>>> to be installed into the buildchroot. These can be prebuilt packages 
>>>> or packages we build via Isar. Currently, we only handle the case of 
>>>> WIC requiring prebuilt Debian packages, and that in a hacky way (no 
>>>> proper distro abstraction, unneeded installation of unused 
>>>> dependencies). This proposal aims at providing a more holistic 
>>>> solution:
>>>>
>>>> - Introduce new variables that express the two types of dependencies:
>>>>     - BOOTLOADER_PREBUILT
>>>>     - BOOTLOADER_CUSTOM
>>>>
>>>>    So there is no "WIC" in these, any imaging recipe can use them.
>>>>
>>>> - Imaging recipes (e.g. via classes/wic-img.bbclass) should
>>>>     - install all packages from BOOTLOADER_PREBUILT and 
>>>> BOOTLOADER_CUSTOM
>>>>       into the buildchroot
>>>>     - DEPEND on all recipes in BOOTLOADER_CUSTOM
>>>>
>>>> - Define some common dependencies in conf/distro/${DISTRO}.conf:
>>>>     - GRUB_PREBUILT
>>>>     - GRUB_PREBUILT_append_${DISTRO_ARCH}
>>>>     - SYSLINUX_PREBUILT
>>>>     - ...
>>>>
>>>>    Those variables can then be used to initialize 
>>>> BOOTLOADER_PREBUILT as
>>>>    needed and also replace those nasty BUILDCHROOT_PREINSTALL_WIC in
>>>>    buildchroot-target.bb.
>>>>
>>>> - Set BOOTLOADER_PREBUILT or BOOTLOADER_CUSTOM in the
>>>>    conf/machine/${MACHINE}.conf or some overriding conf file - 
>>>> basically
>>>>    the same one that selects IMAGE_TYPE and WKS_FILE.
>>>>
>>>> Anything I missed? Better suggestions? Eventually, when we can 
>>>> derive bitbake recipe dependencies automatically from package 
>>>> dependencies, PREBUILT and CUSTOM could be folded together. Right 
>>>> now, we need that split.
>>>>
>>>> Jan
>>>
>>> I have a class that I use for the current project that allows 
>>> installing additional packages into the buildchroot from within the 
>>> image. I didn't had time to prepare patches for it for mainline isar. 
>>> But maybe that goes into to right direction.
>>>
>>> I attached it.
>>
>> ...
>>
>>> BUILDCHROOT_EXTRA_INSTALL ??= ""
>>>
>>> MOUNT_LOCKFILE = "${BUILDCHROOT_DIR}/mount.lock"
>>>
>>> BUILDCHROOT_DIR ??= "${BUILDCHROOT_TARGET_DIR}"
>>> BUILDCHROOT_BUILD_DEP ??= "buildchroot-target:do_build"
>>>
>>> do_buildchroot_extra_install[depends] = "${BUILDCHROOT_BUILD_DEP}"
>>> do_buildchroot_extra_install[deptask] = "do_deploy_deb"
>>> do_buildchroot_extra_install[stamp-extra-info] = "${DISTRO}-${MACHINE}"
>>> do_buildchroot_extra_install() {
>>>     PACKAGES="${@" ".join(d.getVar("BUILDCHROOT_EXTRA_INSTALL", 
>>> True).split())}"
>>>
>>
>> Can you explain the magic dance in the line above? I don't see its 
>> need yet.
>>
>>>     if [ -z "$PACKAGES" ]; then
>>
>> ...provided you do "[ -z $VAR ]" here to catch VAR=" ".
> 
> In sh i get:
> 
>    $ tets="asdf asdf  asdf asdf"
>    $ [ -z $tets ] && echo yes
>    sh: 2: [: asdf: unexpected operator

Ah, that's what I missed. But then we want to .strip() the variable for 
testing, rather than split/rejoin.

Jan

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

  reply	other threads:[~2018-09-05  7:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04  7:17 Jan Kiszka
2018-09-04  9:27 ` Claudius Heine
2018-09-04  9:33   ` Jan Kiszka
2018-09-05  6:08   ` Jan Kiszka
2018-09-05  7:34     ` Claudius Heine
2018-09-05  7:47       ` Jan Kiszka [this message]
2018-09-05  7:57         ` Claudius Heine
2018-09-05  8:05           ` Jan Kiszka
2018-09-05  8:16             ` Claudius Heine

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=c4947fbb-53b2-c8a4-f728-2e041e89c665@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=Andreas.Reichel@tngtech.com \
    --cc=ch@denx.de \
    --cc=claudius.heine.ext@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    /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