public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: Christian Storm <christian.storm@siemens.com>
Cc: isar-users@googlegroups.com
Subject: Re: [PATCH] dpkg-base: mount git source folder into buildchroot
Date: Fri, 17 Nov 2017 18:17:21 +0300	[thread overview]
Message-ID: <185f0c4a-d1a9-159c-9852-272c92415615@ilbers.de> (raw)
In-Reply-To: <20171114164844.16899-1-christian.storm@siemens.com>

Hi,

On 11/14/2017 07:48 PM, Christian Storm wrote:
> 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.

Could you please provide more details regarding where it should be mounted?

> 
> 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}

${GITDIR} - will be expanded to absolute path of your build tree on the 
host. Why this private path is needed in buildchroot? This doesn't look 
correct for me if you need it for build.

Also git repository is already available in buildchroot:

1. If package is fetched via git repository - it's stored in ${GITDIR}.
2. Then task "do_unpack" clones this to ${WORKDIR}/git folder
3. During build task, the folder ${WORKDIR} is mounted to ${BUILDROOT}
4. So your git repo is in: /home/builder/${PN}/git folder inside chroot.

Probably some sample recipe would be helpful to describe what's going.

Alex

>       _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
>           (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
>   }
>

  reply	other threads:[~2017-11-17 15:17 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 [this message]
2017-11-17 17:05   ` Christian Storm
2017-11-20  9:37 ` Henning Schild
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=185f0c4a-d1a9-159c-9852-272c92415615@ilbers.de \
    --to=asmirnov@ilbers.de \
    --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