Skip to content

Commit 06a643c

Browse files
authored
Merge pull request #1486 from cgwalters/kernel-cleanups-2-rename
kernel args: Shuffle module names
2 parents a279555 + 1cbfdc8 commit 06a643c

File tree

7 files changed

+14
-11
lines changed

7 files changed

+14
-11
lines changed

crates/lib/src/kargs.rs renamed to crates/lib/src/bootc_kargs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! This module handles the bootc-owned kernel argument lists in `/usr/lib/bootc/kargs.d`.
12
use anyhow::{Context, Result};
23
use camino::Utf8Path;
34
use cap_std_ext::cap_std::fs::Dir;
@@ -15,6 +16,7 @@ use serde::Deserialize;
1516
use crate::deploy::ImageState;
1617
use crate::store::Storage;
1718

19+
/// The relative path to the kernel arguments which may be embedded in an image.
1820
const KARGS_PATH: &str = "usr/lib/bootc/kargs.d";
1921

2022
/// The kargs.d configuration file.

crates/lib/src/deploy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ async fn deploy(
538538
// is a distinct minor issue, but not super important as right now the install path
539539
// doesn't use this API).
540540
let override_kargs = if let Some(deployment) = merge_deployment {
541-
Some(crate::kargs::get_kargs(sysroot, &deployment, image)?)
541+
Some(crate::bootc_kargs::get_kargs(sysroot, &deployment, image)?)
542542
} else {
543543
None
544544
};

crates/lib/src/install.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use self::baseline::InstallBlockDeviceOpts;
5555
use crate::boundimage::{BoundImage, ResolvedBoundImage};
5656
use crate::containerenv::ContainerExecutionInfo;
5757
use crate::deploy::{prepare_for_pull, pull_from_prepared, PreparedImportMeta, PreparedPullResult};
58-
use crate::kernel::Cmdline;
58+
use crate::kernel_cmdline::Cmdline;
5959
use crate::lsm;
6060
use crate::progress_jsonl::ProgressWriter;
6161
use crate::spec::ImageReference;
@@ -817,7 +817,7 @@ async fn install_container(
817817
.repo()
818818
.read_commit(pulled_image.ostree_commit.as_str(), gio::Cancellable::NONE)?
819819
.0;
820-
let kargsd = crate::kargs::get_kargs_from_ostree_root(
820+
let kargsd = crate::bootc_kargs::get_kargs_from_ostree_root(
821821
&sysroot.repo(),
822822
merged_ostree_root.downcast_ref().unwrap(),
823823
std::env::consts::ARCH,
@@ -1668,10 +1668,11 @@ fn find_root_args_to_inherit(cmdline: &Cmdline, root_info: &Filesystem) -> Resul
16681668
.context("Parsing root= karg")?;
16691669
// If we have a root= karg, then use that
16701670
let (mount_spec, kargs) = if let Some(root) = root {
1671-
let rootflags = cmdline.find(crate::kernel::ROOTFLAGS);
1672-
let inherit_kargs = cmdline
1673-
.iter()
1674-
.filter(|arg| arg.key.starts_with(crate::kernel::INITRD_ARG_PREFIX));
1671+
let rootflags = cmdline.find(crate::kernel_cmdline::ROOTFLAGS);
1672+
let inherit_kargs = cmdline.iter().filter(|arg| {
1673+
arg.key
1674+
.starts_with(crate::kernel_cmdline::INITRD_ARG_PREFIX)
1675+
});
16751676
(
16761677
root.to_owned(),
16771678
rootflags

crates/lib/src/install/completion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn reconcile_kargs(sysroot: &ostree::Sysroot, deployment: &ostree::Deployment) -
6565
.flatten()
6666
.map(|s| s.as_str())
6767
.collect::<Vec<_>>();
68-
let kargsd = crate::kargs::get_kargs_in_root(deployment_root, std::env::consts::ARCH)?;
68+
let kargsd = crate::bootc_kargs::get_kargs_in_root(deployment_root, std::env::consts::ARCH)?;
6969
let kargsd = kargsd.iter().map(|s| s.as_str()).collect::<Vec<_>>();
7070

7171
current_kargs.append_argv(&install_config_kargs);
File renamed without changes.

crates/lib/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
//! to provide a fully "container native" tool for using
55
//! bootable container images.
66
7+
pub(crate) mod bootc_kargs;
78
mod boundimage;
89
mod cfsctl;
910
pub mod cli;
@@ -15,7 +16,6 @@ mod image;
1516
mod imgstorage;
1617
pub(crate) mod journal;
1718
mod k8sapitypes;
18-
pub(crate) mod kargs;
1919
mod lints;
2020
mod lsm;
2121
pub(crate) mod metadata;
@@ -34,7 +34,7 @@ mod docgen;
3434
mod bootloader;
3535
mod containerenv;
3636
mod install;
37-
mod kernel;
37+
mod kernel_cmdline;
3838

3939
#[cfg(feature = "grub")]
4040
pub(crate) mod parsers;

crates/lib/src/lints.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ static LINT_KARGS: Lint = Lint::new_fatal(
465465
check_parse_kargs,
466466
);
467467
fn check_parse_kargs(root: &Dir, _config: &LintExecutionConfig) -> LintResult {
468-
let args = crate::kargs::get_kargs_in_root(root, ARCH)?;
468+
let args = crate::bootc_kargs::get_kargs_in_root(root, ARCH)?;
469469
tracing::debug!("found kargs: {args:?}");
470470
lint_ok()
471471
}

0 commit comments

Comments
 (0)