From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6899501277566205952 X-Received: by 2002:a62:2cc1:0:b029:18c:85f5:864b with SMTP id s184-20020a622cc10000b029018c85f5864bmr3602953pfs.29.1606415416676; Thu, 26 Nov 2020 10:30:16 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:c113:: with SMTP id 19ls1323214pli.11.gmail; Thu, 26 Nov 2020 10:30:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxyA03YLEGuiYEmfZft/IeIFH4vrK+9HxTLeJVyBcbxSnExd8PjFO4QpJt8AwWVCFeKiBDu X-Received: by 2002:a17:90a:4889:: with SMTP id b9mr4904467pjh.79.1606415415820; Thu, 26 Nov 2020 10:30:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606415415; cv=none; d=google.com; s=arc-20160816; b=JKJK65onOhpVGsr1O3AiRrgTs9sLVvS8ZF2HFsAgBI4b0UGrTqmy+djT7LjrS9VVcg xsQ6z7JEOmEecmDlJyvQ/qfxGJDyXL4VQF8uuqoDohblXn6C6V3Acix//7P2ue10tMkh l6RobwNCHgsiDwJbvPTNM3dIQ+CdlK3OyfMTX0n4IxOKev6GMjjHAO8RR1fvv6dUUeaV ygXe4unrPbuc9YA9S6Eds9gCt03huFUuPMc8HxQCm9hlhA5DpCPCfnBBojb9v27hlBJP IOVfJVkJqKZZCuVD2INoWl1RI3KJwfs9wcH7A+Lp1G6vN/zR2qpqhjyis/sJ5eQGqJQ7 KXcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:ironport-sdr:ironport-sdr; bh=zCM60qn8bOqoKIkeGM61WLPPGgFfAXgOTi4N8UHL+9s=; b=K2BEsARPoYGMJ7TxMbPlf2zKCetW1oXSpyiTq2aZcr7H40No0DT3Va/VIx8eWUuIcK MQhf6AT4qMGr8LQpnn+PqMwQaJnBkbmJ76KV7a/26DTda6tV2MWPjvHYHtME23m8kYiG q6SfvgXmh+wxH/fxoDQ17VGlX2Wx49x7Jf5f78dkCGFhDQoeLAC4dR6nrbktx7ff+/sY h58/OzrA5aIkpxploTVGEvaAHnM3vfs5rehJWQSpC7F5nRkobWjZPlueUSLK8h608NJk yB5nCB6bSVCfjAuE4li02qBpIn7HN5/E8lIgmuU4i0BPHtdDx64dV8ht1HpjRNcnbaPn 7IVA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id s12si571207pjq.3.2020.11.26.10.30.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Nov 2020 10:30:15 -0800 (PST) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: qwIPVDMxeoDjdZEyt2aeXL/ExeqK+dMXrORxI/Mdajodp2JVS66G2nwYzem4zsV6CwykV22oZZ csjhSD0hReYwBgx2Vq9R3rnR7aQIq5MHTac0SG2HD1b4b5qXkFl6LdA6SfRW4zYdis7tqVltUb A9yCV0yiE35FTPkHjp5RkVkISuFddTNUvIKUlli1SpA6/RlAO5UNINOlaU2o7MeLm3SdtnA5Bk umlV6Wiju9XAL61s3GMCc4UjDXzX4KZkkYMgKwXtb2k8TyF+Gy/ikKVw94YUPbkFEUqrxLbWU6 Qd4= X-IronPort-AV: E=Sophos;i="5.78,372,1599552000"; d="scan'208";a="55536074" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 26 Nov 2020 10:30:14 -0800 IronPort-SDR: x/ppN3qpSQQHSLyXMIpXKtUfeaIkhnzWY7zvXomEjKSM0BU+nlLkEm7hqzyxIv/iTcoXoXdIQx JPe1PmzgnONWz4lpcYx4a032Xads8KZRHAiiT5ufQlHoMsigpaNqub+0QkX4Wv13dqa+wLvIJU SLZBzaCC8C2JVl0L0xEhIvPE5qRb77T9k/kOaPfdUUjDxxk/ds4bPBtZWLGmAMEL8GAduOB64E SROZK1jJ/ns5PF2+iQv4Qbl/VWOuDIxXjIurTXbfGLS2ecu/KfnOxzn3JU/2nOivPhnAHRNKRd f0c= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v10 09/14] base-apt: Introduce BASE_REPO_FEATURES Date: Thu, 26 Nov 2020 23:59:48 +0530 Message-ID: <20201126182953.7518-1-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201126182818.7261-9-Vijaikumar_Kanagarajan@mentor.com> References: <20201126182818.7261-9-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: AWsaO43JTQjJ Eventhough we are collecting the debsrcs as part of postprocess, it could not be considered a ROOTFS_FEATURE, instead a base-apt one. Introduce BASE_REPO_FEATURES, to provide user with control to enable or disable cache-deb-src. Disabled by default, since it is not required for normal offline build to work. Signed-off-by: Vijai Kumar K --- meta-isar/conf/local.conf.sample | 4 ++++ meta/classes/image.bbclass | 4 +++- meta/classes/repository.bbclass | 9 +++++---- meta/classes/rootfs.bbclass | 1 - meta/recipes-devtools/base-apt/base-apt.bb | 1 + 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample index 1db6b88..3e43572 100644 --- a/meta-isar/conf/local.conf.sample +++ b/meta-isar/conf/local.conf.sample @@ -181,6 +181,10 @@ ISAR_CROSS_COMPILE ?= "0" # NOTE: this works for amd64 and arm64 targets so far #ISAR_ENABLE_COMPAT_ARCH ?= "1" +# Uncomment this to enable caching of all source packages. +# Without this feature, only sources of packages downloaded with apt:// are downloaded. +#BASE_REPO_FEATURES ?= "cache-deb-src" + # # Uncomment this to enable use of cached base repository #ISAR_USE_CACHED_BASE_REPO ?= "1" diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 0cc31dd..74fc850 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -63,11 +63,13 @@ image_do_mounts() { } ROOTFSDIR = "${IMAGE_ROOTFS}" -ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-status cache-deb-src" +ROOTFS_FEATURES += "clean-package-cache generate-manifest export-dpkg-status" ROOTFS_PACKAGES += "${IMAGE_PREINSTALL} ${IMAGE_INSTALL}" ROOTFS_MANIFEST_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}" ROOTFS_DPKGSTATUS_DEPLOY_DIR ?= "${DEPLOY_DIR_IMAGE}" +ROOTFS_POSTPROCESS_COMMAND_prepend = "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', 'cache_deb_src', '', d)} " + inherit rootfs inherit image-sdk-extension inherit image-tools-extension diff --git a/meta/classes/repository.bbclass b/meta/classes/repository.bbclass index 7b6e47b..1f475dc 100644 --- a/meta/classes/repository.bbclass +++ b/meta/classes/repository.bbclass @@ -100,9 +100,10 @@ repo_contains_package() { repo_sanity_test() { local dir="$1" local dbdir="$2" - local output="$( reprepro -s -b "${dir}" --dbdir "${dbdir}" sourcemissing )" - if [ -n "${output}" ]; then - bbwarn "One or more sources are missing in base-apt" - bbwarn "${output}" + if [ "${@bb.utils.contains('BASE_REPO_FEATURES', 'cache-deb-src', 'yes', 'no', d)}" = "yes" ];then + local output="$( reprepro -s -b "${dir}" --dbdir "${dbdir}" sourcemissing )" + if [ -n "${output}" ]; then + bbfatal "One or more sources are missing in repo. ${output}" + fi fi } diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass index 23643ce..b589dbc 100644 --- a/meta/classes/rootfs.bbclass +++ b/meta/classes/rootfs.bbclass @@ -185,7 +185,6 @@ python do_rootfs_install() { } addtask rootfs_install before do_rootfs_postprocess after do_unpack -ROOTFS_POSTPROCESS_COMMAND += "${@bb.utils.contains('ROOTFS_FEATURES', 'cache-deb-src', 'cache_deb_src', '', d)}" cache_deb_src() { rootfs_install_resolvconf deb_dl_dir_import ${ROOTFSDIR} ${ROOTFS_DISTRO} diff --git a/meta/recipes-devtools/base-apt/base-apt.bb b/meta/recipes-devtools/base-apt/base-apt.bb index 8940ae8..506a28f 100644 --- a/meta/recipes-devtools/base-apt/base-apt.bb +++ b/meta/recipes-devtools/base-apt/base-apt.bb @@ -10,6 +10,7 @@ SRC_URI = "file://distributions.in" BASE_REPO_KEY ?= "" KEYFILES ?= "" +BASE_REPO_FEATURES ?= "" populate_base_apt() { find "${DEBDIR}"/"${DISTRO}" -name '*\.deb' | while read package; do -- 2.17.1