diff --git a/GOVERNANCE.md b/GOVERNANCE.md index c3276f5be..13e8ab007 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -37,7 +37,7 @@ The Bootc and its leadership embrace the following values: ## Maintainers -Bootc Maintainers have "gated" write acess to the [project GitHub repository](https://github.com/bootc-dev/bootc). +Bootc Maintainers have "gated" write access to the [project GitHub repository](https://github.com/bootc-dev/bootc). The current maintainers can be found in [MAINTAINERS.md](./MAINTAINERS.md). Direct pushes to the code is never allowed. All pull requests require review by a maintainer diff --git a/crates/etc-merge/src/lib.rs b/crates/etc-merge/src/lib.rs index 6f32d4af5..9f687fc6d 100644 --- a/crates/etc-merge/src/lib.rs +++ b/crates/etc-merge/src/lib.rs @@ -577,14 +577,14 @@ fn create_dir_with_perms( if new_inode.is_none() { // Here we use `create_dir_all` to create every parent as we will set the permissions later // on. Due to the fact that we have an ordered (sorted) list of directories and directory - // entries and we have a DFS traversal, we will aways have directory creation starting from + // entries and we have a DFS traversal, we will always have directory creation starting from // the parent anyway. // // The exception being, if a directory is modified in the current_etc, and a new directory - // is added inside the modified directory, say `dir/prems` has its premissions modified and + // is added inside the modified directory, say `dir/prems` has its permissions modified and // `dir/prems/new` is the new directory created. Since we handle added files/directories first, // we will create the directories `perms/new` with directory `new` also getting its - // permissions set, but `perms` will not. `perms` will have its premissions set up when we + // permissions set, but `perms` will not. `perms` will have its permissions set up when we // handle the modified directories. new_etc_fd .create_dir_all(&dir_name) diff --git a/crates/lib/src/bootc_composefs/boot.rs b/crates/lib/src/bootc_composefs/boot.rs index 67d9f15a9..30ecc5ccc 100644 --- a/crates/lib/src/bootc_composefs/boot.rs +++ b/crates/lib/src/bootc_composefs/boot.rs @@ -96,7 +96,7 @@ use rustix::{mount::MountFlags, path::Arg}; use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use crate::bootc_kargs::kargs_from_composefs_filesystem; +use crate::bootc_kargs::compute_new_kargs; use crate::composefs_consts::{TYPE1_ENT_PATH, TYPE1_ENT_PATH_STAGED}; use crate::parsers::bls_config::{BLSConfig, BLSConfigType}; use crate::parsers::grub_menuconfig::MenuEntry; @@ -564,7 +564,7 @@ pub(crate) fn setup_composefs_bls_boot( None }; - kargs_from_composefs_filesystem(mounted_erofs, current_root, &mut cmdline_refs)?; + compute_new_kargs(mounted_erofs, current_root, &mut cmdline_refs)?; let (entry_paths, _tmpdir_guard) = match bootloader { Bootloader::Grub => { @@ -675,9 +675,8 @@ pub(crate) fn setup_composefs_bls_boot( } } - let shared_entry = shared_entry.ok_or_else(|| { - anyhow::anyhow!("Could not get symlink to BLS boot entry") - })?; + let shared_entry = shared_entry + .ok_or_else(|| anyhow::anyhow!("Shared boot binaries not found"))?; match bls_config.cfg_type { BLSConfigType::NonEFI { diff --git a/crates/lib/src/bootc_composefs/delete.rs b/crates/lib/src/bootc_composefs/delete.rs index f1a31101c..b032ce767 100644 --- a/crates/lib/src/bootc_composefs/delete.rs +++ b/crates/lib/src/bootc_composefs/delete.rs @@ -51,7 +51,7 @@ fn delete_type1_entry(depl: &DeploymentEntry, boot_dir: &Dir, deleting_staged: b if !file_name.ends_with(".conf") { // We don't put any non .conf file in the entries dir // This is here just for sanity - tracing::debug!("Found non .conf file '{file_name}' in entires dir"); + tracing::debug!("Found non .conf file '{file_name}' in entries dir"); continue; } diff --git a/crates/lib/src/bootc_composefs/state.rs b/crates/lib/src/bootc_composefs/state.rs index 196e83284..e70defd5e 100644 --- a/crates/lib/src/bootc_composefs/state.rs +++ b/crates/lib/src/bootc_composefs/state.rs @@ -239,7 +239,7 @@ pub(crate) fn composefs_usr_overlay() -> Result<()> { .context("Failed to get mount details for /usr")?; let is_usr_mounted = - is_usr_mounted.ok_or_else(|| anyhow::anyhow!("Falied to get mountinfo"))?; + is_usr_mounted.ok_or_else(|| anyhow::anyhow!("Failed to get mountinfo"))?; if is_usr_mounted { println!("A writeable overlayfs is already mounted on /usr"); diff --git a/crates/lib/src/bootc_composefs/switch.rs b/crates/lib/src/bootc_composefs/switch.rs index 8b8a232ec..4f0190f54 100644 --- a/crates/lib/src/bootc_composefs/switch.rs +++ b/crates/lib/src/bootc_composefs/switch.rs @@ -64,7 +64,7 @@ pub(crate) async fn switch_composefs( UpdateAction::UpdateOrigin => { // The staged image will never be the current image's verity digest - println!("Image already in compoesfs repository"); + println!("Image already in composefs repository"); println!("Updating target image reference"); return update_target_imgref_in_origin(storage, booted_cfs, &target_imgref); } diff --git a/crates/lib/src/bootc_composefs/update.rs b/crates/lib/src/bootc_composefs/update.rs index 654b0c258..37578fad4 100644 --- a/crates/lib/src/bootc_composefs/update.rs +++ b/crates/lib/src/bootc_composefs/update.rs @@ -144,8 +144,9 @@ pub(crate) fn validate_update( // This could be someone trying to `bootc switch ` where // remote_image is the exact same image as the one currently booted, but // they are wanting to change the target + // We just update the image origin file here // - // We could simply update the image origin file here + // If it's not a switch op, then we skip the update if image_id.to_hex() == *booted_cfs.cmdline.digest { let ret = if is_switch { UpdateAction::UpdateOrigin diff --git a/crates/lib/src/bootc_kargs.rs b/crates/lib/src/bootc_kargs.rs index 8aaf991a4..50f0c09b5 100644 --- a/crates/lib/src/bootc_kargs.rs +++ b/crates/lib/src/bootc_kargs.rs @@ -73,8 +73,22 @@ fn compute_apply_kargs_diff( } } -/// Looks for files in usr/lib/bootc/kargs.d and parses cmdline agruments -pub(crate) fn kargs_from_composefs_filesystem( +/// Computes new kernel arguments by applying the diff between existing and new kargs.d files. +/// +/// This function: +/// 1. Loads kernel arguments from `usr/lib/bootc/kargs.d` in the new filesystem +/// 2. Loads kernel arguments from the current root (if present) +/// 3. Computes the difference between them (added/removed arguments) +/// 4. Applies that difference to the provided `new_kargs` cmdline +/// +/// This allows bootc to maintain user customizations while applying changes from +/// updated container images. +/// +/// # Arguments +/// * `new_fs` - Directory handle to the new filesystem containing kargs.d files +/// * `current_root` - Optional directory handle to current root filesystem +/// * `new_kargs` - Mutable cmdline that will be modified with the computed diff +pub(crate) fn compute_new_kargs( new_fs: &Dir, current_root: Option<&Dir>, new_kargs: &mut Cmdline, diff --git a/crates/lib/src/composefs_consts.rs b/crates/lib/src/composefs_consts.rs index c9e6f7512..941fc6fed 100644 --- a/crates/lib/src/composefs_consts.rs +++ b/crates/lib/src/composefs_consts.rs @@ -1,6 +1,6 @@ #![allow(dead_code)] -/// composefs= paramter in kernel cmdline +/// composefs= parameter in kernel cmdline pub const COMPOSEFS_CMDLINE: &str = "composefs"; /// Directory to store transient state, such as staged deployemnts etc diff --git a/crates/lib/src/install.rs b/crates/lib/src/install.rs index 12e65c599..a1e5b2b71 100644 --- a/crates/lib/src/install.rs +++ b/crates/lib/src/install.rs @@ -1550,7 +1550,7 @@ async fn install_with_sysroot( } tracing::debug!("Installed bootloader"); - tracing::debug!("Perfoming post-deployment operations"); + tracing::debug!("Performing post-deployment operations"); match bound_images { BoundImages::Skip => {} @@ -1951,7 +1951,7 @@ pub enum Cleanup { TriggerOnNextBoot, } -/// Implementation of the `bootc install to-filsystem` CLI command. +/// Implementation of the `bootc install to-filesystem` CLI command. #[context("Installing to filesystem")] pub(crate) async fn install_to_filesystem( opts: InstallToFilesystemOpts, @@ -2154,7 +2154,7 @@ pub(crate) async fn install_to_filesystem( let rootarg = format!("root={}", root_info.mount_spec); let mut boot = if let Some(spec) = fsopts.boot_mount_spec { - // An empty boot mount spec signals to ommit the mountspec kargs + // An empty boot mount spec signals to omit the mountspec kargs // See https://github.com/bootc-dev/bootc/issues/1441 if spec.is_empty() { None diff --git a/crates/lib/src/parsers/grub_menuconfig.rs b/crates/lib/src/parsers/grub_menuconfig.rs index 41e25554c..e9362a6d9 100644 --- a/crates/lib/src/parsers/grub_menuconfig.rs +++ b/crates/lib/src/parsers/grub_menuconfig.rs @@ -186,7 +186,7 @@ fn parse_menuentry(input: &str) -> IResult<&str, MenuEntry<'_>> { // Skip any whitespace after title let (input, _) = multispace0.parse(input)?; - // Eat up everything insde { .. } + // Eat up everything inside { .. } let (input, body) = delimited( tag("{"), take_until_balanced_allow_nested('{', '}'), diff --git a/crates/lib/src/spec.rs b/crates/lib/src/spec.rs index 83fd0b3ab..86b8556a1 100644 --- a/crates/lib/src/spec.rs +++ b/crates/lib/src/spec.rs @@ -167,7 +167,7 @@ pub struct BootEntryOstree { clap::ValueEnum, Debug, Default, Clone, Serialize, Deserialize, PartialEq, Eq, JsonSchema, )] pub enum Bootloader { - /// Use Grub as the booloader + /// Use Grub as the bootloader #[default] Grub, /// Use SystemdBoot as the bootloader diff --git a/crates/lib/src/store/mod.rs b/crates/lib/src/store/mod.rs index 4779093c5..b5a098fbf 100644 --- a/crates/lib/src/store/mod.rs +++ b/crates/lib/src/store/mod.rs @@ -269,7 +269,7 @@ pub(crate) struct Storage { ostree: OnceCell, /// The composefs storage composefs: OnceCell>, - /// The containers-image storage used foR LBIs + /// The containers-image storage used for LBIs imgstore: OnceCell, } diff --git a/crates/ostree-ext/src/chunking.rs b/crates/ostree-ext/src/chunking.rs index 07366f06d..26588e26d 100644 --- a/crates/ostree-ext/src/chunking.rs +++ b/crates/ostree-ext/src/chunking.rs @@ -932,7 +932,7 @@ mod test { #[test] fn test_advanced_packing() -> Result<()> { - // Step1 : Initial build (Packing sructure computed) + // Step1 : Initial build (Packing structure computed) let contentmeta_v0: Vec = vec![ vec![1, u32::MAX, 100000], vec![2, u32::MAX, 99999], diff --git a/crates/ostree-ext/src/cli.rs b/crates/ostree-ext/src/cli.rs index 119cea41e..b2b523059 100644 --- a/crates/ostree-ext/src/cli.rs +++ b/crates/ostree-ext/src/cli.rs @@ -36,17 +36,17 @@ use crate::sysroot::SysrootLock; use ostree_container::store::{ImageImporter, PrepareResult}; use serde::{Deserialize, Serialize}; -/// Parse an [`OstreeImageReference`] from a CLI arguemnt. +/// Parse an [`OstreeImageReference`] from a CLI argument. pub fn parse_imgref(s: &str) -> Result { OstreeImageReference::try_from(s) } -/// Parse a base [`ImageReference`] from a CLI arguemnt. +/// Parse a base [`ImageReference`] from a CLI argument. pub fn parse_base_imgref(s: &str) -> Result { ImageReference::try_from(s) } -/// Parse an [`ostree::Repo`] from a CLI arguemnt. +/// Parse an [`ostree::Repo`] from a CLI argument. pub fn parse_repo(s: &Utf8Path) -> Result { let repofd = cap_std::fs::Dir::open_ambient_dir(s, cap_std::ambient_authority()) .with_context(|| format!("Opening directory at '{s}'"))?; diff --git a/crates/ostree-ext/src/tar/export.rs b/crates/ostree-ext/src/tar/export.rs index 9262c3d09..976e9056f 100644 --- a/crates/ostree-ext/src/tar/export.rs +++ b/crates/ostree-ext/src/tar/export.rs @@ -494,7 +494,7 @@ impl<'a, W: std::io::Write> OstreeTarWriter<'a, W> { } else { false }; - // Link sizes shoud always be zero + // Link sizes should always be zero h.set_size(0); if is_regular_zerosized { self.out.append_data(&mut h, dest, &mut std::io::empty())?; diff --git a/tmt/tests/booted/test-logically-bound-switch.nu b/tmt/tests/booted/test-logically-bound-switch.nu index 09dc1d999..7e579ed69 100644 --- a/tmt/tests/booted/test-logically-bound-switch.nu +++ b/tmt/tests/booted/test-logically-bound-switch.nu @@ -9,7 +9,7 @@ # # # bootc upgrade -# +# # #