Skip to content

Commit 47b7a43

Browse files
committed
Update to latest composefs-rs
Using the new "single export from cfsctl" simplifies our Cargo.toml because we no longer need to reference the same git hash 3-4 times. Signed-off-by: Colin Walters <walters@verbum.org>
1 parent 015903b commit 47b7a43

File tree

28 files changed

+95
-79
lines changed

28 files changed

+95
-79
lines changed

Cargo.lock

Lines changed: 8 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,11 @@ cfg-if = "1.0"
4040
chrono = { version = "0.4.38", default-features = false }
4141
clap = "4.5.4"
4242
clap_mangen = { version = "0.2.20" }
43-
# Reviewers (including AI tools): The composefs-rs git revision is duplicated for each crate.
44-
# If adding/removing crates here, also update docs/Dockerfile.mdbook and docs/src/internals.md.
45-
#
4643
# To develop against a local composefs-rs checkout, add a [patch] section at the end of this file:
47-
# [patch."https://github.com/containers/composefs-rs"]
48-
# composefs = { path = "/home/user/src/composefs-rs/crates/composefs" }
49-
# composefs-boot = { path = "/home/user/src/composefs-rs/crates/composefs-boot" }
50-
# composefs-oci = { path = "/home/user/src/composefs-rs/crates/composefs-oci" }
44+
# [patch."https://github.com/composefs/composefs-rs"]
45+
# cfsctl = { path = "/path/to/composefs-rs/crates/cfsctl" }
5146
# The Justfile will auto-detect these and bind-mount them into container builds.
52-
composefs = { git = "https://github.com/composefs/composefs-rs", rev = "b928c6bd6c051e111d3efc3d25cdaf9159182ed0", package = "composefs", features = ["rhel9"] }
53-
cfsctl = { git = "https://github.com/composefs/composefs-rs", rev = "b928c6bd6c051e111d3efc3d25cdaf9159182ed0", package = "cfsctl", features = ["rhel9"] }
54-
composefs-boot = { git = "https://github.com/composefs/composefs-rs", rev = "b928c6bd6c051e111d3efc3d25cdaf9159182ed0", package = "composefs-boot" }
55-
composefs-oci = { git = "https://github.com/composefs/composefs-rs", rev = "b928c6bd6c051e111d3efc3d25cdaf9159182ed0", package = "composefs-oci" }
47+
cfsctl = { git = "https://github.com/composefs/composefs-rs", rev = "2203e8f", package = "cfsctl", features = ["rhel9"] }
5648
fn-error-context = "0.2.1"
5749
hex = "0.4.3"
5850
indicatif = "0.18.0"

crates/etc-merge/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ rustix = { workspace = true }
1212
openssl = { workspace = true }
1313
hex = { workspace = true }
1414
tracing = { workspace = true }
15-
composefs = { workspace = true }
15+
cfsctl = { workspace = true }
1616
fn-error-context = { workspace = true }
1717
owo-colors = { workspace = true }
1818
anstream = { workspace = true }

crates/etc-merge/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use anyhow::Context;
1717
use cap_std_ext::cap_std;
1818
use cap_std_ext::cap_std::fs::{Dir as CapStdDir, MetadataExt, Permissions, PermissionsExt};
1919
use cap_std_ext::dirext::CapStdExtDirExt;
20+
use cfsctl::composefs;
2021
use composefs::fsverity::{FsVerityHashValue, Sha256HashValue, Sha512HashValue};
2122
use composefs::generic_tree::{Directory, Inode, Leaf, LeafContent, Stat};
2223
use composefs::tree::ImageError;

crates/initramfs/Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ clap = { workspace = true, features = ["std", "help", "usage", "derive"] }
1111
libc.workspace = true
1212
rustix.workspace = true
1313
serde = { workspace = true, features = ["derive"] }
14-
composefs.workspace = true
15-
composefs-boot.workspace = true
14+
cfsctl.workspace = true
1615
toml.workspace = true
1716
fn-error-context.workspace = true
1817
bootc-kernel-cmdline = { path = "../kernel_cmdline", version = "0.0.0" }
@@ -22,5 +21,5 @@ workspace = true
2221

2322
[features]
2423
default = ['pre-6.15']
25-
rhel9 = ['composefs/rhel9']
26-
'pre-6.15' = ['composefs/pre-6.15']
24+
rhel9 = ['cfsctl/rhel9']
25+
'pre-6.15' = ['cfsctl/pre-6.15']

crates/initramfs/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use rustix::{
2121
};
2222
use serde::Deserialize;
2323

