From patchwork Mon Feb 20 10:32:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Schmidt, Adriaan" X-Patchwork-Id: 2668 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Mon, 20 Feb 2023 11:32:28 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-wm1-f61.google.com (mail-wm1-f61.google.com [209.85.128.61]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 31KAWSlG002496 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 20 Feb 2023 11:32:28 +0100 Received: by mail-wm1-f61.google.com with SMTP id j6-20020a05600c1c0600b003e1f2de4b2bsf413454wms.6; Mon, 20 Feb 2023 02:32:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1676889142; cv=pass; d=google.com; s=arc-20160816; b=Qky6wLRINKqGQ7Iu8C2YZgazpDYKZabsa5uAQuQOcN7d7mM5DA/b5+wx2ESnhhPnrs 5lPl1TuxFhUMPCHysoMJFyxsKmEqvyBSiGdyUm1ZhHyBg2rPxggcDpX/m4BmSGEfVzpU yw5280nbdXlF/iRDlVspJtEn/VYPAZEXgCjEdrmJdzjJQqOzw0vKrDO+3eQTDVggrfY5 ZkohiFNVvG8UqyH61Myf3d2UPGk+PLh77Ha2BC6Pa3NbhfkR5jUDxypVYEcflV8Td2RD wi2cfkt5jEaLh1BEaVC4uyW7chlrgGFsnv4qOhxqAetT+P2G4rid0K7kPMlZx4njqzIO CwTA== 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:feedback-id:mime-version:message-id :date:subject:cc:to:from:sender:dkim-signature; bh=WmVjIdW35dK9bB6tFeTS416185D/suQIJnZXXBFZwl0=; b=Vp0HbpEUDzILOXubDUvmyH0DsgqTwyosAZrIjPoegpOnzaWvf395jY8n2m8EOcjDa9 NB+4KapbsncPVJZCr0OPtzNfWpqxdNuyxqKvhOLesJqO9qppO92pjD2puQUXiCrkM+qM ka3rTQFG27nDcjlllLdwn4l0yiRP3ZLU/NMjZrkuv2ou4903pfH6byKzHk+CHob5p0Rh vHf6RqXF+tee6IL3b9M66bU63POGdECAlNMjSrrM0o2H/mrJ1lGWgd8eZ892Xrhv8AP0 IClhzso6gvVfFhEzaJ2yH9vofZo4SaJutRljXw8Ac4FumcwSyddMaUD2cKYhu8GnD2C4 psCg== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=c5ugebbc; spf=pass (google.com: domain of fm-526363-20230220103220b141042ad093755331-h0vrtz@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-526363-20230220103220b141042ad093755331-H0VrtZ@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com 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:feedback-id:mime-version:message-id:date:subject :cc:to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=WmVjIdW35dK9bB6tFeTS416185D/suQIJnZXXBFZwl0=; b=hqIOjLjTsXhHlYTuQTeYnpqL4bJGAC9ZTY+spH9T1G51jZpOj6rjRqOYEinvJUwzv9 H1PoNnS7Us8Movkqtkc0Q2yAGYVOUQSRBjBbw2jTrChrb7PsxtVm7prmP9pU0ffhfwFU 4ovpUBFvkO+HCpbNfUXvwPIUvpZAMbJ6LsGKChJlLGaVmvSMEs9SSTOrnpDjP6cuZ85b vhzC1zyUHrD660ch2gvjdLK3PSpPEr3yqfY+eI9Himfulc2cN1Z49sQ4FD0AqhsZp61a VewJs2hTpM5/GeRrJumIdoJsmmdPB65iY4NzP4k+1CUcZozNO97BqYWtQL0CEDaeZhuw +r+Q== 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:feedback-id :mime-version:message-id:date:subject:cc:to:from:x-gm-message-state :sender:from:to:cc:subject:date:message-id:reply-to; bh=WmVjIdW35dK9bB6tFeTS416185D/suQIJnZXXBFZwl0=; b=xRcMqc1MV2kl+PmkcZHDYpaCawFg72WMlv3m7j5Ouhuhq9QWty7qvMsXsvDIc9o34G LqAAFPN1WjcFtpTdqHbnLbUdKPrr0pUATbuf6VIjv5xJNcDeTkgiXlEKmIAD+VyYsSYd ihUxQDGdZMUAk/qL4tcV/4msFy7gJv3+9WKZli5eyaB5nmIa7uCakh7Y0gYrDlsDB6+P tjOnh3hFgtfNSjlEtAw6ndhw9wUAci9hxAp/9FcIWt6Mvb0UOa0l+yc5eKorj18nwWaV ImHMi/BOgfAyi4F2hANhUItOUZhvDgn20VE1fOvHCYa+LvIzLSHY+5Ab+Wy/KV+1prhj 39Bg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AO0yUKV6hh3HX17RJed+Qk2wTa7O8RhPO9zkAQuP5qJW1ykoX2coXwL0 VFXVWYd/hMRewySGD3UdxWA= X-Google-Smtp-Source: AK7set/Ba4YdzkoWX0yIIbFkluh23wSRDwm/UMhNfswTSxhA/wzE0G86YL5N/hsDfHllHrkz1M6PmQ== X-Received: by 2002:a5d:522e:0:b0:2c5:4f4c:f20b with SMTP id i14-20020a5d522e000000b002c54f4cf20bmr75713wra.151.1676889142277; Mon, 20 Feb 2023 02:32:22 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:600c:1e0e:b0:3cf:72dc:df8 with SMTP id ay14-20020a05600c1e0e00b003cf72dc0df8ls353898wmb.0.-pod-canary-gmail; Mon, 20 Feb 2023 02:32:20 -0800 (PST) X-Received: by 2002:a05:600c:3298:b0:3dc:5674:66e6 with SMTP id t24-20020a05600c329800b003dc567466e6mr33870wmp.25.1676889140910; Mon, 20 Feb 2023 02:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676889140; cv=none; d=google.com; s=arc-20160816; b=LgpeuBPag3JLDZgVuhBqKBGA4r6da8JkrVKq6DQlO7pkfGRt15x6c175TqLd3BFoUN I6V/OR0dBBVN/Ll7ZdSa3UGNvezr3lSwjoMrepEsur1AQ9iPySxQgv+ipEqxfcKg0/E5 o5UHjSdUDmIDs4koFadInRDTkp5AKtvnZYyv2aGolGgy8Opfvl79p5UGLq8ieojpQHso GiXDeEv/x+oQIWOvs9lUzrQoBdZKYHR97RP+bC5B62i52ft+yye5mH5kZw6gxhCcptFd BVAfoR/SNx4w4VxYza/5uApU54KE/DJ3D0/zNwz8tPVcc7fYUmzu0zFvtOmFLafvODrh uA3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:message-id:date :subject:cc:to:from:dkim-signature; bh=/KrHuvL9Q1kbo5W05gt1AXsJPvVkuG9ohfNMfBTDE90=; b=0wPTz7UzH/LPbNx5vzYZX0M5sUBIE+Qf91rS+pXENskhUG+eDceb4uhAgcymK+DtET 3f64SuiJp65kvIcBa+lX92rH5rOxBWvLAosvqJxj9m1hp2kHAgMJxxEEh8BJIfJkpARk RhrXxTlRMEf7Tk9BB4g4ZCCNw34auuOkxK9tANje4Jm4hSfGJu8DgTEJ47cZUMBXb6Gy ++yt56KrJlInCnFBhaCqCoIUVIOd1yeLxU2f+ne854YpxZJQnrIIJA5yB5xE7Fp7PlPR uNch5q19mZQETlqxrWzAjR6JgFR92de9M/BKy52Lx6OSVcyPAP9pR1pHpQdNu0Is26g4 GLLg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=c5ugebbc; spf=pass (google.com: domain of fm-526363-20230220103220b141042ad093755331-h0vrtz@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-526363-20230220103220b141042ad093755331-H0VrtZ@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mta-64-228.siemens.flowmailer.net (mta-64-228.siemens.flowmailer.net. [185.136.64.228]) by gmr-mx.google.com with ESMTPS id az22-20020a05600c601600b003db110e1928si22721wmb.1.2023.02.20.02.32.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Feb 2023 02:32:20 -0800 (PST) Received-SPF: pass (google.com: domain of fm-526363-20230220103220b141042ad093755331-h0vrtz@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) client-ip=185.136.64.228; Received: by mta-64-228.siemens.flowmailer.net with ESMTPSA id 20230220103220b141042ad093755331 for ; Mon, 20 Feb 2023 11:32:20 +0100 From: Adriaan Schmidt To: isar-users@googlegroups.com Cc: Adriaan Schmidt Subject: [PATCH] add support for rebuilding essential packages Date: Mon, 20 Feb 2023 11:32:14 +0100 Message-Id: <20230220103214.2704911-1-adriaan.schmidt@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-526363:519-21489:flowmailer X-Original-Sender: adriaan.schmidt@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=c5ugebbc; spf=pass (google.com: domain of fm-526363-20230220103220b141042ad093755331-h0vrtz@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-526363-20230220103220b141042ad093755331-H0VrtZ@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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=-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?= There are cases when we need to rebuild a package that is installed during bootstrap (we call those "essential package" here). This patch introduces `ISAR_REBUILD_ESSENTIAL_PKGS` which can be set in (distro/layer) config, and lists all essential packages. During build, Isar ensures that essential packages are built before any others, so that their locally built versions are available in isar-apt, and will be used in any subsequent package builds. Signed-off-by: Adriaan Schmidt Signed-off-by: Adriaan Schmidt --- This has interdependencies with the proposed multiarch feature, and builds on v2 of that series. Adriaan --- meta/classes/dpkg-base.bbclass | 1 + meta/classes/essential.bbclass | 39 ++++++++++++++++++++++++++++++++++ meta/classes/image.bbclass | 1 + 3 files changed, 41 insertions(+) create mode 100644 meta/classes/essential.bbclass diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass index 55cc6655..ce301346 100644 --- a/meta/classes/dpkg-base.bbclass +++ b/meta/classes/dpkg-base.bbclass @@ -10,6 +10,7 @@ inherit debianize inherit terminal inherit repository inherit deb-dl-dir +inherit essential DEPENDS ?= "" RPROVIDES ?= "${PROVIDES}" diff --git a/meta/classes/essential.bbclass b/meta/classes/essential.bbclass new file mode 100644 index 00000000..cb444674 --- /dev/null +++ b/meta/classes/essential.bbclass @@ -0,0 +1,39 @@ +# This software is a part of ISAR. +# Copyright (C) 2023 Siemens AG + +ISAR_REBUILD_ESSENTIAL_PKGS ?= "" + +python() { + isar_rebuild_essential_pkgs = (d.getVar('ISAR_REBUILD_ESSENTIAL_PKGS', True) or '').split() + build_compat = d.getVar('ISAR_ENABLE_COMPAT_ARCH', True) == "1" + build_native = not d.getVar('DISTRO_ARCH', True) == d.getVar('HOST_ARCH') + + # construct list of essential packages that should be rebuilt: + # if we can't build compat, don't include any -compat packages + # if we don't need native (because DISTRO_ARCH == HOST_ARCH), don't build native + # otherwise, automatically include compat/native when we can build them + essential_packages = [] + for p in isar_rebuild_essential_pkgs: + if p.endswith('-compat') and build_compat: + essential_packages.append(p) + elif p.endswith('-native') and build_native: + essential_packages.append(p) + else: + essential_packages.append(p) + if build_compat: + essential_packages.append(f'{p}-compat') + if build_native: + essential_packages.append(f'{p}-native') + + # bail out if this recipe is in the essential list + if d.getVar('PN') in essential_packages: + return + + # add dependencies to all packages from the essential list + for p in essential_packages: + if d.getVar('do_prepare_build'): + d.appendVarFlag('do_prepare_build', 'depends', f' {p}:do_deploy_deb') + if d.getVar('do_install_rootfs'): + d.appendVarFlag('do_install_rootfs', 'depends', f' {p}:do_deploy_deb') +} + diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index ce7c549c..550785ea 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -80,6 +80,7 @@ image_do_mounts() { } inherit multiarch +inherit essential ROOTFSDIR = "${IMAGE_ROOTFS}" ROOTFS_FEATURES += "clean-package-cache clean-pycache generate-manifest export-dpkg-status clean-log-files clean-debconf-cache"