public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] dpkg-base: mount git source folder into buildchroot
@ 2017-11-14 16:48 Christian Storm
  2017-11-17 15:17 ` Alexander Smirnov
  2017-11-20  9:37 ` Henning Schild
  0 siblings, 2 replies; 13+ messages in thread
From: Christian Storm @ 2017-11-14 16:48 UTC (permalink / raw)
  To: isar-users; +Cc: Christian Storm

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-11-21 14:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-14 16:48 [PATCH] dpkg-base: mount git source folder into buildchroot Christian Storm
2017-11-17 15:17 ` Alexander Smirnov
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox