From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 9300DA0251 for ; Mon, 12 Jun 2023 15:37:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 7294F24298 for ; Mon, 12 Jun 2023 15:37:36 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS for ; Mon, 12 Jun 2023 15:37:34 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 196BB43B78 for ; Mon, 12 Jun 2023 15:37:34 +0200 (CEST) From: Stefan Sterz To: pbs-devel@lists.proxmox.com Date: Mon, 12 Jun 2023 15:37:14 +0200 Message-Id: <20230612133715.453237-2-s.sterz@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230612133715.453237-1-s.sterz@proxmox.com> References: <20230612133715.453237-1-s.sterz@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL -0.097 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: [pbs-devel] [PATCH proxmox-offline-mirror v2 1/2] add bookworm to the list of releases X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jun 2023 13:37:36 -0000 add support for bookworm based proxmox products and debian repositories/ Signed-off-by: Stefan Sterz --- src/bin/proxmox-offline-mirror.rs | 35 ++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/bin/proxmox-offline-mirror.rs b/src/bin/proxmox-offline-mirror.rs index 8398db4..e2282d7 100644 --- a/src/bin/proxmox-offline-mirror.rs +++ b/src/bin/proxmox-offline-mirror.rs @@ -44,6 +44,7 @@ impl Display for Distro { } enum Release { + Bookworm, Bullseye, Buster, } @@ -51,6 +52,7 @@ enum Release { impl Display for Release { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { + Release::Bookworm => write!(f, "bookworm"), Release::Bullseye => write!(f, "bullseye"), Release::Buster => write!(f, "buster"), } @@ -131,6 +133,19 @@ fn derive_debian_repo( skip_sections, }; let url = match (release, variant) { + (Release::Bookworm, DebianVariant::Main) => "http://deb.debian.org/debian bookworm", + (Release::Bookworm, DebianVariant::Security) => { + "http://deb.debian.org/debian-security bookworm-security" + } + (Release::Bookworm, DebianVariant::Updates) => { + "http://deb.debian.org/debian bookworm-updates" + } + (Release::Bookworm, DebianVariant::Backports) => { + "http://deb.debian.org/debian bookworm-backports" + } + (Release::Bookworm, DebianVariant::Debug) => { + "http://deb.debian.org/debian-debug bookworm-debug" + } (Release::Bullseye, DebianVariant::Main) => "http://deb.debian.org/debian bullseye", (Release::Bullseye, DebianVariant::Security) => { "http://deb.debian.org/debian-security bullseye-security" @@ -159,6 +174,14 @@ fn derive_debian_repo( let url = format!("{url} {components}"); let key = match (release, variant) { + (Release::Bookworm, DebianVariant::Security) => { + "/usr/share/keyrings/debian-archive-bookworm-security-automatic.gpg" + } + (Release::Bookworm, DebianVariant::Updates) | + (Release::Bookworm, DebianVariant::Backports) => { + "/usr/share/keyrings/debian-archive-bookworm-automatic.gpg" + } + (Release::Bookworm, _) => "/usr/share/keyrings/debian-archive-bookworm-stable.gpg", (Release::Bullseye, DebianVariant::Security) => { "/usr/share/keyrings/debian-archive-bullseye-security-automatic.gpg" } @@ -191,7 +214,11 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er ]; let dist = read_selection_from_tty("Select distro to mirror", distros, None)?; - let releases = &[(Release::Bullseye, "Bullseye"), (Release::Buster, "Buster")]; + let releases = &[ + (Release::Bookworm, "Bookworm"), + (Release::Bullseye, "Bullseye"), + (Release::Buster, "Buster"), + ]; let release = read_selection_from_tty("Select release", releases, Some(0))?; let mut add_debian_repo = false; @@ -224,6 +251,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er } let releases = match release { + &Release::Bookworm => vec![(CephRelease::Quincy, "Quincy (17.x)")], Release::Bullseye => { vec![ (CephRelease::Octopus, "Octopus (15.x)"), @@ -250,6 +278,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er read_string_from_tty("Enter repository components", Some("main test"))?; let key = match release { + Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg", Release::Bullseye => "/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg", Release::Buster => "/etc/apt/trusted.gpg.d/proxmox-release-buster.gpg", }; @@ -281,6 +310,9 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er // TODO enterprise query for key! let url = match (release, variant) { + (Release::Bookworm, ProxmoxVariant::Enterprise) => format!("https://enterprise.proxmox.com/debian/{product} bookworm {product}-enterprise"), + (Release::Bookworm, ProxmoxVariant::NoSubscription) => format!("http://download.proxmox.com/debian/{product} bookworm {product}-no-subscription"), + (Release::Bookworm, ProxmoxVariant::Test) => format!("http://download.proxmox.com/debian/{product} bookworm {product}test"), (Release::Bullseye, ProxmoxVariant::Enterprise) => format!("https://enterprise.proxmox.com/debian/{product} bullseye {product}-enterprise"), (Release::Bullseye, ProxmoxVariant::NoSubscription) => format!("http://download.proxmox.com/debian/{product} bullseye {product}-no-subscription"), (Release::Bullseye, ProxmoxVariant::Test) => format!("http://download.proxmox.com/debian/{product} bullseye {product}test"), @@ -297,6 +329,7 @@ fn action_add_mirror(config: &SectionConfigData) -> Result, Er }; let key = match release { + Release::Bookworm => "/etc/apt/trusted.gpg.d/proxmox-release-bookworm.gpg", Release::Bullseye => "/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg", Release::Buster => "/etc/apt/trusted.gpg.d/proxmox-release-buster.gpg", }; -- 2.30.2