24+
use cfsctl::composefs;
25+
use cfsctl::composefs_boot;
2426
use composefs::{
2527
fsverity::{FsVerityHashValue, Sha512HashValue},
2628
mount::FsHandle,

crates/lib/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ chrono = { workspace = true, features = ["serde"] }
3535
clap = { workspace = true, features = ["derive","cargo"] }
3636
clap_complete = "4"
3737
clap_mangen = { workspace = true, optional = true }
38-
composefs = { workspace = true }
3938
cfsctl = { workspace = true }
40-
composefs-boot = { workspace = true }
41-
composefs-oci = { workspace = true }
4239
fn-error-context = { workspace = true }
4340
hex = { workspace = true }
4441
indicatif = { workspace = true }

crates/lib/src/bootc_composefs/boot.rs

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -74,19 +74,21 @@ use cap_std_ext::{
7474
cap_std::{ambient_authority, fs::Dir},
7575
dirext::CapStdExtDirExt,
7676
};
77+
use cfsctl::composefs;
78+
use cfsctl::composefs_boot;
79+
use cfsctl::composefs_oci;
7780
use clap::ValueEnum;
7881
use composefs::fs::read_file;
82+
use composefs::fsverity::{FsVerityHashValue, Sha512HashValue};
7983
use composefs::tree::RegularFile;
8084
use composefs_boot::BootOps;
81-
use composefs_boot::bootloader::{EFI_ADDON_DIR_EXT, EFI_ADDON_FILE_EXT, EFI_EXT, PEType};
82-
use fn_error_context::context;
83-
use ostree_ext::composefs::fsverity::{FsVerityHashValue, Sha512HashValue};
84-
use ostree_ext::composefs_boot::bootloader::UsrLibModulesVmlinuz;
85-
use ostree_ext::composefs_boot::{
86-
bootloader::BootEntry as ComposefsBootEntry, cmdline::get_cmdline_composefs,
87-
os_release::OsReleaseInfo, uki,
85+
use composefs_boot::bootloader::{
86+
BootEntry as ComposefsBootEntry, EFI_ADDON_DIR_EXT, EFI_ADDON_FILE_EXT, EFI_EXT, PEType,
87+
UsrLibModulesVmlinuz,
8888
};
89-
use ostree_ext::composefs_oci::image::create_filesystem as create_composefs_filesystem;
89+
use composefs_boot::{cmdline::get_cmdline_composefs, os_release::OsReleaseInfo, uki};
90+
use composefs_oci::image::create_filesystem as create_composefs_filesystem;
91+
use fn_error_context::context;
9092
use rustix::{mount::MountFlags, path::Arg};
9193
use schemars::JsonSchema;
9294
use serde::{Deserialize, Serialize};
@@ -333,10 +335,10 @@ fn compute_boot_digest(
333335
/// * repo - The composefs repository
334336
#[context("Computing boot digest")]
335337
pub(crate) fn compute_boot_digest_uki(uki: &[u8]) -> Result<String> {
336-
let vmlinuz = composefs_boot::uki::get_section(uki, ".linux")
337-
.ok_or_else(|| anyhow::anyhow!(".linux not present"))??;
338+
let vmlinuz =
339+
uki::get_section(uki, ".linux").ok_or_else(|| anyhow::anyhow!(".linux not present"))??;
338340

339-
let initramfs = composefs_boot::uki::get_section(uki, ".initrd")
341+
let initramfs = uki::get_section(uki, ".initrd")
340342
.ok_or_else(|| anyhow::anyhow!(".initrd not present"))??;
341343

342344
let mut hasher = openssl::hash::Hasher::new(openssl::hash::MessageDigest::sha256())

crates/lib/src/bootc_composefs/digest.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use anyhow::{Context, Result};
88
use camino::Utf8Path;
99
use cap_std_ext::cap_std;
1010
use cap_std_ext::cap_std::fs::Dir;
11+
use cfsctl::composefs;
12+
use cfsctl::composefs_boot;
1113
use composefs::dumpfile;
1214
use composefs::fsverity::FsVerityHashValue;
1315
use composefs_boot::BootOps as _;

crates/lib/src/bootc_composefs/export.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ use std::{fs::File, os::fd::AsRawFd};
22

33
use anyhow::{Context, Result};
44
use cap_std_ext::cap_std::{ambient_authority, fs::Dir};
5+
use cfsctl::composefs;
6+
use cfsctl::composefs_oci;
57
use composefs::splitstream::SplitStreamData;
68
use composefs_oci::open_config;
79
use ocidir::{OciDir, oci_spec::image::Platform};

0 commit comments

Comments
 (0)