public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Claudius Heine <claudius.heine.ext@siemens.com>
To: Alexander Smirnov <asmirnov@ilbers.de>, isar-users@googlegroups.com
Subject: Re: [PATCH v3 2/5] isar: Change build folders tree
Date: Tue, 12 Sep 2017 09:23:48 +0200	[thread overview]
Message-ID: <dfe3cb60-561c-5cbf-4e18-076ccd12cc38@siemens.com> (raw)
In-Reply-To: <20170911192738.1323-3-asmirnov@ilbers.de>

Hi Alex,

On 09/11/2017 09:27 PM, Alexander Smirnov wrote:
> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb b/meta/recipes-devtools/buildchroot/buildchroot.bb
> index ccba683..722007d 100644
> --- a/meta/recipes-devtools/buildchroot/buildchroot.bb
> +++ b/meta/recipes-devtools/buildchroot/buildchroot.bb
> @@ -21,7 +21,7 @@ BUILDCHROOT_PREINSTALL ?= "gcc \
>                              apt \
>                              automake"
>   
> -WORKDIR = "${TMPDIR}/work/${PF}/${DISTRO}"
> +WORKDIR = "${TMPDIR}/work/${DISTRO}-${DISTRO_ARCH}/${PN}"
>   
>   do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}"
>   
> @@ -34,18 +34,20 @@ do_build() {
>       install -m 755 ${THISDIR}/files/setup.sh ${WORKDIR}
>       install -m 755 ${THISDIR}/files/download_dev-random ${WORKDIR}/hooks_multistrap/
>   
> -    # Adjust multistrap config
> -    sed -i 's|##BUILDCHROOT_PREINSTALL##|${BUILDCHROOT_PREINSTALL}|' ${WORKDIR}/multistrap.conf
> -    sed -i 's|##DISTRO##|${DISTRO}|' ${WORKDIR}/multistrap.conf
> -    sed -i 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|' ${WORKDIR}/multistrap.conf
> -    sed -i 's|##DISTRO_SUITE##|${DISTRO_SUITE}|' ${WORKDIR}/multistrap.conf
> -    sed -i 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|' ${WORKDIR}/multistrap.conf
> -    sed -i 's|##CONFIG_SCRIPT##|./tmp/work/${PF}/${DISTRO}/configscript.sh|' ${WORKDIR}/multistrap.conf
> -    sed -i 's|##SETUP_SCRIPT##|./tmp/work/${PF}/${DISTRO}/setup.sh|' ${WORKDIR}/multistrap.conf
> -    sed -i 's|##DIR_HOOKS##|./tmp/work/${PF}/${DISTRO}/hooks_multistrap|' ${WORKDIR}/multistrap.conf
> -
> -    # Multistrap config use relative paths, so ensure that we are in the right folder
> +    # Multistrap accepts only relative path in configuration files, so get it:
>       cd ${TOPDIR}
> +    WORKDIR_REL=$(python -c "import os.path; print os.path.relpath('${WORKDIR}')")
Better. But have you tried something like this:

     WORKDIR_REL="${@ os.path.relpath(d.getVar(WORKDIR, True))}"

Since bitbake allows python inline code and the 'os' module should be 
imported per default it should work.

> +
> +    # Adjust multistrap config
> +    sed -i -e 's|##IMAGE_PREINSTALL##|${IMAGE_PREINSTALL}|g' \
> +           -e 's|##DISTRO##|${DISTRO}|g' \
> +           -e 's|##DISTRO_APT_SOURCE##|${DISTRO_APT_SOURCE}|g' \
> +           -e 's|##DISTRO_SUITE##|${DISTRO_SUITE}|g' \
> +           -e 's|##DISTRO_COMPONENTS##|${DISTRO_COMPONENTS}|g' \
> +           -e 's|##CONFIG_SCRIPT##|./'"$WORKDIR_REL"'/configscript.sh|g' \
> +           -e 's|##SETUP_SCRIPT##|./'"$WORKDIR_REL"'/setup.sh|g' \
> +           -e 's|##DIR_HOOKS##|./'"$WORKDIR_REL"'/hooks_multistrap|g' \
> +              ${WORKDIR}/multistrap.conf

Thanks for making it so easier for my eyes :)

>   
>       # Create root filesystem
>       sudo multistrap -a ${DISTRO_ARCH} -d "${BUILDCHROOT_DIR}" -f "${WORKDIR}/multistrap.conf" || true
> 

Cheers,
Claudius

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: ch@denx.de

  reply	other threads:[~2017-09-12  7:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 19:27 [PATCH v3 0/5] Unify work space for packages Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 1/5] image: Unify path to image rootfs Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 2/5] isar: Change build folders tree Alexander Smirnov
2017-09-12  7:23   ` Claudius Heine [this message]
2017-09-12  7:57   ` Alexander Smirnov
2017-09-12 12:52   ` Henning Schild
2017-09-12 13:02     ` Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 3/5] stamps: Name stamps canonicaly and unified Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 4/5] image: Name image " Alexander Smirnov
2017-09-11 19:27 ` [PATCH v3 5/5] class/dpkg: Unify workplace for packages Alexander Smirnov
2017-09-12 14:26 ` [PATCH] doc: Update technical overview Alexander Smirnov

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=dfe3cb60-561c-5cbf-4e18-076ccd12cc38@siemens.com \
    --to=claudius.heine.ext@siemens.com \
    --cc=asmirnov@ilbers.de \
    --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