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
7 changes: 4 additions & 3 deletions crates/initramfs/src/mount.rs → crates/initramfs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ pub struct Args {
pub target: Option<PathBuf>,
}

// Helpers
fn mount_at_wrapper(
/// Wrapper around [`composefs::mount::mount_at`]
pub fn mount_at_wrapper(
fs_fd: impl AsFd,
dirfd: impl AsFd,
path: impl path::Arg + Debug + Clone,
Expand Down Expand Up @@ -242,7 +242,8 @@ fn mount_subdir(
}

#[context("GPT workaround")]
pub(crate) fn gpt_workaround() -> Result<()> {
/// Workaround for /dev/gpt-auto-root
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since this function is now part of a public library API, the documentation could be more descriptive. It would be helpful to explain what the workaround entails and why it is necessary, including a reference to the underlying issue. This will provide better context for developers using this library.

/// Workaround for a systemd issue where `/dev/gpt-auto-root` is not correctly handled.
/// See: https://github.com/systemd/systemd/issues/35017

pub fn gpt_workaround() -> Result<()> {
// https://github.com/systemd/systemd/issues/35017
let rootdev = stat("/dev/gpt-auto-root");

Expand Down
4 changes: 1 addition & 3 deletions crates/initramfs/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
//! Code for bootc that goes into the initramfs.
// SPDX-License-Identifier: Apache-2.0 OR MIT

mod mount;

use anyhow::Result;

use bootc_initramfs_setup::{gpt_workaround, setup_root, Args};
use clap::Parser;
use mount::{gpt_workaround, setup_root, Args};

fn main() -> Result<()> {
let args = Args::parse();
Expand Down