From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6488313435861811200 X-Received: by 10.28.14.3 with SMTP id 3mr601698wmo.12.1510931850953; Fri, 17 Nov 2017 07:17:30 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 10.28.87.82 with SMTP id l79ls917462wmb.4.gmail; Fri, 17 Nov 2017 07:17:30 -0800 (PST) X-Google-Smtp-Source: AGs4zMZTRUnCU+FjUl6j2bRgkghCXRZS9K5N1l37p50X49RnLFLEG7SPI5KeiV4sqFfVeLi6j1Hp X-Received: by 10.28.249.3 with SMTP id x3mr552353wmh.6.1510931850548; Fri, 17 Nov 2017 07:17:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510931850; cv=none; d=google.com; s=arc-20160816; b=FfIecGqaT8Na9iEaVTepRKUCiWA9Z/iwpqKH59kQ4Ymk8iPJhYmRERmtyd7Ve2g2yX OcE1sqBY30n+KY3WkQi1t/p0neSfQ8XFoiDSN/uUOC+hqT8R/UEW4LNwb1uOq8L3qX4X svRn8FsuBsFZU7EeVzzx6RtdPhoWxLmHgM3Clk8drGWf636A7XaKnUUpZzLCiokbdooF 6m4nAFFWgl88Zwfcms6xuYtBmOceKy59vECfbh11KKWq1ImE7EPGV5Y32PXgE/98d4Cg E+7tUsnUc2cglBIDPhM8MJZo3lImliuAyzY/cDtcVi6glUaWNhR70MVCnnmYIsY4YIU7 LNtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:cc:from:references:to:subject :arc-authentication-results; bh=9aU2h8KPC47LdLQu7wm/OGUS9kTSVqLjNARRFyU78mI=; b=lfN/liFTT9IO9v9Ti3w0wwrx6oZi3lK+Kpbr5qy1vfF+fUa7WsvnzxAO0oUIRjlgc1 /NCrQcPqvUeo4EvBqln/TL0nvN8V67OfJJwnzlX9Wv7ooG1ftyH9XJRNH5hY6HUo/BG+ h87D9IGQ6if26BHt/26QnghLXJ6qy2rZP3R6wOYwpGEwvz7QvYlkTNjHbhAwltR5HbqL MdeX4mwS//D772nVkrLqMbsfIqfP3wRikLWEJeo6MvQ5RtDLG4NLfAT6Vb8UY8SCIxAu ySOmmKEddL0OhQ/2GBxKsN5JtKrhf4vyxfedEozETcoPhKbLvK/0X2FPPeDBUZ8OmkAs i+ZQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id a2si373066wmg.0.2017.11.17.07.17.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Nov 2017 07:17:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of asmirnov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=asmirnov@ilbers.de Received: from [10.0.2.15] ([188.227.110.165]) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id vAHFHRDM021702 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 17 Nov 2017 16:17:29 +0100 Subject: Re: [PATCH] dpkg-base: mount git source folder into buildchroot To: Christian Storm References: <20171114164844.16899-1-christian.storm@siemens.com> From: Alexander Smirnov Cc: isar-users@googlegroups.com Message-ID: <185f0c4a-d1a9-159c-9852-272c92415615@ilbers.de> Date: Fri, 17 Nov 2017 18:17:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171114164844.16899-1-christian.storm@siemens.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: DZV2+5Spxgnd 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, > /tmp/downloads/git/ 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 > --- > 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 > } >