From patchwork Mon Oct 7 12:27:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "alexander.heinisch" X-Patchwork-Id: 3854 Return-Path: Received: from shymkent.ilbers.de ([unix socket]) by shymkent (Cyrus 2.5.10-Debian-2.5.10-3+deb9u2) with LMTPA; Mon, 07 Oct 2024 14:27:44 +0200 X-Sieve: CMU Sieve 2.4 Received: from mail-pj1-f56.google.com (mail-pj1-f56.google.com [209.85.216.56]) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8+deb9u1) with ESMTPS id 497CRh6d016300 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 7 Oct 2024 14:27:44 +0200 Received: by mail-pj1-f56.google.com with SMTP id 98e67ed59e1d1-2e0853aafcesf5733467a91.1 for ; Mon, 07 Oct 2024 05:27:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1728304057; cv=pass; d=google.com; s=arc-20240605; b=aTsFHZLhgNf3W4xs3QJHFwzahPwTXa6t+zU2Tj/2AxJVWm+TvTKxF1yoo0dkxQUszm BRKlF0od52fy7jbGZmNyg4rP+x+anyPK6XB8NWQ2rO+wmzf3vFWmOlUnV0y2vBJLqe2V Uh62d1mX8bj70U55Cqff37hM/8kwp/5QsKwJwjBQ8EEEdAYCEbwVyYPFc7EvKhG21Sns JQp2PCtyKSnWYZLgr6TYkzEtDsxY2QXq4tj3GoORjwwyOUDXOXsL4T+Q+ngNSrFi/9rB rZaSLH6NN2vlDqnoAmRQ6wMb0GfEx+pgADKB4IdFwa10YTWOXB4/uZWEvCZfYbrh7efr GvZA== 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=a/jEdEFtKeU5QzXz2VJxJZPUNm6thzr5+CRzwvoLnGA=; fh=UktKEFop0k54Z+N9alcWpXWhGMsC7HIbGIhPkhCGD80=; b=ARka9QIFJoeoWNiC2oPNZzO0j8RAYDet7iGpfK1LgxhcYkg7X57GkNHvShV5gXKF56 WZHy4DNTfrqQL8+rJpGhnYRqlWWxbzZygUiC5AFVdYuD68Qm7iKhJK4rLkFkoVwgPIus 3Ojnk82s521Xo5NyK1QueFKe3liaUts+mau/avnk0tCqBO+9KjT0Znk5hULhvZKG4Rgd mm3RWGErRq7wDnCdVzKmk9D5a65vNBQDyVPCyPwumZOx0ABrOIM5drb5E95HWJnXJKvZ lzbwvwoNxKDanDvdFW7u6WTKEvp0cAvtKRHJl/DBG/4sBRxnv/U9pkDivTNk/d78ONEN lRQg==; darn=isar-build.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=CNh0ssTx; spf=pass (google.com: domain of fm-1326448-20241007122733dd046c1202fb51ff1d-p_x6pe@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1326448-20241007122733dd046c1202fb51ff1d-p_x6Pe@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=1728304057; x=1728908857; 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=a/jEdEFtKeU5QzXz2VJxJZPUNm6thzr5+CRzwvoLnGA=; b=bK/K9fADy1tUZX8JuZgYIg6Hx+4Xeq1kE2VDsEPGFv6Dm4iJfHSGUe8Aeo2jyEz1vQ ONmmy4q4h5Sb3X5ydvEHhUGmfH5Qh5RTZzePhEPiNUeC8R/q2j+Aa6jmS7MCvR4M9azf u5E86ozWD9v8vLLR41Kbxepbv9w9ip2vCFEtTc0+5W0UlGql8+/Ek9crwBJVRXm8ESqt Ib9W85ELiqaPgz1tLO/NAdftdb9zYDipa+KFetTNOhLzLsTSRFsN4xByrurXu420xBaw 0/2k1H43tb74A9kSFYgS00ylGVJkdSi84cQR5hKC8z0D2p6snwmzqICpseLEKlT331ML UN4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728304057; x=1728908857; 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=a/jEdEFtKeU5QzXz2VJxJZPUNm6thzr5+CRzwvoLnGA=; b=fTvwDP3oBtF6D8bM6EdQdPVdASMJUfSIdyTciCJufxuw0G2kwjwa5G5t2fgx4ylw1F tjgvqH8gWvrpS2dLCBWdRQe9sfOM4jJXrsb4EnQQJ5ofBRLY+/Xiy74nuLDvt8n1p7Iw ERsnyLCknzMQbvf2IIhD8vR3NhLjgksDquadY+/bBrqSvAxXlmKI/q+ZK48t8gR+SLa1 tosBQrC4kn1zSI8TH+IQwXjx4pO4UFvlPU7no/AImpFcycsyxwYFm3NkBjqimBgqHlue aPhEkVxxZveGRJtgHZp6PYbwWoZYRoJuUJ8HetK2q+TMagwQ4PqyV5cZScvU92XZ1iLl QIPw== X-Forwarded-Encrypted: i=2; AJvYcCWlbv0D/yk8kUiuwaRQfxx2YGvg1NgwGCua8BAB3A9+BXvaTm8LXSbUbhqCeO63nWlEp+mtj+Y=@isar-build.org X-Gm-Message-State: AOJu0Yx8Z5x16YcOh/x5DijOidlhA8yADetzn3J/mfGNWXIB4nj5EeDd jgZ791x+gabyg2v3ZQfVAD76v0Ww95JB66gc7ez13tQNzom0WFLd X-Google-Smtp-Source: AGHT+IG9v/MGZDsnoL7M/FoDutoxHPz7G6gHnXOF2TjMyZt06YUCqbqIXvSi4zinDKMa6kyxbrv5dg== X-Received: by 2002:a17:90a:f2c4:b0:2e0:9160:1842 with SMTP id 98e67ed59e1d1-2e1e620c8e8mr15761006a91.1.1728304057090; Mon, 07 Oct 2024 05:27:37 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:90b:19d8:b0:2da:30b7:69a5 with SMTP id 98e67ed59e1d1-2e1b39cbbf4ls3180658a91.2.-pod-prod-08-us; Mon, 07 Oct 2024 05:27:36 -0700 (PDT) X-Received: by 2002:a17:90a:ce96:b0:2d8:f0e2:96bc with SMTP id 98e67ed59e1d1-2e1e620ce6dmr14197353a91.4.1728304055782; Mon, 07 Oct 2024 05:27:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1728304055; cv=none; d=google.com; s=arc-20240605; b=AAssWij8kPyyLJAWkJ+5a/5ETMXPTcUzS1iUzjwL+SWipzRciB9tq2EZMudBqXcInO 4sieMPSKspmaGJwmIbi/YIlHWmE675Xd5MjW15TJPn2Hraq5bFPExKUwL921/fy7tASG dc9iFqhIcDgYgr8xdrx+Ai6z2d0Fp3p0gDQgQqmZ6DG1yxReumR3DOXSzDSNlXoEPmOs w4d1NIm7ghOZKsqY0L0uhaV5ermLG8Bju4b06ZMal8orEUcsM5PRE1IJRMOgnrtlcUIh 7VRt2zNykdEiJIMorA1/VF7f7mU8pGK/Oel8TqBLF9JVulIvMavdjojulUU7KzgmEpPZ f0Rg== 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=ezwO+3UkzZmwruKypYbGbac7dMbqSEjnSTeZmuzo6No=; fh=Z5Qnyb0EtJ8UwrxkpbdSYE+xHzQI6qPfwJivtsUki18=; b=ESDx8xJbxxrcwmllX08wK0asiIWNCHuJZkIKtwG5wc4phf7q1UFMqv1dNzq5bQOisE ndCiIbV5WzL9+GRht0GJ/50/7OBAwWjdA1wbXnAIbgT2j+sMwELucBUiwhNaHOrExTDW /ekQW9jEKRnXwznCGky0PhxCdGtt3kocUzvFUaus25L/jJrCwqDFmu2pG9akkKOADPBb 89OJHlrfWfhcAbPRV/aGn/1hmWs/kyp0u0q6dHCnLTXSBDebt/OTwcFgkE6k/WKrE5Hx EzNDLjXyDNZn0eGu0DBiwOVZuxm7FfWCsLimqL1yIq+pgOMMA+4Sf5n5WCf0CyF7ThNQ 5VNw==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=CNh0ssTx; spf=pass (google.com: domain of fm-1326448-20241007122733dd046c1202fb51ff1d-p_x6pe@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1326448-20241007122733dd046c1202fb51ff1d-p_x6Pe@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 98e67ed59e1d1-2e1e60a0bc3si620474a91.0.2024.10.07.05.27.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Oct 2024 05:27:35 -0700 (PDT) Received-SPF: pass (google.com: domain of fm-1326448-20241007122733dd046c1202fb51ff1d-p_x6pe@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 20241007122733dd046c1202fb51ff1d for ; Mon, 07 Oct 2024 14:27:33 +0200 X-Patchwork-Original-From: "alexander.heinisch via isar-users" From: "alexander.heinisch" To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, felix.moessbauer@siemens.com, Alexander Heinisch Subject: [PATCH v3] meta: Allow to specify the snapshot date in the upstream format. Date: Mon, 7 Oct 2024 14:27:09 +0200 Message-ID: <20241007122709.215901-1-alexander.heinisch@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1326448:519-21489:flowmailer X-Original-Sender: alexander.heinisch@siemens.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm2 header.b=CNh0ssTx; spf=pass (google.com: domain of fm-1326448-20241007122733dd046c1202fb51ff1d-p_x6pe@rts-flowmailer.siemens.com designates 185.136.64.228 as permitted sender) smtp.mailfrom=fm-1326448-20241007122733dd046c1202fb51ff1d-p_x6Pe@rts-flowmailer.siemens.com; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=siemens.com X-Original-From: alexander.heinisch@siemens.com Reply-To: alexander.heinisch@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_H3,RCVD_IN_MSPIKE_WL, 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: Alexander Heinisch Currently, it is only possible to specify a unix timestamp to resolve the snapshot version used. Since this is not very user friendly, most downstream projects put comments like `# 20240702T082400Z` next to the snapshot assignment `ISAR_APT_SNAPSHOT_TIMESTAMP = ...`. This patch makes it easier for users to specify the snapshot version in a more natural way by `ISAR_APT_SNAPSHOT_DATE = 20240702T082400Z` Signed-off-by: Alexander Heinisch Reviewed-by: Jan Kiszka --- v2: Added documentation v3: Renamed APT_SNAPSHOT_DATE to ISAR_APT_SNAPSHOT_DATE doc/user_manual.md | 3 ++- kas/opt/Kconfig | 2 +- meta-isar/conf/distro/ubuntu-common.inc | 2 +- meta/conf/distro/debian-common.conf | 2 +- meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/doc/user_manual.md b/doc/user_manual.md index 706c74bf..cf3c3b12 100644 --- a/doc/user_manual.md +++ b/doc/user_manual.md @@ -435,7 +435,8 @@ Some other variables include: - `ISAR_USE_APT_SNAPSHOT` - Use a frozen apt snapshot instead of the live mirror. Optional. `ISAR_APT_DL_LIMIT` - Rate limit the apt fetching to n kB / s. Optional. - `DISTRO_APT_SNAPSHOT_PREMIRROR` - Similar to `DISTRO_APT_PREMIRRORS` but for a snapshot, pre-defined for supported distros. - - `ISAR_APT_SNAPSHOT_TIMESTAMP` - Timestamp of the apt snapshot. Automatically derived from `SOURCE_DATE_EPOCH` if not overwritten. + - `ISAR_APT_SNAPSHOT_TIMESTAMP` - Unix timestamp of the apt snapshot. Automatically derived from `SOURCE_DATE_EPOCH` if not overwritten. (Consider `ISAR_APT_SNAPSHOT_DATE` for a more user friendly format) + - `ISAR_APT_SNAPSHOT_DATE` - Timestamp in upstream format (e.g. `20240702T082400Z`) of the apt snapshot. Overrides `ISAR_APT_SNAPSHOT_TIMESTAMP` if set. Otherwise, will be automatically derived from `ISAR_APT_SNAPSHOT_TIMESTAMP` - `THIRD_PARTY_APT_KEYS` - List of gpg key URIs used to verify apt repos for apt installation after bootstrapping. - `FILESEXTRAPATHS` - The default directories BitBake uses when it processes recipes are initially defined by the FILESPATH variable. You can extend FILESPATH variable by using FILESEXTRAPATHS. - `FILESOVERRIDES` - A subset of OVERRIDES used by the build system for creating FILESPATH. The FILESOVERRIDES variable uses overrides to automatically extend the FILESPATH variable. diff --git a/kas/opt/Kconfig b/kas/opt/Kconfig index 65482e3a..1e56c29f 100644 --- a/kas/opt/Kconfig +++ b/kas/opt/Kconfig @@ -44,7 +44,7 @@ config USE_APT_SNAPSHOT bool "Use the distros snapshot mirror" depends on !MIRROR_DEBIAN && (DEBIAN_BUSTER || DEBIAN_BULLSEYE || DEBIAN_BOOKWORM || DEBIAN_TRIXIE || DEBIAN_SID || UBUNTU_FOCAL || UBUNTU_JAMMY) help - Use a snapshot mirror for the selected distribution. The date is defined by ISAR_APT_SNAPSHOT_TIMESTAMP. + Use a snapshot mirror for the selected distribution. The date is defined by ISAR_APT_SNAPSHOT_DATE. config KAS_INCLUDE_APT_SNAPSHOT string diff --git a/meta-isar/conf/distro/ubuntu-common.inc b/meta-isar/conf/distro/ubuntu-common.inc index 232bee35..be7fd047 100644 --- a/meta-isar/conf/distro/ubuntu-common.inc +++ b/meta-isar/conf/distro/ubuntu-common.inc @@ -37,4 +37,4 @@ SYSTEMD_BOOTLOADER_INSTALL:focal = "systemd:${DISTRO_ARCH}" SYSTEMD_BOOTLOADER_INSTALL:jammy = "systemd:${DISTRO_ARCH}" # snapshot mirror for reproducible builds -DISTRO_APT_SNAPSHOT_PREMIRROR ??= "(http|https)://archive.ubuntu.com/(.*) https://snapshot.ubuntu.com/\2/${APT_SNAPSHOT_DATE}/\n" +DISTRO_APT_SNAPSHOT_PREMIRROR ??= "(http|https)://archive.ubuntu.com/(.*) https://snapshot.ubuntu.com/\2/${ISAR_APT_SNAPSHOT_DATE}/\n" diff --git a/meta/conf/distro/debian-common.conf b/meta/conf/distro/debian-common.conf index 8c6a3f63..65b5b083 100644 --- a/meta/conf/distro/debian-common.conf +++ b/meta/conf/distro/debian-common.conf @@ -40,4 +40,4 @@ COMPAT_DISTRO_ARCH:amd64 = "i386" COMPAT_DISTRO_ARCH:arm64 = "armhf" # snapshot mirror for reproducible builds -DISTRO_APT_SNAPSHOT_PREMIRROR ??= "deb.debian.org/(.*) snapshot.debian.org/archive/\1/${APT_SNAPSHOT_DATE}/\n" +DISTRO_APT_SNAPSHOT_PREMIRROR ??= "deb.debian.org/(.*) snapshot.debian.org/archive/\1/${ISAR_APT_SNAPSHOT_DATE}/\n" diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc index 12f32ff0..92974eb5 100644 --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc @@ -34,7 +34,7 @@ DISTRO_VARS_PREFIX ?= "${@'HOST_' if bb.utils.to_boolean(d.getVar('BOOTSTRAP_FOR BOOTSTRAP_DISTRO = "${@d.getVar('HOST_DISTRO' if bb.utils.to_boolean(d.getVar('BOOTSTRAP_FOR_HOST')) else 'DISTRO')}" BOOTSTRAP_BASE_DISTRO = "${@d.getVar('HOST_BASE_DISTRO' if bb.utils.to_boolean(d.getVar('BOOTSTRAP_FOR_HOST')) else 'BASE_DISTRO')}" FILESEXTRAPATHS:append = ":${BBPATH}" -APT_SNAPSHOT_DATE = "${@ get_apt_snapshot_date(d)}" +ISAR_APT_SNAPSHOT_DATE ?= "${@ get_isar_apt_snapshot_date(d)}" inherit deb-dl-dir @@ -110,7 +110,7 @@ def parse_aptsources_list_line(source_list_line): return [type, options, source, suite, components] -def get_apt_snapshot_date(d): +def get_isar_apt_snapshot_date(d): import time source_date_epoch = d.getVar('ISAR_APT_SNAPSHOT_TIMESTAMP') return time.strftime('%Y%m%dT%H%M%SZ', time.gmtime(int(source_date_epoch)))