Compare commits

...

2 Commits

Author SHA1 Message Date
8823906449 import CS rust-bootupd-0.2.28-3.el9 2025-09-15 12:42:12 +00:00
95781a866c import CS rust-bootupd-0.2.27-3.el9 2025-03-11 08:10:06 +00:00
4 changed files with 91 additions and 20 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
SOURCES/bootupd-0.2.19-vendor.tar.zstd
SOURCES/bootupd-0.2.19.crate
SOURCES/bootupd-0.2.28-vendor.tar.zstd
SOURCES/bootupd-0.2.28.tar.zstd

View File

@ -1,2 +1,2 @@
c9fc8b2e450c11c8e12fb63b7474cddd009f52e5 SOURCES/bootupd-0.2.19-vendor.tar.zstd
11db1d98620000dccf43a2d645b2020b696ae321 SOURCES/bootupd-0.2.19.crate
5d0158b7862df708674da66de41c764e59ea4710 SOURCES/bootupd-0.2.28-vendor.tar.zstd
c53785cbafd7bc1a3da45feccd3a53ed3bfd7400 SOURCES/bootupd-0.2.28.tar.zstd

View File

@ -0,0 +1,51 @@
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,15 +3,21 @@
%global crate bootupd
Name: rust-%{crate}
Version: 0.2.19
Release: 1%{?dist}
Version: 0.2.28
Release: 3%{?dist}
Summary: Bootloader updater
License: Apache-2.0
URL: https://github.com/coreos/bootupd
Source0: %{url}/releases/download/v%{version}/bootupd-%{version}.crate
Source0: %{url}/releases/download/v%{version}/bootupd-%{version}.tar.zstd
Source1: %{url}/releases/download/v%{version}/bootupd-%{version}-vendor.tar.zstd
%if 0%{?fedora} || 0%{?rhel} >= 10
ExcludeArch: %{ix86}
%endif
Patch0: 0001-install-attempt-to-use-an-already-mounted-ESP-at-the.patch
BuildRequires: git
# For now, see upstream
BuildRequires: make
BuildRequires: openssl-devel
@ -31,12 +37,13 @@ Summary: %{summary}
# Apache-2.0
# Apache-2.0 OR BSL-1.0
# Apache-2.0 OR MIT
# Apache-2.0 WITH LLVM-exception
# Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT
# BSD-3-Clause
# MIT
# MIT OR Apache-2.0
# Unlicense OR MIT
License: Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
License: Apache-2.0 AND (Apache-2.0 WITH LLVM-exception) AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) AND (Apache-2.0 OR MIT) AND (Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT) AND (Unlicense OR MIT)
%{?systemd_requires}
%description -n %{crate} %{_description}
@ -48,33 +55,46 @@ License: Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0)
%doc README.md
%{_bindir}/bootupctl
%{_libexecdir}/bootupd
%{_unitdir}/*
%{_prefix}/lib/bootupd/grub2-static/
%{_unitdir}/bootloader-update.service
%prep
%autosetup -n %{crate}-%{version} -p1 -a1
%cargo_prep -v vendor
%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
%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
%install
%make_install INSTALL="install -p -c"
%{__make} install-grub-static DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
%post -n %{crate}
%systemd_post bootupd.service bootupd.socket
%preun -n %{crate}
%systemd_preun bootupd.service bootupd.socket
%postun -n %{crate}
%systemd_postun bootupd.service bootupd.socket
%{__make} install-systemd-unit DESTDIR=%{?buildroot} INSTALL="%{__install} -p"
%changelog
* Wed Feb 12 2025 Joseph Marrero <jmarrero@fedoraproject.org> - 0.2.27-3
- spec: remove ExcludeArch ix86 as this is c9s
Resolves: #RHEL-77736, #RHEL-79091
* Wed Feb 12 2025 Joseph Marrero <jmarrero@fedoraproject.org> - 0.2.27-2
- Add git to the build requires
Resolves: #RHEL-77736, #RHEL-79091
* Wed Feb 12 2025 Joseph Marrero <jmarrero@fedoraproject.org> - 0.2.27-1
- https://github.com/coreos/bootupd/releases/tag/v0.2.27
Resolves: #RHEL-77736
* Thu Dec 12 2024 HuijingHei <hhei@redhat.com> - 0.2.25-1
- new version
* Fri May 17 2024 Joseph Marrero <jmarrero@fedoraproject.org> - 0.2.19-1
- https://github.com/coreos/bootupd/releases/tag/v0.2.19
Resolves: RHEL-35887