From patchwork Fri Mar 7 12:25:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "srinuvasan.a" X-Patchwork-Id: 4081 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Fri, 07 Mar 2025 13:26:07 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-qv1-f64.google.com (mail-qv1-f64.google.com [209.85.219.64]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 527CQ5Sq027310 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 7 Mar 2025 13:26:06 +0100 Received: by mail-qv1-f64.google.com with SMTP id 6a1803df08f44-6e905e89798sf2912226d6.3 for ; Fri, 07 Mar 2025 04:26:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1741350360; cv=pass; d=google.com; s=arc-20240605; b=IM29aYXLCY2gn0MFDncymceAAEB4QrwX7b3LNRQeeuYOix+IQTfOdQaax23j9AAqiN m6KnIth9sYyNgKyXFCL7CQ18+dbZSwzVWZerRPYqrU5ezkXJJchHXGCu4AKXBGzCSZPF ppEE4lnlbbnYXWZHc5+D5QJ7t6arQefyVgrjp6eDlMYrG9SBRiKod3ZWlK124lAjFAL7 ibQdqMzmhQ50whAy3gEcZp+Xor18J+SN0ay74LwLs8iwnq84Bu2sw/yQeq929DqHHXow 8v/MJDNoZ6K+FTm4CkaBvHNDrL22/J7EPjDoDnl5n8I9fgL4UP7sf99xnlnuHBdBWNk/ 7J+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to:feedback-id:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=82bCNShw3ri91wwptCqulCCcjcCV98mQyueQATxzK/s=; fh=z5mQ+IN26I1+2G22ZgtzJsMixuHeSa040l5XVZpoNhc=; b=BfNWhALuqfeJAfmkD2x0WoahKwexD+S7Zj924YnRZUnYZ+/cKI652AnL4KAzvwI5YY D0Wk0UG7ANahB/HZgLk5JhJzmGvgG66+SKxfG9dFEgogf8e0gyRtI4eTUDB5pgFYpmTV 6A1cLQQKGZo61uDl00CEfuJRFT70UjhGMo5GkJm1NMIpe86G7lShmhxyAT7AJ8CcVZHz wqet0Dr1+u8VrfEHo+052yp7NO3qVZuxCRtAf+VNaixqSuvSaNR8U23ZrP3M3pcfELn9 EIeTgfog00RlaiYhMLBOXJX1DerDLlMk45m7qY5u7Par4456Y2V6+mTEAtYIbYYvYXkB GX0g==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QBVsUFB5; spf=pass (google.com: domain of fm-1324425-202503071225547f4c9078926c63892a-wtwlnb@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1324425-202503071225547f4c9078926c63892a-WTWlNb@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1741350360; x=1741955160; darn=isar-build.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=82bCNShw3ri91wwptCqulCCcjcCV98mQyueQATxzK/s=; b=eMcFR4X8G42Y32KldKy+1rIiOYdu9LMoMy4bD1bfHZI2aycFE9NPZfgShEVI+mFFZ+ zg+CG9trj5ekcyh1PLP6ePYPScYyOCCRwlbm4T52W8lbGA7XU2gcMwViOXUT6p/O/nix vfKFdRD+2qldtHx2V37cS+LK/ZKdAZuvU8mK5S8RjX4CrMSx6ihi8jj78ofddZaFLEuE ueS5ys/J+y1g6Nz7NxC/IgIC+WJqVgRL77r2WP1r6Xa0aOiCJrPpGNj+Vcr794/hrQTs omMV3vBZYwTn5tzkvKVrtyaNTO9m/WlPL9EgMiu9IzuDSxDAXS6VQlyi6JxDl0XGXq/K zTUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741350360; x=1741955160; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence:reply-to :x-original-authentication-results:x-original-sender:feedback-id :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-beenthere:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=82bCNShw3ri91wwptCqulCCcjcCV98mQyueQATxzK/s=; b=THyen+KoUzHlToiuu8Qzx8j5nuL4GEYF2q4fhJifBb8n06ppqDjsSTUz2n+FfKIQVF OkTIa8kq5+mdWR+L/iYuK8CZI2TPGfGp9PFco29PolpQtRkC7y8EuaG3GmXgPA955kBV KoDQQbJEA6ux7U2Dz2ojtiHhD6W8vUAeN6ONyq+EMJezDXc48pmpuUh/rxh3jmgKNTXm E8G5jG8oR3ru/h491NU6oaBtXWoJPRZTqoy+9Orvaiz1Q6wwIJFshDla5Au5ETkvF4rp NaT5QwG95hx1c7SM8THByvdfsoedEmCkKLTmE7eab3pIgbF9ctFc1YKmwdU+REE7blUQ ItxQ== X-Forwarded-Encrypted: i=2; AJvYcCXnCpx3mK24+BKPCbPkP4Dlqa96SBswIBWQx66/o5kTXcHp/cf647V5quJlKyBDsr7mfCscD9g=@isar-build.org X-Gm-Message-State: AOJu0YwvrROWVE3apFQ/WWtbwCeIQ8/W8GyoavRGT8BqUCY71NShYwUw 6Lbw+o/2owDJJB9a8IoHSm064cPlKcBwhM+KbKwgbCtZsPK4g8rw X-Google-Smtp-Source: AGHT+IFDIZzjkVjUbMbgPuqd8E/NY+rz1Bhxy2Upok24gnBSz4FSHbOHrxKeYimuFdPattrlMIzHeg== X-Received: by 2002:a05:6214:d49:b0:6e8:9866:7398 with SMTP id 6a1803df08f44-6e900605653mr37920726d6.22.1741350359903; Fri, 07 Mar 2025 04:25:59 -0800 (PST) X-BeenThere: isar-users@googlegroups.com; h=Adn5yVGOjfCY9+fkpukbgKKev+tWmVc0XtsJ3Jd0YBK3q4FtGQ== Received: by 2002:a0c:ec50:0:b0:6e8:efc0:7a3f with SMTP id 6a1803df08f44-6e8f4ef3894ls10819436d6.2.-pod-prod-03-us; Fri, 07 Mar 2025 04:25:59 -0800 (PST) X-Received: by 2002:a05:6122:790:b0:520:4539:4b4c with SMTP id 71dfb90a1353d-523e42a5b5dmr2026143e0c.9.1741350359097; Fri, 07 Mar 2025 04:25:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1741350359; cv=none; d=google.com; s=arc-20240605; b=KYgwXseWpwPL8bRon+/2xz/6bcpnXknju24VQlzdkrvp77O34ka0AiJ1SFKMGoeEEj /yyZKzTyS4724giyqWUk5vg8ZEFRPlYgsWRwEzeYjmvXFV0AbSIKARn0xhJz8UES31+v CKqpFs3k9JbieQ8ifmxvG4oEkZ4CUU/YDeLEWHxCbvzkkTIfZ43Cy6sGUVtbZhjxZriQ KbhQbTxVU1gEkSRlFdf3udXj96AoU0HNdvmRu0O7l71xeCa0FKmacIunpF2xwz34Qdi3 nQDJOYFD715GQ7WZ5eaSD1/rbgTwqmpWB3dGygw1LR1/RuPs570QuxJjGGmXIeSR0NKv FsVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=6mJAo6oMTMsFwTlkLJvf4PHOVbL32AefFQju0RBLNqM=; fh=+knGHaK73ds00pYLzNOS97UmwCobvOJfLZ+fkHD4JEI=; b=ZwHLJYiNReKgXc1kqLHY6DA6QFZsX7CDpA0Cs0dOHlm7gX0Nb3XYrbgJb+d4nEFLsm zsC2B5LuJSiNfGsTVRoxkkvWXOu727oNa6eJy/Z7ox4pVfmOxE1doqs0SsJKjhvx+H2H hPHSgaWT4c7UEyJ4CdlJd23BrPTg7Ngq3rTonJ7k7GGAI69FUurZLklkWdsQ213gMiq0 VRYT5jSEcebqkO09+yhGnFm6DtzbTyO6bHqbamsPtj6Y7hpQ/esW8AsL8NkrBiY+SRcq vEJieOga1AQ6JsE95slEHaAitg5i8LgoOk2PStRloOyto5bjvm30NkM6o9ZlPr8JkLH+ U1QQ==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QBVsUFB5; spf=pass (google.com: domain of fm-1324425-202503071225547f4c9078926c63892a-wtwlnb@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1324425-202503071225547f4c9078926c63892a-WTWlNb@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net. [185.136.64.226]) by gmr-mx.google.com with ESMTPS id 71dfb90a1353d-523d8a6c947si163950e0c.1.2025.03.07.04.25.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Mar 2025 04:25:59 -0800 (PST) Received-SPF: pass (google.com: domain of fm-1324425-202503071225547f4c9078926c63892a-wtwlnb@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) client-ip=185.136.64.226; Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 202503071225547f4c9078926c63892a for ; Fri, 07 Mar 2025 13:25:54 +0100 X-Patchwork-Original-From: "srinuvasan.a via isar-users" From: "srinuvasan.a" To: isar-users@googlegroups.com Cc: cedric.hombourger@siemens.com, jan.kiszka@siemens.com, ubely@ilbers.de, Adithya.Balakumar@toshiba-tsip.com, srinuvasan Subject: [PATCH v2 2/3] image: download deb-src packages after imager creation Date: Fri, 7 Mar 2025 17:55:57 +0530 Message-Id: <20250307122558.1882902-2-srinuvasan.a@siemens.com> In-Reply-To: <20250307122558.1882902-1-srinuvasan.a@siemens.com> References: <20250307122558.1882902-1-srinuvasan.a@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1324425:519-21489:flowmailer X-Original-Sender: srinuvasan.a@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=QBVsUFB5; spf=pass (google.com: domain of fm-1324425-202503071225547f4c9078926c63892a-wtwlnb@rts-flowmailer.siemens.com designates 185.136.64.226 as permitted sender) smtp.mailfrom=fm-1324425-202503071225547f4c9078926c63892a-WTWlNb@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: srinuvasan.a@siemens.com Reply-To: srinuvasan.a@siemens.com 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=-4.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,RCVD_IN_RP_CERTIFIED, RCVD_IN_RP_RNBL,RCVD_IN_RP_SAFE,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: srinuvasan With the present implementation, deb-src packages are missing for imager related deb packages (packages listed in IMAGER_INSTALL). Copy the /var/log/dpkg.log file from the sbuild environment to outside With that, use the list to download deb-src packages for IMAGER_INSTALL related deb packages. Presently, cache_deb_src function running as part of ROOTFS_POSTPROCESS_COMMAND, this will not be helpful to get the imager related deb-src packages, hence make cache_deb_src as a separate task and running always after do_image to get the imager deps related deb-src packages. Signed-off-by: srinuvasan --- meta/classes/image-tools-extension.bbclass | 19 +++++++++++++++++-- meta/classes/image.bbclass | 8 +++++++- meta/classes/rootfs.bbclass | 3 ++- 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/meta/classes/image-tools-extension.bbclass b/meta/classes/image-tools-extension.bbclass index e8ace8f5..0615229a 100644 --- a/meta/classes/image-tools-extension.bbclass +++ b/meta/classes/image-tools-extension.bbclass @@ -7,6 +7,9 @@ inherit sbuild +PP = "/home/builder/${PN}-${MACHINE}" +ext_root="${PP}/rootfs" + IMAGER_INSTALL ??= "" IMAGER_BUILD_DEPS ??= "" DEPENDS += "${IMAGER_BUILD_DEPS}" @@ -58,10 +61,17 @@ imager_run() { EOAPT deb_dl_dir_export ${schroot_dir} ${distro} - schroot -r -c ${session_id} -d / -u root -- sh -c " \ + export local_install=${local_install} + schroot -r -c ${session_id} -d / -u root -- /bin/bash <<"EOAPT" + rm -f /var/log/dpkg.log + pkg_status="$(dpkg-query --showformat='${binary:Package}\t' --show ${local_install} || echo "Not installed")" apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y \ --allow-unauthenticated --allow-downgrades install \ - ${local_install}" + ${local_install} + if echo "${pkg_status}" | grep "Not installed"; then + cp /var/log/dpkg.log ${ext_root}/dpkg_partial.log + fi +EOAPT fi schroot -r -c ${session_id} "$@" @@ -69,5 +79,10 @@ EOAPT schroot -e -c ${session_id} remove_mounts + schroot_delete_configs + + if [ -e ${WORKDIR}/rootfs/dpkg_partial.log ]; then + sbuild_dpkg_log_export "${WORKDIR}/rootfs/dpkg_partial.log" + fi } diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 56eca202..66b4d313 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -72,7 +72,13 @@ ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}" ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}" ROOTFS_PACKAGE_SUFFIX ?= "${PN}-${DISTRO}-${MACHINE}" -ROOTFS_POSTPROCESS_COMMAND:prepend = "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', 'cache_deb_src', '', d)} " +CACHE_DEB_SRC = "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', '1', '0', d)}" + +python () { + if bb.utils.to_boolean(d.getVar('CACHE_DEB_SRC')): + bb.build.addtask('do_cache_deb_src', 'do_deploy', 'do_image', d) +} + inherit rootfs inherit sdk diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index 2348e269..c9e832dc 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -272,7 +272,8 @@ python do_rootfs_install() { } addtask rootfs_install before do_rootfs_postprocess after do_unpack -cache_deb_src() { +do_cache_deb_src[network] = "${TASK_USE_SUDO}" +do_cache_deb_src() { if [ -e "${ROOTFSDIR}"/etc/resolv.conf ] || [ -h "${ROOTFSDIR}"/etc/resolv.conf ]; then sudo mv "${ROOTFSDIR}"/etc/resolv.conf "${ROOTFSDIR}"/etc/resolv.conf.isar