Update to 1.1.3
Also add BR skopeo, ostree for tests Related: #RHEL-66200 Signed-off-by: Colin Walters <walters@verbum.org>
This commit is contained in:
parent
e7455d50a6
commit
4c26ae4da7
2
.gitignore
vendored
2
.gitignore
vendored
@ -22,3 +22,5 @@
|
|||||||
/bootc-1.1.0-vendor.tar.zstd
|
/bootc-1.1.0-vendor.tar.zstd
|
||||||
/bootc-1.1.2.tar.zstd
|
/bootc-1.1.2.tar.zstd
|
||||||
/bootc-1.1.2-vendor.tar.zstd
|
/bootc-1.1.2-vendor.tar.zstd
|
||||||
|
/bootc-1.1.3-vendor.tar.zstd
|
||||||
|
/bootc-1.1.3.tar.zstd
|
||||||
|
132
0001-tree-wide-Use-cap-std-ext-is_mountpoint-API.patch
Normal file
132
0001-tree-wide-Use-cap-std-ext-is_mountpoint-API.patch
Normal file
@ -0,0 +1,132 @@
|
|||||||
|
From 5013d45effbbb9c6ca0a6405fca894c8dc06e767 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Colin Walters <walters@verbum.org>
|
||||||
|
Date: Fri, 20 Dec 2024 09:27:30 -0500
|
||||||
|
Subject: [PATCH] tree-wide: Use cap-std-ext is_mountpoint() API
|
||||||
|
|
||||||
|
I moved it there a while ago, now we can drop the copy of it
|
||||||
|
here.
|
||||||
|
|
||||||
|
Signed-off-by: Colin Walters <walters@verbum.org>
|
||||||
|
---
|
||||||
|
lib/src/install.rs | 2 +-
|
||||||
|
ostree-ext/src/commit.rs | 3 +-
|
||||||
|
ostree-ext/src/lib.rs | 1 -
|
||||||
|
ostree-ext/src/mountutil.rs | 60 -------------------------------------
|
||||||
|
4 files changed, 2 insertions(+), 64 deletions(-)
|
||||||
|
delete mode 100644 ostree-ext/src/mountutil.rs
|
||||||
|
|
||||||
|
diff --git a/lib/src/install.rs b/lib/src/install.rs
|
||||||
|
index 5929e4cd..d591672b 100644
|
||||||
|
--- a/lib/src/install.rs
|
||||||
|
+++ b/lib/src/install.rs
|
||||||
|
@@ -1711,7 +1711,7 @@ pub(crate) async fn install_to_filesystem(
|
||||||
|
|
||||||
|
tracing::debug!("Root filesystem: {root_path}");
|
||||||
|
|
||||||
|
- if let Some(false) = ostree_ext::mountutil::is_mountpoint(&rootfs_fd, ".")? {
|
||||||
|
+ if let Some(false) = rootfs_fd.is_mountpoint(".")? {
|
||||||
|
anyhow::bail!("Not a mountpoint: {root_path}");
|
||||||
|
}
|
||||||
|
rootfs_fd
|
||||||
|
diff --git a/ostree-ext/src/commit.rs b/ostree-ext/src/commit.rs
|
||||||
|
index babe9017..31571d1e 100644
|
||||||
|
--- a/ostree-ext/src/commit.rs
|
||||||
|
+++ b/ostree-ext/src/commit.rs
|
||||||
|
@@ -3,7 +3,6 @@
|
||||||
|
//! <https://github.com/ostreedev/ostree-rs-ext/issues/159>
|
||||||
|
|
||||||
|
use crate::container_utils::require_ostree_container;
|
||||||
|
-use crate::mountutil::is_mountpoint;
|
||||||
|
use anyhow::Context;
|
||||||
|
use anyhow::Result;
|
||||||
|
use cap_std::fs::Dir;
|
||||||
|
@@ -60,7 +59,7 @@ fn clean_subdir(root: &Dir, rootdev: u64) -> Result<()> {
|
||||||
|
}
|
||||||
|
// Also ignore bind mounts, if we have a new enough kernel with statx()
|
||||||
|
// that will tell us.
|
||||||
|
- if is_mountpoint(root, &path)?.unwrap_or_default() {
|
||||||
|
+ if root.is_mountpoint(&path)?.unwrap_or_default() {
|
||||||
|
tracing::trace!("Skipping mount point {path:?}");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
diff --git a/ostree-ext/src/lib.rs b/ostree-ext/src/lib.rs
|
||||||
|
index b962c8d6..97ec80de 100644
|
||||||
|
--- a/ostree-ext/src/lib.rs
|
||||||
|
+++ b/ostree-ext/src/lib.rs
|
||||||
|
@@ -39,7 +39,6 @@ pub mod diff;
|
||||||
|
pub mod ima;
|
||||||
|
pub mod keyfileext;
|
||||||
|
pub(crate) mod logging;
|
||||||
|
-pub mod mountutil;
|
||||||
|
pub mod ostree_prepareroot;
|
||||||
|
pub mod refescape;
|
||||||
|
#[doc(hidden)]
|
||||||
|
diff --git a/ostree-ext/src/mountutil.rs b/ostree-ext/src/mountutil.rs
|
||||||
|
deleted file mode 100644
|
||||||
|
index f73cbba2..00000000
|
||||||
|
--- a/ostree-ext/src/mountutil.rs
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,60 +0,0 @@
|
||||||
|
-//! Helpers for interacting with mounts.
|
||||||
|
-
|
||||||
|
-use std::os::fd::AsFd;
|
||||||
|
-use std::path::Path;
|
||||||
|
-
|
||||||
|
-use anyhow::Result;
|
||||||
|
-use cap_std::fs::Dir;
|
||||||
|
-use cap_std_ext::cap_std;
|
||||||
|
-
|
||||||
|
-// Fix musl support
|
||||||
|
-#[cfg(target_env = "gnu")]
|
||||||
|
-use libc::STATX_ATTR_MOUNT_ROOT;
|
||||||
|
-#[cfg(target_env = "musl")]
|
||||||
|
-const STATX_ATTR_MOUNT_ROOT: libc::c_int = 0x2000;
|
||||||
|
-
|
||||||
|
-fn is_mountpoint_impl_statx(root: &Dir, path: &Path) -> Result<Option<bool>> {
|
||||||
|
- // https://github.com/systemd/systemd/blob/8fbf0a214e2fe474655b17a4b663122943b55db0/src/basic/mountpoint-util.c#L176
|
||||||
|
- use rustix::fs::{AtFlags, StatxFlags};
|
||||||
|
-
|
||||||
|
- // SAFETY(unwrap): We can infallibly convert an i32 into a u64.
|
||||||
|
- let mountroot_flag: u64 = STATX_ATTR_MOUNT_ROOT.try_into().unwrap();
|
||||||
|
- match rustix::fs::statx(
|
||||||
|
- root.as_fd(),
|
||||||
|
- path,
|
||||||
|
- AtFlags::NO_AUTOMOUNT | AtFlags::SYMLINK_NOFOLLOW,
|
||||||
|
- StatxFlags::empty(),
|
||||||
|
- ) {
|
||||||
|
- Ok(r) => {
|
||||||
|
- let present = (r.stx_attributes_mask & mountroot_flag) > 0;
|
||||||
|
- Ok(present.then_some(r.stx_attributes & mountroot_flag > 0))
|
||||||
|
- }
|
||||||
|
- Err(e) if e == rustix::io::Errno::NOSYS => Ok(None),
|
||||||
|
- Err(e) => Err(e.into()),
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-/// Try to (heuristically) determine if the provided path is a mount root.
|
||||||
|
-pub fn is_mountpoint(root: &Dir, path: impl AsRef<Path>) -> Result<Option<bool>> {
|
||||||
|
- is_mountpoint_impl_statx(root, path.as_ref())
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-#[cfg(test)]
|
||||||
|
-mod tests {
|
||||||
|
- use super::*;
|
||||||
|
- use cap_std_ext::cap_tempfile;
|
||||||
|
-
|
||||||
|
- #[test]
|
||||||
|
- fn test_is_mountpoint() -> Result<()> {
|
||||||
|
- let root = cap_std::fs::Dir::open_ambient_dir("/", cap_std::ambient_authority())?;
|
||||||
|
- let supported = is_mountpoint(&root, Path::new("/")).unwrap();
|
||||||
|
- match supported {
|
||||||
|
- Some(r) => assert!(r),
|
||||||
|
- // If the host doesn't support statx, ignore this for now
|
||||||
|
- None => return Ok(()),
|
||||||
|
- }
|
||||||
|
- let tmpdir = cap_tempfile::TempDir::new(cap_std::ambient_authority())?;
|
||||||
|
- assert!(!is_mountpoint(&tmpdir, Path::new(".")).unwrap().unwrap());
|
||||||
|
- Ok(())
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
--
|
||||||
|
2.47.0
|
||||||
|
|
@ -2,7 +2,7 @@
|
|||||||
%bcond_with ostree_ext
|
%bcond_with ostree_ext
|
||||||
|
|
||||||
Name: bootc
|
Name: bootc
|
||||||
Version: 1.1.2
|
Version: 1.1.3
|
||||||
Release: %{autorelease}
|
Release: %{autorelease}
|
||||||
Summary: Bootable container system
|
Summary: Bootable container system
|
||||||
|
|
||||||
@ -19,6 +19,10 @@ URL: https://github.com/containers/bootc
|
|||||||
Source0: %{url}/releases/download/v%{version}/bootc-%{version}.tar.zstd
|
Source0: %{url}/releases/download/v%{version}/bootc-%{version}.tar.zstd
|
||||||
Source1: %{url}/releases/download/v%{version}/bootc-%{version}-vendor.tar.zstd
|
Source1: %{url}/releases/download/v%{version}/bootc-%{version}-vendor.tar.zstd
|
||||||
|
|
||||||
|
# Because old mock doesn't have / be a mountpoint, and this breaks
|
||||||
|
# a test case.
|
||||||
|
Patch0: 0001-tree-wide-Use-cap-std-ext-is_mountpoint-API.patch
|
||||||
|
|
||||||
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
|
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
|
||||||
ExcludeArch: %{ix86}
|
ExcludeArch: %{ix86}
|
||||||
|
|
||||||
@ -32,6 +36,8 @@ BuildRequires: rust-toolset
|
|||||||
BuildRequires: cargo-rpm-macros >= 25
|
BuildRequires: cargo-rpm-macros >= 25
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: systemd
|
BuildRequires: systemd
|
||||||
|
# For tests
|
||||||
|
BuildRequires: skopeo ostree
|
||||||
|
|
||||||
# Backing storage tooling https://github.com/containers/composefs/issues/125
|
# Backing storage tooling https://github.com/containers/composefs/issues/125
|
||||||
Requires: composefs
|
Requires: composefs
|
||||||
|
4
sources
4
sources
@ -1,2 +1,2 @@
|
|||||||
SHA512 (bootc-1.1.2.tar.zstd) = 56d96521d848fd2897f9288122e0104e7ee4e3e6b9307f627491ed810c634f5aee42b5b18630dba31b32eaa211dd4509afbc70832a69fd5094d2aceb41009c74
|
SHA512 (bootc-1.1.3-vendor.tar.zstd) = 40666f9da2ff59a85446f7137da5be5704537a82d80c581bceeec1714176ef2edccf0800ce03a5f2689d083c66686cc31973c33ef0db96ee9439492a6b563b0e
|
||||||
SHA512 (bootc-1.1.2-vendor.tar.zstd) = a563dbbdcdd6cb36fd5c6a262447c34d16a2308efbdb8e2b8bfd7cb01032552b582c13a0ccdd8f3908ab60c3293da4f59ab1335ff40bbac7aa076ebad8e73270
|
SHA512 (bootc-1.1.3.tar.zstd) = cf19102897f3f9736fe5979ff1e3be486f8d9d5e8de9f14d00555ad333f3acb61dbf3184d9453ad92cd5ac58da4384f8eef5bde16d5bdbfc83e17443c757330b
|
||||||
|
Loading…
Reference in New Issue
Block a user