Update to 0.2.29

Resolves: #RHEL-110493
This commit is contained in:
Huijing Hei 2025-08-21 14:30:00 +08:00
parent 5cdf573a73
commit 7c0450d6ee
No known key found for this signature in database
GPG Key ID: 1EB1D790E7572601
4 changed files with 8 additions and 65 deletions

2
.gitignore vendored
View File

@ -43,3 +43,5 @@
/bootupd-0.2.27-vendor.tar.zstd
/bootupd-0.2.28.tar.zstd
/bootupd-0.2.28-vendor.tar.zstd
/bootupd-0.2.29.crate
/bootupd-0.2.29-vendor.tar.zstd

View File

@ -1,51 +0,0 @@
From 593b94a1750c1d71f5a37365633afdd99cfb714b Mon Sep 17 00:00:00 2001
From: Huijing Hei <hhei@redhat.com>
Date: Wed, 25 Jun 2025 12:14:02 +0800
Subject: [PATCH] install: attempt to use an already mounted ESP at the target
Let's attempt to use an already mounted ESP at the target
dest_root if one is already mounted there in a known ESP location,
if failed, will fallback to mount ESP partition of the device.
See https://github.com/coreos/coreos-assembler/pull/4161
---
src/efi.rs | 22 +++++++++++++++-------
1 file changed, 15 insertions(+), 7 deletions(-)
diff --git a/src/efi.rs b/src/efi.rs
index 1adc3d6..b8fc24c 100644
--- a/src/efi.rs
+++ b/src/efi.rs
@@ -345,14 +345,22 @@ impl Component for Efi {
let srcdir_name = component_updatedirname(self);
let ft = crate::filetree::FileTree::new_from_dir(&src_root.sub_dir(&srcdir_name)?)?;
- // Using `blockdev` to find the partition instead of partlabel because
- // we know the target install toplevel device already.
- let esp_device = blockdev::get_esp_partition(device)?
- .ok_or_else(|| anyhow::anyhow!("Failed to find ESP device"))?;
-
- let destpath = &self.ensure_mounted_esp(Path::new(dest_root), Path::new(&esp_device))?;
+ // Let's attempt to use an already mounted ESP at the target
+ // dest_root if one is already mounted there in a known ESP location.
+ let destpath = if let Some(destdir) = self.get_mounted_esp(Path::new(dest_root))? {
+ destdir
+ } else {
+ // Using `blockdev` to find the partition instead of partlabel because
+ // we know the target install toplevel device already.
+ if device.is_empty() {
+ anyhow::bail!("Device value not provided");
+ }
+ let esp_device = blockdev::get_esp_partition(device)?
+ .ok_or_else(|| anyhow::anyhow!("Failed to find ESP device"))?;
+ self.mount_esp_device(Path::new(dest_root), Path::new(&esp_device))?
+ };
- let destd = &openat::Dir::open(destpath)
+ let destd = &openat::Dir::open(&destpath)
.with_context(|| format!("opening dest dir {}", destpath.display()))?;
validate_esp_fstype(destd)?;
--
2.49.0

View File

@ -3,18 +3,16 @@
%global crate bootupd
Name: rust-%{crate}
Version: 0.2.28
Version: 0.2.29
Release: %autorelease
Summary: Bootloader updater
License: Apache-2.0
URL: https://github.com/coreos/bootupd
Source0: %{url}/releases/download/v%{version}/bootupd-%{version}.tar.zstd
Source0: %{crates_source}
Source1: %{url}/releases/download/v%{version}/bootupd-%{version}-vendor.tar.zstd
ExcludeArch: %{ix86}
Patch0: 0001-install-attempt-to-use-an-already-mounted-ESP-at-the.patch
BuildRequires: git
# For now, see upstream
BuildRequires: make
@ -57,18 +55,12 @@ License: Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND BSD-3-Clause
%{_unitdir}/bootloader-update.service
%prep
%autosetup -n %{crate}-%{version} -p1 -Sgit -a1
# Default -v vendor config doesn't support non-crates.io deps (i.e. git)
cp .cargo/vendor-config.toml .
%cargo_prep -N
cat vendor-config.toml >> .cargo/config.toml
rm vendor-config.toml
%autosetup -n %{crate}-%{version} -p1 -a1
%cargo_prep -v vendor
%build
%cargo_build
%cargo_vendor_manifest
# https://pagure.io/fedora-rust/rust-packaging/issue/33
sed -i -e '/https:\/\//d' cargo-vendor.txt
%cargo_license_summary
%{cargo_license} > LICENSE.dependencies

View File

@ -1,2 +1,2 @@
SHA512 (bootupd-0.2.28.tar.zstd) = 0f6f2bf40d3bdc8372762c03969203fb8d9f55cd87bf8995dae77643e48266de0f51da3943abd0a0d9954f92a845b639ed446b8d52d9c2fd0afd08aebbac1bfa
SHA512 (bootupd-0.2.28-vendor.tar.zstd) = e2671dcb006b23effc2a2cea121ff4da831b037e45746372c98d73cb52e1b0243b5fbe611b408ae22e2687570a2164e39154b161f664392c8cf2c6f2d24faeab
SHA512 (bootupd-0.2.29.crate) = af30aea5053550746d600be2ea4abc4f43bc13b1f2358f5dc01e2332b8f7d9f4c13c1f94498f3ef650e12dc29b3a000cd02bdfe32df9290d6ffe76e9f7dbef6a
SHA512 (bootupd-0.2.29-vendor.tar.zstd) = 1f2f0a1c1460e7bf0dfd408ae0f38dff37d5659a43998bc721ed1cc5597bb120aa436c67ad0c79702170d0238ac37f5c5d507e9d79ee6f09161b64b4b2f5a8d8