From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7190772722409930752 X-Received: by 2002:a2e:9b8c:0:b0:27f:d4ca:d927 with SMTP id z12-20020a2e9b8c000000b0027fd4cad927mr877837lji.184.1674232241490; Fri, 20 Jan 2023 08:30:41 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:368e:b0:4cf:ff9f:bbfd with SMTP id d14-20020a056512368e00b004cfff9fbbfdls1204985lfs.1.-pod-prod-gmail; Fri, 20 Jan 2023 08:30:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXuywL/1NfQEECwV9+OY+PUFsKqhClWy3mm8TYR/vH217W1qxMA9glP5jFrm9pJ7Oy17UHzT X-Received: by 2002:ac2:5a06:0:b0:4d0:62b9:87c0 with SMTP id q6-20020ac25a06000000b004d062b987c0mr3855625lfn.13.1674232240096; Fri, 20 Jan 2023 08:30:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674232240; cv=none; d=google.com; s=arc-20160816; b=OPR+Qisb1y7n/HWMqBQhUhiZDjPJ3WrscsmfKc0n7i5cF5SONqSwXhFmrYaiuczpsB YMqi6nitKhnXipbzukni6ZcC2dFp3DaZG3xIuDxhBy4wmjFZEajdi3pzMked5DmKJDSY RbrQzSLV5LruHZDvv+BXvtdrOk8DBbrqk5leUeRuNvoFpMvC8Xdhk4vAW28OIQijevhe +Kf8UvC9kngTKJewdLTcJSNPsdwJcZI8PX74v3kaO04S/WvSr3Y82CWwKRcjBhjDElpx nLTxk5oNaOROgWlrrRLUuNiVHJZfgKNzDS+yEkQOs3ji6SDIjBUxIM8SFmlO+IsfR+n+ y3Vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=8hoiyB5fKqMzMPR1ViF00RTpB+y7N4jkMVm0SVy6nLA=; b=VlHVKlaFQsGeBm2rdcn/CqsA31SQ6AG5fx+ZFy3xrN7uY+3/6AXiEIyE/FjEnlyTRN yIgGfKcGeWrcaZCIPqzQTdOMa3zjXOIyL3jtU/Wnn4Jm/Mnp3OghbZyqjv+IwNPhL2KQ 03f+9xvZMIT0uFdMR3YsioTDBUFF7vIN8sEEbLdEm9GgzoNDbc28Rbj6cN68X1EJPMHe ahNmyHhAmtrO7ZnSjW2rj4mAA6hUBEGDDIYRCkv7pjRVnOp1obW+KbVsh5UagrL5pZ6f wLxFMHf1ENntKMwxJKEAo9J2OSqwiKk1BZOBVCqjPYe/8x2xlUOevDc83Ouda9QUIfTp sqdw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.171 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org Return-Path: Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it. [5.144.164.171]) by gmr-mx.google.com with ESMTPS id k11-20020a2eb74b000000b0028b7cc84addsi790956ljo.2.2023.01.20.08.30.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Jan 2023 08:30:39 -0800 (PST) Received-SPF: pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.171 as permitted sender) client-ip=5.144.164.171; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of roberto.foglietta@linuxteam.org designates 5.144.164.171 as permitted sender) smtp.mailfrom=roberto.foglietta@linuxteam.org Received: from localhost.localdomain (unknown [IPv6:2a02:8071:3187:7b80:8c50:6abb:d968:489b]) by m-r2.th.seeweb.it (Postfix) with ESMTPA id F3D3E3EED3; Fri, 20 Jan 2023 17:30:38 +0100 (CET) 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 Message-Id: <20230120163035.3411051-1-roberto.foglietta@linuxteam.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TUID: 2vRQPfL2b5jY From: "Roberto A. Foglietta" 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 based on symlinks. Signed-off-by: Roberto A. Foglietta --- 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