public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH 3/9] isar-bootstrap: Add host architecture support
Date: Fri, 15 Jun 2018 13:09:32 +0200	[thread overview]
Message-ID: <20180615110932.GD24273@azat.radix50.net> (raw)
In-Reply-To: <20180614132737.01d88b06@md1pvb1c.ad001.siemens.net>

On Thu, Jun 14, 2018 at 01:27:37PM +0200, Henning Schild wrote:
Hi Henning,

> This + 2/9 looks very much like what Maxim posted. Again i would like
> to understand why we need a copy of the debootstrap code. Maybe the
> differences can be addressed with introducing variables.
> 

For sure, that's the first idea came to my mind. But after an attempts
to implement this I've faced with the following issues:

 - buildchroot/buildchroot-cross are optional. They should be added to
   pipeline if some recipe requires them, i.e. ihnerits dpkg-* class.
 - Each buildchroot should have its own set of stamps to avoid
   duplications. For example each multiconfig has its own instance of
   target rootfs, but host rootfs should be singletone.

Current Isar implementation contains very comfortable way to chose the way how to build the package - inherit respective class.
Re-use of this approach to implement cross-building looks for me very comfortable way:
 - We should not invent the wheel and introduce new user-interface how
   to implement recipes. For example dpkg.bbclass depends on
buildchroot:do_build, so I simply implement dpkg-cross.bbclass which
depends on buildchroot-cross:do_build.
 - The Isar will stay flexible and builds the only really needed parts

Regarding the duplication - I've tried to reduce it as much as possible.
The shareble part is moved to .inc file, so the recipe payload contains
the only arch-specific stuff.

Alex

> Henning
> 
> Am Wed, 13 Jun 2018 15:08:01 +0200
> schrieb Alexander Smirnov <asmirnov@ilbers.de>:
> 
> > Add recipe to generate bootstrap with the host architecture.
> > 
> > Signed-off-by: Alexander Smirnov <asmirnov@ilbers.de>
> > ---
> >  .../isar-bootstrap/isar-bootstrap-host.bb          | 44
> > ++++++++++++++++++++++ 1 file changed, 44 insertions(+)
> >  create mode 100644
> > meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
> > 
> > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
> > b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb new file
> > mode 100644 index 0000000..c61c665
> > --- /dev/null
> > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb
> > @@ -0,0 +1,44 @@
> > +# Minimal host Debian root file system
> > +#
> > +# This software is a part of ISAR.
> > +# Copyright (c) Siemens AG, 2018
> > +#
> > +# SPDX-License-Identifier: MIT
> > +
> > +Description = "Minimal host Debian root file system"
> > +
> > +include isar-bootstrap.inc
> > +inherit isar-bootstrap-helper
> > +
> > +do_bootstrap[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
> > +do_bootstrap[vardeps] += "DISTRO_APT_SOURCES"
> > +do_bootstrap[vardeps] += "DISTRO_APT_PREMIRRORS"
> > +do_bootstrap() {
> > +    if [ -e "${ROOTFSDIR}" ]; then
> > +       sudo umount -l "${ROOTFSDIR}/dev" || true
> > +       sudo umount -l "${ROOTFSDIR}/proc" || true
> > +       sudo rm -rf "${ROOTFSDIR}"
> > +    fi
> > +    E="${@bb.utils.export_proxies(d)}"
> > +    sudo -E "${DEBOOTSTRAP}" --verbose \
> > +                             --variant=minbase \
> > +                             --include=locales \
> > +                             ${@get_distro_components_argument(d)} \
> > +                             ${DEBOOTSTRAP_KEYRING} \
> > +                             "${@get_distro_suite(d)}" \
> > +                             "${ROOTFSDIR}" \
> > +                             "${@get_distro_source(d)}"
> > +}
> > +addtask bootstrap before do_build after do_generate_keyring
> > +
> > +do_deploy[stamp-extra-info] = "${DISTRO}-${HOST_ARCH}"
> > +do_deploy[dirs] = "${DEPLOY_DIR_IMAGE}"
> > +do_deploy() {
> > +    ln -Tfsr "${ROOTFSDIR}"
> > "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}-${HOST_ARCH}" +}
> > +addtask deploy before do_build after do_apt_update
> > +
> > +CLEANFUNCS = "clean_deploy"
> > +clean_deploy() {
> > +     rm -f "${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${HOST_ARCH}"
> > +}
> 

  reply	other threads:[~2018-06-15 11:09 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13 13:07 [RFC] [PATCH 0/9] Initial cross-compilation support Alexander Smirnov
2018-06-13 13:07 ` [PATCH 1/9] isar-bootstrap: Add routin to determine host arch Alexander Smirnov
2018-06-14 11:23   ` Henning Schild
2018-06-15 11:11     ` Alexander Smirnov
2018-06-15 11:15       ` Jan Kiszka
2018-06-13 13:08 ` [PATCH 2/9] isar-bootstrap: Move common part to include Alexander Smirnov
2018-06-13 13:08 ` [PATCH 3/9] isar-bootstrap: Add host architecture support Alexander Smirnov
2018-06-14 11:27   ` Henning Schild
2018-06-15 11:09     ` Alexander Smirnov [this message]
2018-06-13 13:08 ` [PATCH 4/9] isar-bootstrap-helper: Add parameter to set arch Alexander Smirnov
2018-06-13 13:08 ` [PATCH 5/9] buildchroot-cross: Initial implementation Alexander Smirnov
2018-06-14 11:36   ` Henning Schild
2018-06-15 11:16     ` Alexander Smirnov
2018-06-14 15:55   ` Jan Kiszka
2018-06-15 10:56     ` Alexander Smirnov
2018-06-15 11:12       ` Jan Kiszka
2018-06-17 19:28         ` Alexander Smirnov
2018-06-13 13:08 ` [PATCH 6/9] classes/dpkg*: Relocate dependency from buildchroot Alexander Smirnov
2018-06-14  6:44   ` Jan Kiszka
2018-06-15 10:52     ` Alexander Smirnov
2018-06-13 13:08 ` [PATCH 7/9] classes/dpkg*: Drop hardcoded buildchroot blobs Alexander Smirnov
2018-06-13 13:08 ` [PATCH 8/9] classes/dpkg-cross: Initial implementation Alexander Smirnov
2018-06-13 13:08 ` [PATCH 9/9] [FOR TESTING] libhello: Switch to cross compilation Alexander Smirnov
2018-06-13 13:57 ` [RFC] [PATCH 0/9] Initial cross-compilation support Jan Kiszka
2018-06-14 11:20 ` Henning Schild
2018-06-17 19:41   ` Alexander Smirnov
2018-06-18  7:04     ` Henning Schild
2018-06-14 12:01 ` Henning Schild
2018-06-14 12:04 ` Claudius Heine
2018-06-14 12:24   ` Henning Schild
2018-06-14 12:36     ` Claudius Heine
2018-06-14 12:30   ` Jan Kiszka
2018-06-14 12:42     ` Claudius Heine
2018-06-14 12:55       ` Claudius Heine
2018-06-15 10:50   ` Alexander Smirnov
2018-06-15 13:17     ` 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=20180615110932.GD24273@azat.radix50.net \
    --to=asmirnov@ilbers.de \
    --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