From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6597265115990458368 X-Received: by 2002:adf:ad95:: with SMTP id w21-v6mr3170354wrc.26.1536133668203; Wed, 05 Sep 2018 00:47:48 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:ad96:: with SMTP id w22-v6ls347618wrc.0.gmail; Wed, 05 Sep 2018 00:47:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbZs5nDBOQzFkG97hx2SpUKy5Rq04p1a8iq8T0KIqTUDWDfqNLcr9GybOsoeaiHjSBEBCAC X-Received: by 2002:adf:f40e:: with SMTP id g14-v6mr3290998wro.1.1536133667689; Wed, 05 Sep 2018 00:47:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536133667; cv=none; d=google.com; s=arc-20160816; b=uBN1o0egZmHirw3NJQpyPIopYFkM6yo9xRiYxWecrZjTF5b28LhX2W01oMHEgZTknP DudQrMORnnh/XCBxj0AYBfeGu18abTRtPki4BaDw2VIR5iaAxupKWqct7gmMfAr210uP JDOovVKGe3iPtGuzkSOaCk/o48VN/WY1Y1QE7fFVUywzI9x1bQi5LzTtlOBoNy27Uf9S BLRZXbKj26mzEoWzsKC/iEUwJSc9JnVN9NDr2cVcxKJF3tYXXKIw0FKkMmyh9JGdlupr MialwNf25Vx1A2OILm9bZcf9muu3dEa1m08zaelkpbQ9qc+/XDUgtnOJao5BeTm6LNuM ogNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject; bh=WMWQO9NqcNA/rDLo3fWF4zCDJL0o8y9BNubphlfVrPk=; b=kA6sGRow8KCJ4uvyeIMSRPQjDwRX3BM+iU2fROKZ1s9eOWehUfl6nGEcBW/RRhzXp9 mS9LpLd4NQ8sMxSJDSJgAUqT06kYdAOhrrIJrdE35Jb1joMqDlxpdTOl9uNHjvqd/JA3 fa50vWxJ9/dYeFaRQ/uySXtggVy4wHA48u6d1M3ufX/0TdZCnzLD4rkAk1IiuyialQEN gOM6NcKkF8Y9K2tSbGIHsHk/z8+lWtETEuRg1uO8GVOKQ7+tuoQGhmZryVgvD3gZOpOc jwqnNmXYYzuuj1wuWIm3caVcFPG4UIDyBlBpMyk7nkJ7Luc51gGiX1ijczi62BFxNvaS 2QEA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Return-Path: Received: from david.siemens.de (david.siemens.de. [192.35.17.14]) by gmr-mx.google.com with ESMTPS id 20-v6si19766wrb.5.2018.09.05.00.47.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Sep 2018 00:47:47 -0700 (PDT) Received-SPF: pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) client-ip=192.35.17.14; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 192.35.17.14 as permitted sender) smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id w857lkwu002432 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 Sep 2018 09:47:46 +0200 Received: from [167.87.2.38] ([167.87.2.38]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w857lkX5025801; Wed, 5 Sep 2018 09:47:46 +0200 Subject: Re: [RFC] Interface for installing bootloaders To: Claudius Heine , isar-users , Claudius Heine , Henning Schild , Andreas Reichel References: <0aeb9010-8fed-6094-ac12-41983c3831ae@siemens.com> <4ae0dc9d-7fa4-9fa0-7844-aab25579fdb7@siemens.com> <11e15a42-0fa6-cda7-c9c0-4c60ea2b551c@siemens.com> From: Jan Kiszka Message-ID: Date: Wed, 5 Sep 2018 09:47:45 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 MIME-Version: 1.0 In-Reply-To: <11e15a42-0fa6-cda7-c9c0-4c60ea2b551c@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-TUID: G4ikFFAkw+nd 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