From patchwork Fri Jan 20 16:30:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: roberto.foglietta@linuxteam.org X-Patchwork-Id: 2511 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 20 Jan 2023 17:30:47 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lj1-f189.google.com (mail-lj1-f189.google.com [209.85.208.189]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 30KGUlWK003843 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Jan 2023 17:30:47 +0100 Received: by mail-lj1-f189.google.com with SMTP id a22-20020a2eb176000000b0028badf8df0dsf1218142ljm.22; Fri, 20 Jan 2023 08:30:47 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1674232241; cv=pass; d=google.com; s=arc-20160816; b=CgtPw3LQXep6DO28d2wGUL5MXmeVCH4/qI8REv8Ae0aXgLvAGFvJKDPEObL2pVmsuf 9V3LdyVhMFdB90iYPl9XTx6p0cP6JvTuRczeZrTefNHDD3kpgP5CHLUfpUzdcrc56Kgm wrJ6zzklkXoD6tFlEelkg39n2tHEOi6FltlPfCmV9eCZskV0y21VxTqjkkKA6nCQ/fYb lqxAniGAZ+wLY8Rb1YvZEMGZXfBgKbuNLDiHJBiKrRq8fqKV/wepGuI+aXTcldtK7pXS deqwHzNcWhtnYJMtIO9/h24sl83ZBoMM2F0XUO+YXG/lDetX7ShflwJ3HCfLhJPO3E3p bSkA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:message-id:date :subject:cc:to:from:sender:dkim-signature; bh=BpFxhhHGqyUysPi3IVdpOcoKSNY3Jpyf6t9BI02YQIY=; b=iIFMkxHya52CEZBuYgh05DLI2TCf/1kzWPebyx+IxcBl0O3CL0YABXu1oadykZYwi8 zRdR5XfOQtUaYXUyQIK9loJpaHha0D12I3mxxdDZrlpHZlHWmr2496VMbKPTwQn8SWbw ygsum11lnxP6Vj6Afe5ycobK66DFDcIWCyyUlgp+wnYgUbu8O6BmC2AkYS/+ICpeclA9 ImgpHAenS2h5Zct0oQZR/QaDtZ4/85043YZOrdkm0tWG+0wEFRC/ZjjLucFF6FSqaMsB MBvL5A1JA/A5s6LWghu7exKZOK45hYAXfZVUCYhsnkxUacz8sb88QZdA+u6VUZHfZQx0 f3sA== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:message-id:date:subject:cc:to:from :sender:from:to:cc:subject:date:message-id:reply-to; bh=BpFxhhHGqyUysPi3IVdpOcoKSNY3Jpyf6t9BI02YQIY=; b=aR1+MmT3IIU0Nzfv+1nYQV96usOZze5c+HxghO6jgcqaetPHcidfd1W4B9UBxVSrkM pEcra294D3jgb8GwOboU6kLq+p8aczCS0SbZisPcWEQf5v8WMpQyML06EaWTy5NR36/9 qEkFTyAiHxjRu/3EwVzPcvWu5RvHCMCDNSpCEErqgY0TVslMQ84zz+N7GPv7qGwi5fYH i8mmjxfIAVRJsOKdOluPkiUZp5HYwfHntXM1HAd+iHSn1R/BRD3YvMqrHNjF1DygTIOa /m1wk8CgAvsWdlzdbMnTop0dG7tjl+U3mXmS+IWz0skP9yRuMRikwFVYBxGV1CrsU+Ah 4eWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :message-id:date:subject:cc:to:from:x-gm-message-state:sender:from :to:cc:subject:date:message-id:reply-to; bh=BpFxhhHGqyUysPi3IVdpOcoKSNY3Jpyf6t9BI02YQIY=; b=C4uV3nXTEcAeMUletGcdTV63ojPWq5Ckf42t6ydxWp0rfxQqaR8l9Qql4GZVRB+7Pt gqWkSd2f8wgrtmA21+PhjlivlCQKw3y+y2qrmFJceHXSMQS1wbEQOdVWJxs5UwDVntlT UJZpxtDeZYVUlCvhKDg91FvlO9tzVSe6UQJFhtwLA7rIl3caL/z8xYUmvoa8ieHyHAzU NAWRDsrlFvJ2h9OhfiqbKXF1096q8VPxeNq0DJDb5ocRRNLsprJD3J/fgXEbTtLrP3Yk rwJSKXRv1VG6c8qqSiBwk1xLQUH/55t76TYngzM32ipypLhJozGBIUM2evKhaxX9+6W0 2cGA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AFqh2kodUD/ju/ywAqnGmGn5OW6Z77NHEaA3FMGei7dbI8zchZVq0zYM 21Wsn1frScwew61ov2ArpVo= X-Google-Smtp-Source: AMrXdXs0nRW4WL5NoAgDTkRUwv2HkTtwoWi5czQS30UtFPwNiXOIv1F7ZTv2X48iLzZ8ETm7Qj4kzQ== X-Received: by 2002:a05:651c:124b:b0:28b:7727:c184 with SMTP id h11-20020a05651c124b00b0028b7727c184mr880262ljh.345.1674232241422; 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-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 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; 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 X-Original-Sender: roberto.foglietta@linuxteam.org X-Original-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 Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= 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}