From 32e71044803a0b6826098bcfda80150843300720 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 10 Nov 2023 08:18:35 -0500 Subject: [PATCH] Backport patch for not having separate /boot --- ...-grubconfigs-Ensure-grub2-dir-exists.patch | 30 +++++++++++++++++++ rust-bootupd.spec | 7 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0001-grubconfigs-Ensure-grub2-dir-exists.patch diff --git a/0001-grubconfigs-Ensure-grub2-dir-exists.patch b/0001-grubconfigs-Ensure-grub2-dir-exists.patch new file mode 100644 index 0000000..22dd36e --- /dev/null +++ b/0001-grubconfigs-Ensure-grub2-dir-exists.patch @@ -0,0 +1,30 @@ +From ece9120cb43b1834ff4b7268308886cd89a47e54 Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Thu, 9 Nov 2023 19:17:57 -0500 +Subject: [PATCH] grubconfigs: Ensure grub2 dir exists + +I hit this when testing `bootc install` in a loop, it seems like +we could be implicitly depending on this directory already +having been created. +--- + src/grubconfigs.rs | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/grubconfigs.rs b/src/grubconfigs.rs +index 01f6b3e..dcdf986 100644 +--- a/src/grubconfigs.rs ++++ b/src/grubconfigs.rs +@@ -62,6 +62,10 @@ pub(crate) fn install(target_root: &openat::Dir, efi: bool) -> Result<()> { + config.push_str(post.as_str()); + } + ++ if !bootdir.exists(GRUB2DIR)? { ++ bootdir.create_dir(GRUB2DIR, 0o700)?; ++ } ++ + bootdir + .write_file_contents(format!("{GRUB2DIR}/grub.cfg"), 0o644, config.as_bytes()) + .context("Copying grub-static.cfg")?; +-- +2.41.0 + diff --git a/rust-bootupd.spec b/rust-bootupd.spec index 67b7059..e0ae6dc 100644 --- a/rust-bootupd.spec +++ b/rust-bootupd.spec @@ -4,7 +4,7 @@ Name: rust-%{crate} Version: 0.2.13 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Bootloader updater License: Apache-2.0 @@ -12,6 +12,8 @@ URL: https://github.com/coreos/bootupd Source0: %{url}/releases/download/v%{version}/bootupd-%{version}.crate Source1: %{url}/releases/download/v%{version}/bootupd-%{version}-vendor.tar.zstd +Patch0: 0001-grubconfigs-Ensure-grub2-dir-exists.patch + # For now, see upstream BuildRequires: make BuildRequires: openssl-devel @@ -75,6 +77,9 @@ License: Apache-2.0 AND BSD-3-Clause AND MIT AND (Apache-2.0 OR BSL-1.0) %systemd_postun bootupd.service bootupd.socket %changelog +* Fri Nov 10 2023 Colin Walters - 0.2.13-3 +- Backport patch for not having separate /boot + * Thu Nov 02 2023 Colin Walters - 0.2.13-2 - Rebase to 0.2.13