Skip to content

Commit b636b43

Browse files
initramfs: Convert to library
Create a lib.rs as we'd like to utilize these functions elsewhere in the codebase Signed-off-by: Johan-Liebert1 <[email protected]>
1 parent 7434b0f commit b636b43

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

crates/initramfs/src/mount.rs renamed to crates/initramfs/src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ pub struct Args {
102102
pub target: Option<PathBuf>,
103103
}
104104

105-
// Helpers
106-
fn mount_at_wrapper(
105+
/// Wrapper around [`composefs::mount::mount_at`]
106+
pub fn mount_at_wrapper(
107107
fs_fd: impl AsFd,
108108
dirfd: impl AsFd,
109109
path: impl path::Arg + Debug + Clone,
@@ -242,7 +242,8 @@ fn mount_subdir(
242242
}
243243

244244
#[context("GPT workaround")]
245-
pub(crate) fn gpt_workaround() -> Result<()> {
245+
/// Workaround for /dev/gpt-auto-root
246+
pub fn gpt_workaround() -> Result<()> {
246247
// https://github.com/systemd/systemd/issues/35017
247248
let rootdev = stat("/dev/gpt-auto-root");
248249

crates/initramfs/src/main.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
//! Code for bootc that goes into the initramfs.
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
33

4-
mod mount;
5-
64
use anyhow::Result;
75

6+
use bootc_initramfs_setup::{gpt_workaround, setup_root, Args};
87
use clap::Parser;
9-
use mount::{gpt_workaround, setup_root, Args};
108

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

0 commit comments

Comments
 (0)