From patchwork Tue Mar 11 21:09:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "chris.larson" X-Patchwork-Id: 248 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Tue, 11 Mar 2025 22:09:56 +0100 X-Sieve: CMU Sieve 2.4 Received: from mail-lf1-f57.google.com (mail-lf1-f57.google.com [209.85.167.57]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 52BL9tbJ017053 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 11 Mar 2025 22:09:55 +0100 Received: by mail-lf1-f57.google.com with SMTP id 2adb3069b0e04-54995da5b1bsf118324e87.1 for ; Tue, 11 Mar 2025 14:09:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1741727390; cv=pass; d=google.com; s=arc-20240605; b=XRjDK44U118y4IEqAGlZfGOE4EfpRtCUDsVkWam8unBeBVY98xl/bZlPbkjqQYk9NE +SkjbUk+RXdvXpHJl228CzKaqUoteQHMQB6pXFLjQFdmYAFov3EG2OVLoL8Pho5rvFVi Gxg06zyXlKRbS+LJGvmm3+6aGezXpWMcneCZbJESJFfszDWAxl95i3kL4sJ6ra0pJRZv OEbShQRcCZGebvr74xTKrIZJoiDVUfn0MVNTVAk7ReDrTn0oyyNjHOI5g/ej/hol1F1B zVhGbrYfmXb4v++PiF6cTzKdy26n+3D5P/tmaKFEU+Llyn4eC8+AUFmKCxhKxm7MsFhQ DJcg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=+13+MRhG5rKw2PgUMPwSSQjX/tDr4a1iX83AQW12G/4=; fh=29vVOThMDYwTp8t7NCwFIeCZEx/wWi+dV+viPAIfS3s=; b=gW1WwxQTfbIMJtixXr4GEb+OfJC46FR5zWGfodQJGZNPjZq4tOC7ECTYXzgvIBSge+ Sk38lrhFmHhxRLUWWPCc7ZKQ2lFQH+zXxkHrWkAqK4S3My9tDjFmVYymE+WueWEgVxcM 888xfyM/4Xd30njiwWcljvePtQdjmBtubbXgMgY5yF72IRJyhXCPar9YII4Ln3+/Vu5C /NuA06DNsH/oTNJaJW0WmJLLrWU6cSJbeeQxxtcHAJdHLD90MigCE9s7sv4EydAAd98D fJXRMcP0L6z8REFi0UHW3coj/zpuq3nSKQal4MtLOBHZ0I1R4JyA8d6GjeZg1cJDc6dy //VQ==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="fC/i6fsO"; spf=pass (google.com: domain of fm-1325773-20250311210944894a70955c0e0a8b9a-knmcq_@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1325773-20250311210944894a70955c0e0a8b9a-KNmCQ_@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=1741727390; x=1742332190; 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:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=+13+MRhG5rKw2PgUMPwSSQjX/tDr4a1iX83AQW12G/4=; b=V2C9EL3IDpQhKTDpMjjzVSLqsmvzBbJBI+ui0OaVImw0nTs/qFxyBItaOmE7JthFv7 XwVFnzixLuxcIeQFOzRNi8wRyiTWPhjJ0M1AjtE9lAVZMVKbIFGZe4S/GxNglycmHTxO VzQDWcDtyMtKAFZEQY+eyYGpcqUSeiRcqSV2aqHyOU0tyRCkAH4EosnNHCc0zrqcldUP L5oh8E+WZmagAcQmrM02yhQkewLrIxTcuImigBF8N1MTrRdsLuG5UYsqHFb8RGW1eVh8 FFAcitHa3EJ0Kj3vrB6RH5XYA7+L9tIUk6PnfEdg8ZP58zJnVgam6cCEETFVQBDSXuTW ck+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741727390; x=1742332190; 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:message-id:date:subject:cc:to:from:x-beenthere :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=+13+MRhG5rKw2PgUMPwSSQjX/tDr4a1iX83AQW12G/4=; b=b8rMg75crTemOqbELtCOhE1sE4QPs+PyTzPKyaxjoc2fd3IPnSjdto/2N2Riuqw8r9 7nlpXdi0cv76J1DfgljH7fhgDC5JIf0Q7bKs7187HivwTQ74MIK3f94wVZQfZHzXs4Av D8HmkCxy50bAauYWoBfvtevRbVChF5Ee7ERgzGSpVfbHeAtLu65ETy+8zjInDD9uRI8u B/y3+99PQSyaYmwAlVixZIAn7hhctGblfUFq8xEqnppIEmDkmbVCf4qt55SyVPYRZhqh 7rq/xD+TcoHMgxQwQrurvIvFdizmyqqz7KAVoihJtU5Gjp3K3tP6kvDR85obGrOx4Q8G vvCw== X-Forwarded-Encrypted: i=2; AJvYcCVMnBOMBtUoQ+1JVjMikHHzslhi1Ke5rMU0MAseXUi/eyTNRvzOlSBE+KugzF6w35LlSSTqNmU=@isar-build.org X-Gm-Message-State: AOJu0Yyd4McxTa7eXnT6D65l9Z+s8x/xncevnvhJ7QQBiknGBL5zfZEG VM6SLqihFmf/i56ySDabL9trDeRtyZjDqxdHipcw70X0Jg77bgUI X-Google-Smtp-Source: AGHT+IGla/2uTbEa1TdkqJTiAYd+Ud7WoaNUAr+v1vLEgWrVKGgfNSv86epwAMXiXx7ejp/rOgTrYw== X-Received: by 2002:a05:6512:3d19:b0:542:2139:636a with SMTP id 2adb3069b0e04-549abd1c331mr1732872e87.7.1741727388401; Tue, 11 Mar 2025 14:09:48 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com; h=Adn5yVHrwOeDNeggGmRjWWCkMftxyvigq8m24CH0olmM0C4+4Q== Received: by 2002:ac2:53b9:0:b0:549:94ac:e7b2 with SMTP id 2adb3069b0e04-54994ace917ls857005e87.0.-pod-prod-00-eu; Tue, 11 Mar 2025 14:09:46 -0700 (PDT) X-Received: by 2002:a05:6512:304b:b0:545:5d:a5c7 with SMTP id 2adb3069b0e04-549abd4a3c4mr1934638e87.21.1741727385753; Tue, 11 Mar 2025 14:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1741727385; cv=none; d=google.com; s=arc-20240605; b=fnk82bZ7ziBJ45fvW9x8CNDEXQvkMw1eleJ5P4+4Pf+0qUgPNACRfLrxZVmNqx2SiB FH+F09nEerrWNDJBkdYsIXHqxeyu88St3tzX9mJmw4J4iSL6f84Vcu7zEHcwgdE0VWlh loiT3eP3OWaIuVEgJdv3WQAJyNPwc/6IligUDQcLZbLLzUOYEncvZunw3EPtN39A5NsU jOw/0mxg+8ZpDY1Z6KbvUUlUllRJWAvO1Hn6UGpYW0TLNy8Q5JNk3zMQuoBlWN9ImqcE L5mO10K7le4hs79e/8EgZ82TeN8U0x/2umk/OTw3Y+C0A5fdfStguLrPZhTwtGNRq2B8 3SNQ== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=wZiVBdaMG+v5yPzSxrnhpO0wjBnhUOMmfRZMCpVVo7U=; fh=bxwHoRtzgcBE20fsluyIAvpVkk49eQhu61r0Hn3s3Yc=; b=i2yFjlfijqFz3C3wMN16EY1KZv8hkzOjZu4bXBNglGX2RBXVSBmiX3BAGvXdBkcQo4 vntq44lVm3wjGOidRw7laUOUxnYmfjHif6nRnMR1by663ZZ44ve/a0yL+nI5tSyXog7V lLon8Ot8N9YtZlLcYcrAh4eOkTN8Qt6U1dFyw2kddVefus7rmvINKCrMreh6P6HhMdzT wDnawoKfZ+XK5GbpPwUybrRJxDS5LJ588vKF3nPYSBSfGl2qzA9q6Bu81ABa1aXjuWun 3lnHE5mGtfUJB7lDnDX1Tn6NQT2+WV1WVQO+JgqkO/U15eQnHRVOZ8W+bujU1oJoCK2s vINw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="fC/i6fsO"; spf=pass (google.com: domain of fm-1325773-20250311210944894a70955c0e0a8b9a-knmcq_@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1325773-20250311210944894a70955c0e0a8b9a-KNmCQ_@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT 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 2adb3069b0e04-5498b0b344asi228263e87.8.2025.03.11.14.09.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Mar 2025 14:09:45 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1325773-20250311210944894a70955c0e0a8b9a-knmcq_@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 20250311210944894a70955c0e0a8b9a for ; Tue, 11 Mar 2025 22:09:45 +0100 X-Patchwork-Original-From: "chris.larson via isar-users" From: "chris.larson" To: isar-users@googlegroups.com Cc: Cedric Hombourger , Christopher Larson Subject: [PATCH 0/3] Add 'customization' package support Date: Tue, 11 Mar 2025 14:09:35 -0700 Message-ID: <20250311210939.4090-1-chris.larson@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1325773:519-21489:flowmailer X-Original-Sender: chris.larson@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b="fC/i6fsO"; spf=pass (google.com: domain of fm-1325773-20250311210944894a70955c0e0a8b9a-knmcq_@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1325773-20250311210944894a70955c0e0a8b9a-KNmCQ_@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: chris.larson@siemens.com Reply-To: chris.larson@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: Christopher Larson A number of downstream layers have customization dpkg-raw recipes making use of template variables to support build-time settings: add the infrastructure to Isar to help uniformization of such recipes. Settings are often specific to a DISTRO, MACHINE or IMAGE: provide a mechanism to decorate (prefix or suffix) packages being constructed and pulled into the image. This helps use of customization packages in multiconfig builds but also with the deployment of binary package feeds for projects supporting multiple variants. To create a customization package, a recipe must inherit the `dpkg-customization` bbclass. By default, images will inherit the `image-customizations` class, which will install the package for any customizations listed in `CUSTOMIZATIONS`. To add variables to the customization package names, beyond the default DISTRO and MACHINE, add them to `CUSTOMIZATION_VARS` as variable references (`${DISTRO}`, `${MACHINE}`). By default, these variables are appended to the package name, but if they should be prefixed, add them to `CUSTOMIZATION_VARS_PREFIXED`. By default, the `DISTRO` and `MACHINE` variables are used, and the `DISTRO` is prefixed, while the `MACHINE` is suffixed. To enable support for per-image changes, and per-image customization packages, add the image name to `CUSTOMIZATION_FOR_IMAGES`. In the customization package recipe, the `IMAGE` variable will be set to the image name, and the package name will be decorated with the image name. The `IMAGE` will also be added to the `OVERRIDES`, allowing for variable definitions like this in the customization recipe: HOSTNAME:isar-image-ci = "isar-ci" When `CUSTOMIZATION_FOR_IMAGES` is defined, `${IMAGE}` will be implicitly added to `CUSTOMIZATION_VARS`, and the package will be decorated with the image name. An example `hostname` customization recipe/package is provided, as is an initial unit test to verify the functionality of this customization. Christopher Larson (3): classes: add 'customization' package support hostname-customization: add initial customization package testsuite: add 'customizations' test meta/classes/customization-base.bbclass | 21 +++++++++++ meta/classes/dpkg-customization.bbclass | 37 +++++++++++++++++++ meta/classes/image-customizations.bbclass | 30 +++++++++++++++ meta/classes/image.bbclass | 1 + .../customizations/hostname-customization.bb | 11 ++++++ .../hostname-customization/postinst.tmpl | 5 +++ testsuite/cibuilder.py | 9 +++++ testsuite/citest.py | 21 +++++++++++ 8 files changed, 135 insertions(+) create mode 100644 meta/classes/customization-base.bbclass create mode 100644 meta/classes/dpkg-customization.bbclass create mode 100644 meta/classes/image-customizations.bbclass create mode 100644 meta/recipes-support/customizations/hostname-customization.bb create mode 100644 meta/recipes-support/customizations/hostname-customization/postinst.tmpl