From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6566568349648551936 X-Received: by 2002:a1c:f410:: with SMTP id z16-v6mr121080wma.29.1528966798309; Thu, 14 Jun 2018 01:59:58 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:7301:: with SMTP id d1-v6ls1526918wmb.8.gmail; Thu, 14 Jun 2018 01:59:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJrY3LEyq8j4JLOOmPK+sCBkFj5wMYcXTuSu49k1M9y0G9M90URx7vXgfNaYo+AzHMFN3Qv X-Received: by 2002:a1c:89c8:: with SMTP id l191-v6mr125139wmd.12.1528966797907; Thu, 14 Jun 2018 01:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528966797; cv=none; d=google.com; s=arc-20160816; b=QxmTz669F6Nz9/gDNVWIOR1bgzeIFY5EfbxsE+IGt5UNNc7wdUSaOFCHmMfUQboQ2c J/Mfmsnz4bLUQ2ARWjSuYjd4LQULa+cPsDrdcXjFaKDJ4xtYTchfPfziiPggmpIiAPh9 VI2Rot7oMZcbcOff9kTNAEs9hRqa0dhnAW77BQYGYdQBvD+vNI3bpYnEYhrvIErWIpk7 WHeFw0BCu+HecDvuyKozbQ3KtqWze9NM5dzlKUF6QpdiYFpXYqa6xrPtRSKkIxEZQfWo 4vcYa+DN8AZVKWUUnhddPO6ww38tp31e8vQR3ldaxIivYtF1KFVJs1jOg/ZoqgJB1ICK afzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:arc-authentication-results; bh=ZnZCzUTlNn+hARQYfKH0FTrEBPOpNaWcQFe83MPuZTI=; b=TP5Jrdj8REreR8/dJifA+eX+1NOmlp0QoOe4YpYKvi57UKHp+ySfW0SrAAFWpzSBzB o26cjuM5eSiFZFq7wlec2FnZICW+nJdokhYFR9nAswvqLvZspkju1R/xBmNWgUy6JMz2 cBNDix4LpJ+3rTLX0fCQLhk0E8TdpYH+T/1/LWEM72U2xlVl3AHbc9XSLF8//WwJNxs3 Jzuvjl2mOx9WAnXg7iV0UFam85lROrPIWWl0i7GqLsapKPLCCkybvoasiEfjX2RdWIiZ kS5I4HY2ChY9LHsPewWM5o6UxmF6zbwE4xw6fq5hZ8buEKU5Fj3Ly8gitv/8Xyxqaz73 vXHA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id e18-v6si171950wmh.1.2018.06.14.01.59.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jun 2018 01:59:57 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id w5E8xvPS011482 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Jun 2018 10:59:57 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40] (may be forged)) by mail2.siemens.de (8.15.2/8.15.2) with ESMTP id w5E8xv5J029622; Thu, 14 Jun 2018 10:59:57 +0200 Date: Thu, 14 Jun 2018 10:59:56 +0200 From: Henning Schild To: "Maxim Yu. Osipov" Cc: Subject: Re: [RFC PATCH 2/6] isar-debootstrap: split into host and target recipes Message-ID: <20180614105956.3f5e6eff@md1pvb1c.ad001.siemens.net> In-Reply-To: <20180613135829.3151-3-mosipov@ilbers.de> References: <20180613135829.3151-1-mosipov@ilbers.de> <20180613135829.3151-3-mosipov@ilbers.de> X-Mailer: Claws Mail 3.15.0-dirty (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: wDd2LVhOXNLW Am Wed, 13 Jun 2018 15:58:25 +0200 schrieb "Maxim Yu. Osipov" : > From: Alexander Smirnov > > This is required for ISAR SDK root filesystem development > to split isar-bootstrap for target platform and host (SDK). > > Signed-off-by: Alexander Smirnov > Signed-off-by: Maxim Yu. Osipov --- > meta-isar/recipes-core/images/isar-image-base.bb | 2 +- > meta/classes/image.bbclass | 2 +- > meta/classes/isar-bootstrap-helper.bbclass | 20 > +++++++++++--- .../isar-bootstrap/isar-bootstrap-host.bb | > 31 > +++++++++++++++++++++ .../isar-bootstrap/isar-bootstrap-target.bb > | 32 ++++++++++++++++++++++ .../{isar-bootstrap.bb => > isar-bootstrap.inc} | 24 ---------------- > meta/recipes-devtools/buildchroot/buildchroot.bb | 4 +-- 7 files > changed, 83 insertions(+), 32 deletions(-) create mode 100644 > meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb create mode > 100644 meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb > rename meta/recipes-core/isar-bootstrap/{isar-bootstrap.bb => > isar-bootstrap.inc} (89%) > > diff --git a/meta-isar/recipes-core/images/isar-image-base.bb > b/meta-isar/recipes-core/images/isar-image-base.bb index > 6cdc6b2..947f4fc 100644 --- > a/meta-isar/recipes-core/images/isar-image-base.bb +++ > b/meta-isar/recipes-core/images/isar-image-base.bb @@ -40,7 +40,7 @@ > devtmpfs /dev devtmpfs > mode=0755,nosuid 0 0 # End /etc/fstab EOF > > - setup_root_file_system --clean --fstab "${WORKDIR}/fstab" \ > + setup_target_root_file_system --clean --fstab "${WORKDIR}/fstab" > \ "${IMAGE_ROOTFS}" ${IMAGE_PREINSTALL} ${IMAGE_INSTALL} > > # Configure root filesystem > diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass > index 3bdcb2f..4738cb8 100644 > --- a/meta/classes/image.bbclass > +++ b/meta/classes/image.bbclass > @@ -47,7 +47,7 @@ INITRD_IMAGE ?= "${@get_image_name(d, > 'initrd.img')[1]}" inherit ${IMAGE_TYPE} > > do_rootfs[stamp-extra-info] = "${MACHINE}-${DISTRO}" > -do_rootfs[depends] = "isar-apt:do_cache_config > isar-bootstrap:do_deploy" +do_rootfs[depends] = > "isar-apt:do_cache_config isar-bootstrap-target:do_deploy" > do_rootfs() { > die "No root filesystem function defined, please implement in > your recipe" diff --git a/meta/classes/isar-bootstrap-helper.bbclass > b/meta/classes/isar-bootstrap-helper.bbclass index 7a63914..51b7901 > 100644 --- a/meta/classes/isar-bootstrap-helper.bbclass > +++ b/meta/classes/isar-bootstrap-helper.bbclass > @@ -1,4 +1,4 @@ > -# Helper functions for using isar-bootstrap > +# Helper functions for using isar-bootstrap-* > # > # This software is a part of ISAR. > # Copyright (c) Siemens AG, 2018 > @@ -15,6 +15,10 @@ def reverse_bb_array(d, varname): > return " ".join(i for i in array) > > setup_root_file_system() { > + DIST="$1" > + shift > + ISAR_BOOTSTRAP_DIR="$1" > + shift > CLEAN="" > COPYREPO="" > FSTAB="" > @@ -35,7 +39,7 @@ setup_root_file_system() { > CLEAN_FILES="${ROOTFSDIR}/etc/hostname > ${ROOTFSDIR}/etc/resolv.conf" > sudo cp -Trpfx \ > - > "${DEPLOY_DIR_IMAGE}/isar-bootstrap-${DISTRO}-${DISTRO_ARCH}/" \ > + "${DEPLOY_DIR_IMAGE}/$ISAR_BOOTSTRAP_DIR/" \ > "$ROOTFSDIR" > [ -n "${FSTAB}" ] && cat ${FSTAB} | sudo tee > "$ROOTFSDIR/etc/fstab" > @@ -46,9 +50,9 @@ setup_root_file_system() { > sudo tee "$ROOTFSDIR/etc/apt/preferences.d/isar" >/dev/null > > if [ ${COPYREPO} ]; then > - sudo cp -Trpfx ${DEPLOY_DIR_APT}/${DISTRO} > $ROOTFSDIR/isar-apt > + sudo cp -Trpfx ${DEPLOY_DIR_APT}/${DIST} $ROOTFSDIR/isar-apt > else > - sudo mount --bind ${DEPLOY_DIR_APT}/${DISTRO} > $ROOTFSDIR/isar-apt > + sudo mount --bind ${DEPLOY_DIR_APT}/${DIST} > $ROOTFSDIR/isar-apt fi > sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs > $ROOTFSDIR/dev sudo mount -t proc none $ROOTFSDIR/proc > @@ -87,3 +91,11 @@ setup_root_file_system() { > sudo rm -f "$ROOTFSDIR/chroot-setup.sh" > fi > } > + > +setup_host_root_file_system() { > + setup_root_file_system ${DISTRO_HOST} > isar-bootstrap-host-${DISTRO}-${DISTRO_ARCH} "$@" +} > + > +setup_target_root_file_system() { > + setup_root_file_system ${DISTRO} > isar-bootstrap-target-${DISTRO}-${DISTRO_ARCH} "$@" +} > 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..6f7480d > --- /dev/null > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-host.bb > @@ -0,0 +1,31 @@ > +# Minimal debian root file system > +# > +# This software is a part of ISAR. > +# Copyright (c) Siemens AG, 2018 > +# > +# SPDX-License-Identifier: MIT > + > +Description = "Minimal native Debian root file system" > + > +include isar-bootstrap.inc > + > +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 > diff --git > a/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb > b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb new file > mode 100644 index 0000000..f65f1dd --- /dev/null > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap-target.bb > @@ -0,0 +1,32 @@ > +# Minimal debian root file system > +# > +# This software is a part of ISAR. > +# Copyright (c) Siemens AG, 2018 > +# > +# SPDX-License-Identifier: MIT > + > +Description = "Minimal native Debian root file system" > + > +include isar-bootstrap.inc > + > +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 \ > + --arch="${DISTRO_ARCH}" \ > + --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 The two DEBOOTSTRAPs are almost the same. You first pull it out and then create almost identical copies. Cant you just pass the DISTRO and HOST_DISTRO in and call it DIST like you do in setup_root_file_system()? Henning > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb > b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc similarity > index 89% rename from > meta/recipes-core/isar-bootstrap/isar-bootstrap.bb rename to > meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index > 497a4f4..c473ad6 100644 --- > a/meta/recipes-core/isar-bootstrap/isar-bootstrap.bb +++ > b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -5,8 +5,6 @@ > # > # SPDX-License-Identifier: MIT > > -Description = "Minimal debian root file system" > - > LICENSE = "gpl-2.0" > LIC_FILES_CHKSUM = > "file://${LAYERDIR_isar}/licenses/COPYING.GPLv2;md5=751419260aa954499f7abaabaa882bbe" > FILESPATH_prepend := "${THISDIR}/files:" @@ -172,28 +170,6 @@ python > do_apt_config_prepare() { } > addtask apt_config_prepare before do_build after do_unpack > > -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 \ > - --arch="${DISTRO_ARCH}" \ > - --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_set_locale() { > sudo install -v -m644 "${WORKDIR}/locale" > "${ROOTFSDIR}/etc/locale" > diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb > b/meta/recipes-devtools/buildchroot/buildchroot.bb index > 538c577..5fa8691 100644 --- > a/meta/recipes-devtools/buildchroot/buildchroot.bb +++ > b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -66,10 +66,10 > @@ do_build[root_cleandirs] = "${BUILDCHROOT_DIR} \ > ${BUILDCHROOT_DIR}/isar-apt \ ${BUILDCHROOT_DIR}/downloads \ > ${BUILDCHROOT_DIR}/home/builder" > -do_build[depends] = "isar-apt:do_cache_config > isar-bootstrap:do_deploy" +do_build[depends] = > "isar-apt:do_cache_config isar-bootstrap-target:do_deploy" > do_build() { > - setup_root_file_system "${BUILDCHROOT_DIR}" > ${BUILDCHROOT_PREINSTALL} > + setup_target_root_file_system "${BUILDCHROOT_DIR}" > ${BUILDCHROOT_PREINSTALL} > # Install package builder script > sudo chmod -R a+rw "${BUILDCHROOT_DIR}/home/builder"