From: roberto.foglietta@linuxteam.org
To: isar-users@googlegroups.com
Cc: roberto.foglietta@gmail.com
Subject: [PATCH] dpkg: Use mount bind to import debian packages to sbuild chroot
Date: Fri, 20 Jan 2023 17:30:35 +0100 [thread overview]
Message-ID: <20230120163035.3411051-1-roberto.foglietta@linuxteam.org> (raw)
From: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
dpkg: Use mount bind to import debian packages to sbuild chroot
When building packages, sbuild downloads missing dependencies from
debian mirros. In order to reduce network consuming and have in DL_DIR
every package downloaded by sbuild, we additionally import/export
local debian packages to/from apt cache in schroot upper layer.
Since in order to avoid the copy between package WORKDIR and apt cache
in schroot will use mount bind to share debs to schroot and umount when
sbuild ends
* --chroot-setup-commands: mount bind
* --finished-build-commands: umount
This is a propose of a possible alternative to the original patch
of Uladzimir Bely <ubely@ilbers.de> based on symlinks.
Signed-off-by: Roberto A. Foglietta <roberto.foglietta@gmail.com>
---
meta/classes/dpkg.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/meta/classes/dpkg.bbclass b/meta/classes/dpkg.bbclass
index 146f444e..e029fea0 100644
--- a/meta/classes/dpkg.bbclass
+++ b/meta/classes/dpkg.bbclass
@@ -112,9 +112,9 @@ dpkg_runbuild() {
--chroot-setup-commands="echo \"Package: *\nPin: release n=${DEBDISTRONAME}\nPin-Priority: 1000\" > /etc/apt/preferences.d/isar-apt" \
--chroot-setup-commands="echo \"APT::Get::allow-downgrades 1;\" > /etc/apt/apt.conf.d/50isar-apt" \
--chroot-setup-commands="rm -f /var/log/dpkg.log" \
- --chroot-setup-commands="ln -sf ${ext_deb_dir}/*.deb -t ${deb_dir}/ || :" \
+ --chroot-setup-commands="mount -o bind ${ext_deb_dir} ${deb_dir}" \
--finished-build-commands="rm -f ${deb_dir}/sbuild-build-depends-main-dummy_*.deb" \
- --finished-build-commands="cp -Ln --no-preserve=owner ${deb_dir}/*.deb -t ${ext_deb_dir}/ || :" \
+ --finished-build-commands="umount ${deb_dir}" \
--finished-build-commands="cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log" \
--debbuildopts="--source-option=-I" ${DPKG_SBUILD_EXTRA_ARGS} \
--build-dir=${WORKDIR} --dist="isar" ${DSC_FILE}
--
2.34.1
reply other threads:[~2023-01-20 16:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20230120163035.3411051-1-roberto.foglietta@linuxteam.org \
--to=roberto.foglietta@linuxteam.org \
--cc=isar-users@googlegroups.com \
--cc=roberto.foglietta@gmail.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