public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: "[ext] Christian Storm" <christian.storm@siemens.com>
Cc: <isar-users@googlegroups.com>
Subject: Re: [PATCH] dpkg-base: mount git source folder into buildchroot
Date: Mon, 20 Nov 2017 10:37:28 +0100	[thread overview]
Message-ID: <20171120103728.08714150@md1em3qc> (raw)
In-Reply-To: <20171114164844.16899-1-christian.storm@siemens.com>

Am Tue, 14 Nov 2017 17:48:44 +0100
schrieb "[ext] Christian Storm" <christian.storm@siemens.com>:

> When building a Debian source package with source/format "3.0 (git)",
> the git binary is used to bundle the source. For being able to do so,
> <build>/tmp/downloads/git/<git_repo> needs to be mounted into the
> buildchroot as .git/objects/info/alternates refers to it.
> 
> Signed-off-by: Christian Storm <christian.storm@siemens.com>
> ---
>  meta/classes/dpkg-base.bbclass | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/meta/classes/dpkg-base.bbclass
> b/meta/classes/dpkg-base.bbclass index 35af6d5..a98e690 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -20,14 +20,18 @@ dpkg_runbuild() {
>  # Wrap the function dpkg_runbuild with the bind mount for buildroot
>  do_build() {
>      mkdir -p ${BUILDROOT}
> -    sudo mount --bind ${WORKDIR} ${BUILDROOT}
> +    [ ! -d ${BUILDCHROOT_DIR}/${GITDIR} ] && sudo install -d -m 755
> ${BUILDCHROOT_DIR}/${GITDIR} 

This "mkdir" should probably be done in buildchroot:do_build, maybe
with [dirs]. The current implementation has a race and the mkdir could
also be done without condition, since install would not fail anyways.

> _do_build_cleanup() {
>          ret=$?
>          sudo umount ${BUILDROOT} 2>/dev/null || true
>          sudo rmdir ${BUILDROOT} 2>/dev/null || true
> +        sudo umount ${BUILDCHROOT_DIR}/${GITDIR} 2>/dev/null || true
> +        sudo rmdir ${BUILDCHROOT_DIR}/${GITDIR} 2>/dev/null || true

The rmdir is not really needed, maybe [dirs] will handle it.

Henning

>          (exit $ret) || bb_exit_handler
>      }
>      trap '_do_build_cleanup' EXIT
> +    sudo mount --bind ${WORKDIR} ${BUILDROOT}
> +    sudo mount --bind ${GITDIR} ${BUILDCHROOT_DIR}/${GITDIR}
>      dpkg_runbuild
>      _do_build_cleanup
>  }


  parent reply	other threads:[~2017-11-20  9:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 16:48 Christian Storm
2017-11-17 15:17 ` Alexander Smirnov
2017-11-17 17:05   ` Christian Storm
2017-11-20  9:37 ` Henning Schild [this message]
2017-11-20 11:30   ` Christian Storm
2017-11-20 15:06   ` [PATCH] Map git objects to buildchroot Alexander Smirnov
2017-11-20 15:32     ` Henning Schild
2017-11-20 15:54       ` Alexander Smirnov
2017-11-21  8:14         ` Christian Storm
2017-11-21 14:52           ` Alexander Smirnov
2017-11-21  8:20         ` Henning Schild
2017-11-21  8:57           ` Alexander Smirnov
2017-11-21  9:07             ` Henning Schild

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=20171120103728.08714150@md1em3qc \
    --to=henning.schild@siemens.com \
    --cc=christian.storm@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