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 A99BE96405 for ; Tue, 24 Jan 2023 11:05:38 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 90B002032 for ; Tue, 24 Jan 2023 11:05:38 +0100 (CET) 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 ; Tue, 24 Jan 2023 11:05:38 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id BF38845D66 for ; Tue, 24 Jan 2023 11:05:37 +0100 (CET) From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= To: pbs-devel@lists.proxmox.com Date: Tue, 24 Jan 2023 11:05:28 +0100 Message-Id: <20230124100528.1516276-2-f.gruenbichler@proxmox.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230124100528.1516276-1-f.gruenbichler@proxmox.com> References: <20230124100528.1516276-1-f.gruenbichler@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 2.634 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_HI -5 Sender listed at https://www.dnswl.org/, high trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [architecture.mk, buildflags.mk, crates.io] Subject: [pbs-devel] [PATCH proxmox-backup-restore-image 2/2] build: use system toolchain and rust dependencies 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: Tue, 24 Jan 2023 10:05:38 -0000 instead of using crates.io - the build still requires network access and depends on configured APT sources in the build environment, so there's room for further improvement. Signed-off-by: Fabian Grünbichler --- debian/control | 8 +++++++- debian/rules | 17 +++++++++++++++++ src/build_initramfs.sh | 2 +- 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 55781a4..b2750fd 100644 --- a/debian/control +++ b/debian/control @@ -7,8 +7,10 @@ Build-Depends: apt-rdepends, automake, bc, bison, + cargo, cpio, debhelper (>= 12~), + dh-cargo, dh-python, flex, gcc (>= 8.3.0-6), @@ -16,10 +18,14 @@ Build-Depends: apt-rdepends, libblkid-dev, libdw-dev, libelf-dev, + librust-anyhow-1+default-dev, + librust-nix-0.26+default-dev, + libssl-dev, libtool, lintian, perl-modules, - python3-minimal, + python3, + rustc, sed, sphinx-common, tar, diff --git a/debian/rules b/debian/rules index 657234c..4fdf855 100755 --- a/debian/rules +++ b/debian/rules @@ -3,5 +3,22 @@ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +include /usr/share/dpkg/architecture.mk +include /usr/share/dpkg/buildflags.mk +include /usr/share/rustc/architecture.mk + +export CFLAGS CXXFLAGS CPPFLAGS LDFLAGS +export DEB_HOST_RUST_TYPE DEB_HOST_GNU_TYPE +PATH := /usr/share/cargo/bin:$(PATH) + +export PATH + +export CARGO_HOME=$(CURDIR)/debian/cargo_home +export DEB_CARGO_CRATE=init-shim-rs + %: dh $@ + +override_dh_auto_configure: + cargo prepare-debian $(CARGO_HOME)/registry --link-from-system + dh_auto_configure diff --git a/src/build_initramfs.sh b/src/build_initramfs.sh index 4d81b39..b7caf81 100755 --- a/src/build_initramfs.sh +++ b/src/build_initramfs.sh @@ -4,7 +4,7 @@ set -e ROOT="root" BUILDDIR="build/initramfs" -INIT="../../init-shim-rs/target/release/init-shim-rs" +INIT="../../init-shim-rs/target/x86_64-unknown-linux-gnu/release/init-shim-rs" echo "Using build dir: $BUILDDIR" rm -rf "$BUILDDIR" -- 2.30.2