From patchwork Thu May 11 10:50:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Mikanovich X-Patchwork-Id: 2805 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Thu, 11 May 2023 12:50:44 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-qk1-f184.google.com (mail-qk1-f184.google.com [209.85.222.184]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 34BAohQM011906 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 May 2023 12:50:44 +0200 Received: by mail-qk1-f184.google.com with SMTP id af79cd13be357-7578369dff3sf1652968785a.0; Thu, 11 May 2023 03:50:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1683802238; cv=pass; d=google.com; s=arc-20160816; b=GIogmr3VDCLesWHXZFKLih0xgu3cfSe8Vv7bYCaiTBoGtAqQyLAwAu/1v4LmxbRiTC CHhEnse/AtTcM2Yg/D/Prej4boVOGr3NbcgHVzz6hTkwI8LXOluXwgXk/ebTYjqq0W5G 034T4VibVI5S8kJHB0/riDfi0XmmQuT/mvbOA/BW0nJn4IYpu1IzI7ZB+mB1B8buTYx5 5221WczSQtdYpY32T7ZTxp1Gb53hT3slsghOrSBg8LWqrEUTAO3cGOWxwB3K65SSsmBC NNMZPW0jG7oHKXHsPbqQAImOw/4y+nSWQHJxbZonjw6RRIORoIxlFsxjgDQzFx/hgorF nehg== 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:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=27/Cr5Rnjs3acfnbkKnQMcPIvXejbcVoGbFIOyAyLME=; b=S5OUuPNjNudWBLWsufh+tel3YTpsMV314JNDMcLJMgtUQYInmu4rl5zkML+XGZkgWR Nzx8JWTwKA9v9rqHhc4IfVHJaki5+Cm2rj9Qxo27DGs4FA2wmDVEvc3cL9qS4c4l88kQ KWzwNLeVZI52FVjl+QMt3/9TLr0s90Fz94VQQzeHW2hqzao560GOixauWxSFyi6pfBm7 ghV/rMQvnqEyJyrhxKpmXbJudaAWW3/D9PIOIKTw+VoISl8L6sDxalk2CqA0hf92dilm 3DK0tc4LC+h6mSxkexaoWCa54L4+AoC+quVoHa09/EQZ47JOTYr7LCSNLSoBzZaVql8l dtjg== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20221208; t=1683802238; x=1686394238; 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:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=27/Cr5Rnjs3acfnbkKnQMcPIvXejbcVoGbFIOyAyLME=; b=P9/CzikSqo2bZT3ShzEYl7hRjs7JuF1a+f8c3REnSKxORi9g/adAt3aKWbLn5fwD4+ o6QlsCJ3pYEsWBDUeFksBd1azWkHkACWDXHnwm99hyt/mn62TCYy7uwlYlwM46AnJIzZ 0/+w99HbeWaJG5eKy3tAQruu/WJKpKTjzENRf18W5C2CaPbYFimGdXSdAR3i6s+usTy/ U3LCgnQ+gyJPwYEMaugD+DUodcOoPn2A2M8u+gwpduI5Mw75n2EjPOByC7ZOZRimFMTR yj3zPqaJqpBoW4qz6SCRuwMCgnDJ+HWWNUShe0UnEcoTFohlYgVzZ1ZyZ1/EEFPqrBUc T4SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683802238; x=1686394238; 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 :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=27/Cr5Rnjs3acfnbkKnQMcPIvXejbcVoGbFIOyAyLME=; b=f2kPbq/2fAxKZ4/iILAkwMaP2gciiYIAHpxb1HAVpGuEWEUxjQiMzbGUokRDlgtdJm f6R045H29dq+VWl7SbYeFHdhJTV0rHsrCzk/CulV2cNKVAlQa4kQlRVNQJCow7SgybUH hnRlF6Ocm3657XMov2Gayp/ahKIANijEM1zSaA16Q95CZOGBlfsr/o4urgGM9+7lrYcZ 9qG7cM8EsSCht+1Aclt/H+hMKcavAcNarjWE/W0QtxKYaqwUd09Vxy9kAFKmsU1fKECk s0CKBcJZPFMIB7zKnAfZM8TUwygoTqISIi3Fel4jGqu0YQ8ssjhQCJOs8hZ/0LUjhSSm 3n7A== Sender: isar-users@googlegroups.com X-Gm-Message-State: AC+VfDzG1quGIMPqN5Fgjuzv5Dzt11rq25LhP3LfTbmO219ZzFa10vJY dTnV4OzW1NNbk0LScQ8Fl4c7NQ== X-Google-Smtp-Source: ACHHUZ43RBp/qsK9K4/aGA5Vag0F4vNXqHP/zTxfNdpdO3+JrHxyOS4xUV+P5Dg7wD6T+TO96rI3DQ== X-Received: by 2002:a05:622a:1e08:b0:3f3:86c7:87aa with SMTP id br8-20020a05622a1e0800b003f386c787aamr4349205qtb.2.1683802238051; Thu, 11 May 2023 03:50:38 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ad4:5907:0:b0:61a:86aa:41cb with SMTP id ez7-20020ad45907000000b0061a86aa41cbls17312813qvb.9.-pod-prod-gmail; Thu, 11 May 2023 03:50:37 -0700 (PDT) X-Received: by 2002:a05:6214:21aa:b0:61b:5b9f:f5fd with SMTP id t10-20020a05621421aa00b0061b5b9ff5fdmr25668296qvc.41.1683802237600; Thu, 11 May 2023 03:50:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683802237; cv=none; d=google.com; s=arc-20160816; b=Y0UFZDowdXQzclKike0xUSKnD/Uj2+hPnJzGTJ7gEFL3h5Yd/qUUX1XrMuLo7CL2Jq +K6wSwVSFN/bVJ7rCVzsLuY6OjyKfCxaT1vXzNvOG8XYzvDNWMY5nrA98eQjAjH1/XpZ cLLqHyuM3SA72Jj+KRzjH87wv1+9cL00DCULhwuK7HdJIG6ipSupQt/YF2o1d3BMYM9L IGFHSVEMzWWIzXRyudFYKvy1NzH6jNeHY4iQcBVbCrQ3PjRx0G3Htse9CWTC/fuSggBA BzvOk3GVCr1f/855ZzTqMGwtw8V4czqWbug+ZM7USTeyUnqagj2AfNbXkbPvPgptIGbI 4NHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=IhW2EXP85akoPQxK92nzuHvT9dWTr4UO7B7jVQtSvfM=; b=oWKag5951bd7wm5zOa3ls+jmyTMxECABJdtdySdNzigAq6JaLgK6Oc4vq5HoP+4zhf akIVKEf1YhQYwd+r2l4FNJs4gOK8a+FyCN4a1FOLPybRoYpt20RzTF70gtu5I8y/WbS7 L7tcG1IxJMLF1sD2c8VTS/AG0ugUcblA6oEhZDJ3Ry0GGhuq7bm/FK+dIBg4qe69uT+X fHi7saRqIPoiAdnr+O3HxnrAnRtdbf9wi+ZP947x7/cemOqgGNZAf9IAeemEpPN+oJnF kf24NPIMbJQBpFdxMnn6Ic6ko6omFCxH93ZLxsT/TDtngXH8oIiadsuMUfVBOvqC35nm O1JQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id ep13-20020a05621418ed00b0061b730f2f42si580027qvb.0.2023.05.11.03.50.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 May 2023 03:50:37 -0700 (PDT) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Received: from user-B660.. ([85.254.75.115]) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPSA id 34BAoQ04011851 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 May 2023 12:50:31 +0200 From: Anton Mikanovich To: isar-users@googlegroups.com Cc: Anton Mikanovich Subject: [PATCH v4 4/7] imager: Split imager deps between image types Date: Thu, 11 May 2023 13:50:17 +0300 Message-Id: <20230511105020.1881496-5-amikan@ilbers.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230511105020.1881496-1-amikan@ilbers.de> References: <20230511105020.1881496-1-amikan@ilbers.de> MIME-Version: 1.0 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-Original-Sender: amikan@ilbers.de X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= To reduce dependencies install time and disk space consumption we need to install only those imager dependencies which used in every image type prepare logic. So split variables between tasks. Signed-off-by: Anton Mikanovich --- meta/classes/image-tools-extension.bbclass | 10 ++++++---- meta/classes/image.bbclass | 8 ++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/meta/classes/image-tools-extension.bbclass b/meta/classes/image-tools-extension.bbclass index 04ed1f84..58799fcf 100644 --- a/meta/classes/image-tools-extension.bbclass +++ b/meta/classes/image-tools-extension.bbclass @@ -15,6 +15,8 @@ SCHROOT_MOUNTS = "${WORKDIR}:${PP_WORK} ${IMAGE_ROOTFS}:${PP_ROOTFS} ${DEPLOY_DI SCHROOT_MOUNTS += "${REPO_ISAR_DIR}/${DISTRO}:/isar-apt" imager_run() { + local_install="${@(d.getVar("INSTALL_%s" % d.getVar("BB_CURRENTTASK")) or '').strip()}" + schroot_create_configs insert_mounts @@ -34,8 +36,8 @@ imager_run() { trap 'exit 1' INT HUP QUIT TERM ALRM USR1 trap 'imager_cleanup' EXIT - if [ -n "${@d.getVar("IMAGER_INSTALL").strip()}" ]; then - echo "Installing deps: ${IMAGER_INSTALL}" + if [ -n "${local_install}" ]; then + echo "Installing imager deps: ${local_install}" distro="${BASE_DISTRO}-${BASE_DISTRO_CODENAME}" if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then @@ -64,13 +66,13 @@ EOF" -o APT::Get::List-Cleanup='0' apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y \ --allow-unauthenticated --allow-downgrades --download-only install \ - ${IMAGER_INSTALL}" + ${local_install}" deb_dl_dir_export ${schroot_dir} ${distro} schroot -r -c ${session_id} -d / -u root -- sh -c " \ apt-get -o Debug::pkgProblemResolver=yes --no-install-recommends -y \ --allow-unauthenticated --allow-downgrades install \ - ${IMAGER_INSTALL}" + ${local_install}" fi schroot -r -c ${session_id} "$@" diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 42e4b0c9..b9d3d411 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -208,6 +208,8 @@ python() { imager_build_deps = set() conversion_install = set() for bt in basetypes: + local_imager_install = set() + local_conversion_install = set() vardeps = set() cmds = [] bt_clean = bt.replace('-', '_').replace('.', '_') @@ -231,6 +233,7 @@ python() { # imager install for dep in (d.getVar('IMAGER_INSTALL:' + bt_clean) or '').split(): imager_install.add(dep) + local_imager_install.add(dep) for dep in (d.getVar('IMAGER_BUILD_DEPS:' + bt_clean) or '').split(): imager_build_deps.add(dep) @@ -273,6 +276,7 @@ python() { vardeps.add('CONVERSION_CMD:' + c) for dep in (localdata.getVar('CONVERSION_DEPS:' + c) or '').split(): conversion_install.add(dep) + local_conversion_install.add(dep) # remove temporary image files if t not in image_types: rm_images.add(localdata.expand('${IMAGE_FILE_HOST}')) @@ -305,6 +309,10 @@ python() { d.appendVarFlag(task, 'depends', task_deps) bb.build.addtask(task, 'do_image', after, d) + # set per type imager dependencies + d.setVar('INSTALL_image_%s' % bt_clean, d.getVar('IMAGER_INSTALL')) + d.appendVar('INSTALL_image_%s' % bt_clean, ' ' + ' '.join(sorted(local_imager_install | local_conversion_install))) + d.appendVar('IMAGER_INSTALL', ' ' + ' '.join(sorted(imager_install | conversion_install))) d.appendVar('IMAGER_BUILD_DEPS', ' ' + ' '.join(sorted(imager_build_deps))) }