Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ validate-rust:
cargo test --no-run
(cd crates/ostree-ext && cargo check --no-default-features)
(cd crates/lib && cargo check --no-default-features)
cargo check --features=composefs-backend
cargo clippy -- $(CLIPPY_CONFIG)
env RUSTDOCFLAGS='-D warnings' cargo doc --lib
.PHONY: validate-rust
Expand Down
9 changes: 5 additions & 4 deletions crates/etc-merge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ use cap_std_ext::dirext::CapStdExtDirExt;
use composefs::fsverity::{FsVerityHashValue, Sha256HashValue, Sha512HashValue};
use composefs::generic_tree::{Directory, Inode, Leaf, LeafContent, Stat};
use composefs::tree::ImageError;
use rustix::fs::{AtFlags, Gid, Uid, XattrFlags, lgetxattr, llistxattr, lsetxattr, readlinkat};
use rustix::fs::{
AtFlags, Gid, Uid, XattrFlags, lgetxattr, llistxattr, lsetxattr, readlinkat, symlinkat,
};

/// Metadata associated with a file, directory, or symlink entry.
#[derive(Debug)]
Expand Down Expand Up @@ -627,9 +629,8 @@ fn merge_leaf(
.context(format!("Deleting {file:?}"))?;

if let Some(target) = symlink {
new_etc_fd
.symlink(target.as_ref(), &file)
.context(format!("Creating symlink {file:?}"))?;
// Using rustix's symlinkat here as we might have absolute symlinks which clash with ambient_authority
symlinkat(&**target, new_etc_fd, file).context(format!("Creating symlink {file:?}"))?;
} else {
current_etc_fd
.copy(&file, new_etc_fd, &file)
Expand Down
3 changes: 2 additions & 1 deletion crates/initramfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,9 @@ pub fn mount_at_wrapper(
.with_context(|| format!("Mounting at path {path:?}"))
}

/// Wrapper around [`rustix::fs::openat`]
#[context("Opening dir {name:?}")]
fn open_dir(dirfd: impl AsFd, name: impl AsRef<Path> + Debug) -> Result<OwnedFd> {
pub fn open_dir(dirfd: impl AsFd, name: impl AsRef<Path> + Debug) -> Result<OwnedFd> {
let res = openat(
dirfd,
name.as_ref(),
Expand Down
5 changes: 5 additions & 0 deletions crates/kernel_cmdline/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,8 @@

pub mod bytes;
pub mod utf8;

/// This is used by dracut.
pub const INITRD_ARG_PREFIX: &str = "rd.";
/// The kernel argument for configuring the rootfs flags.
pub const ROOTFLAGS: &str = "rootflags";
1 change: 1 addition & 0 deletions crates/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ bootc-tmpfiles = { path = "../tmpfiles" }
bootc-utils = { package = "bootc-internal-utils", path = "../utils", version = "0.0.0" }
ostree-ext = { path = "../ostree-ext", features = ["bootc"] }
etc-merge = { path = "../etc-merge" }
bootc-initramfs-setup = { path = "../initramfs" }

# Workspace dependencies
anstream = { workspace = true }
Expand Down
Loading