From 4678bf6df7aa96e83e04ba2ce0a524a820162aed Mon Sep 17 00:00:00 2001 From: Johan-Liebert1 Date: Thu, 1 Oct 2026 18:13:38 +0530 Subject: [PATCH 1/2] install: Minor refactor Simplify match statement and remove rebase conflict marker Signed-off-by: Johan-Liebert1 --- crates/lib/src/install.rs | 40 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/crates/lib/src/install.rs b/crates/lib/src/install.rs index 3ee6660b0..9d0b2cbd4 100644 --- a/crates/lib/src/install.rs +++ b/crates/lib/src/install.rs @@ -1817,32 +1817,24 @@ async fn prepare_install( // // NOTE: This isn't really 100% accurate 100% of the time as the cmdline can be in an addon if let Some(root_filesystem) = root_filesystem { - match kernel { - Some(k) => match k.k_type { - crate::kernel::KernelType::Uki { cmdline, .. } => { - let allow_missing_fsverity = if let Some(cmdline) = cmdline { - ComposefsCmdline::find_in_cmdline(&cmdline)? - .is_some_and(|cfs_cmdline| cfs_cmdline.allow_missing_fsverity) - } else { - false - }; - // >>>>>>> 626befdf (install: Handle root filesystem) - - if !allow_missing_fsverity { - anyhow::ensure!( - root_filesystem.supports_fsverity(), - "Specified filesystem {root_filesystem} does not support fs-verity" - ); - } - - composefs_options.allow_missing_verity = allow_missing_fsverity; - is_uki = true; - } + if let Some(k) = kernel + && let crate::kernel::KernelType::Uki { cmdline, .. } = k.k_type + { + let allow_missing_fsverity = match cmdline { + Some(cmdline) => ComposefsCmdline::find_in_cmdline(&cmdline)? + .is_some_and(|cfs_cmdline| cfs_cmdline.allow_missing_fsverity), + None => false, + }; - crate::kernel::KernelType::Vmlinuz { .. } => {} - }, + if !allow_missing_fsverity { + anyhow::ensure!( + root_filesystem.supports_fsverity(), + "Specified filesystem {root_filesystem} does not support fs-verity" + ); + } - None => {} + composefs_options.allow_missing_verity = allow_missing_fsverity; + is_uki = true; } // If `--allow-missing-verity` is already passed via CLI, don't modify From d69d82305abafafa57b227255bcf4608cd30def9 Mon Sep 17 00:00:00 2001 From: Johan-Liebert1 Date: Thu, 1 Oct 2026 18:19:44 +0530 Subject: [PATCH 2/2] project: Fix typos across project Signed-off-by: Johan-Liebert1 --- .../lib/src/bootc_composefs/backwards_compat/bcompat_boot.rs | 2 +- crates/lib/src/bootc_composefs/finalize.rs | 2 +- crates/lib/src/bootc_composefs/selinux.rs | 2 +- crates/lib/src/bootc_composefs/soft_reboot.rs | 4 ++-- crates/lib/src/bootc_composefs/status.rs | 4 ++-- crates/lib/src/bootc_composefs/update.rs | 2 +- crates/lib/src/cli.rs | 2 +- crates/lib/src/install.rs | 2 +- crates/lib/src/install/baseline.rs | 4 ++-- crates/ostree-ext/src/tar/write.rs | 2 +- tmt/tests/booted/test-install-repart.nu | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/lib/src/bootc_composefs/backwards_compat/bcompat_boot.rs b/crates/lib/src/bootc_composefs/backwards_compat/bcompat_boot.rs index bf203c0d4..f89fcbfb6 100644 --- a/crates/lib/src/bootc_composefs/backwards_compat/bcompat_boot.rs +++ b/crates/lib/src/bootc_composefs/backwards_compat/bcompat_boot.rs @@ -175,7 +175,7 @@ fn stage_bls_entry_changes( .unwrap_or("bootc"); // to not add duplicate transactions since we share BLS entries - // across deployements + // across deployments let mut fixed = vec![]; let mut new_bls_entries = vec![]; diff --git a/crates/lib/src/bootc_composefs/finalize.rs b/crates/lib/src/bootc_composefs/finalize.rs index eec182594..642e8d6d4 100644 --- a/crates/lib/src/bootc_composefs/finalize.rs +++ b/crates/lib/src/bootc_composefs/finalize.rs @@ -153,7 +153,7 @@ pub(crate) async fn composefs_backend_finalize( } }; - // Now that we have successfully updated bootloader entires, we can GC the unreferenced ones + // Now that we have successfully updated bootloader entries, we can GC the unreferenced ones // We do not prune the composefs repository here though composefs_gc( storage, diff --git a/crates/lib/src/bootc_composefs/selinux.rs b/crates/lib/src/bootc_composefs/selinux.rs index 1949fffd1..3ea43487f 100644 --- a/crates/lib/src/bootc_composefs/selinux.rs +++ b/crates/lib/src/bootc_composefs/selinux.rs @@ -94,7 +94,7 @@ fn get_selinux_policy_for_deployment( let type_ = selinux_config .lines() .find(|l| l.starts_with(SELINUX_TYPE)) - .ok_or_else(|| anyhow::anyhow!("Falied to find SELINUXTYPE"))? + .ok_or_else(|| anyhow::anyhow!("Failed to find SELINUXTYPE"))? .split("=") .nth(1) .ok_or_else(|| anyhow::anyhow!("Failed to parse SELINUXTYPE"))? diff --git a/crates/lib/src/bootc_composefs/soft_reboot.rs b/crates/lib/src/bootc_composefs/soft_reboot.rs index 393ae84f6..2bfd3317c 100644 --- a/crates/lib/src/bootc_composefs/soft_reboot.rs +++ b/crates/lib/src/bootc_composefs/soft_reboot.rs @@ -86,12 +86,12 @@ pub(crate) async fn prepare_soft_reboot_composefs( let all_deployments = host.all_composefs_deployments()?; - let requred_deployment = all_deployments + let required_deployment = all_deployments .iter() .find(|entry| entry.deployment.verity == *deployment_id) .ok_or_else(|| anyhow::anyhow!("Deployment '{deployment_id}' not found"))?; - if !requred_deployment.soft_reboot_capable { + if !required_deployment.soft_reboot_capable { match soft_reboot_mode { SoftRebootMode::Required => { anyhow::bail!("Cannot soft-reboot to deployment with a different kernel state") diff --git a/crates/lib/src/bootc_composefs/status.rs b/crates/lib/src/bootc_composefs/status.rs index a5368b217..807391172 100644 --- a/crates/lib/src/bootc_composefs/status.rs +++ b/crates/lib/src/bootc_composefs/status.rs @@ -1090,8 +1090,8 @@ async fn composefs_deployment_status_from( } }; - // Determine rollback deployment by matching extra deployment boot entries against entires read from /boot - // This collects verity digest across bls and grub enties, we should just have one of them, but still works + // Determine rollback deployment by matching extra deployment boot entries against entries read from /boot + // This collects verity digest across bls and grub entries, we should just have one of them, but still works // // We want this ordered, so we have a vector here let bootloader_configured_verity = sorted_bls_config diff --git a/crates/lib/src/bootc_composefs/update.rs b/crates/lib/src/bootc_composefs/update.rs index 45e4c5ad2..c0dcafe34 100644 --- a/crates/lib/src/bootc_composefs/update.rs +++ b/crates/lib/src/bootc_composefs/update.rs @@ -438,7 +438,7 @@ pub(crate) async fn apply_upgrade_from_downloaded( .context("Reading staged file")?; let mut new_staged: StagedDeployment = - serde_json::from_str(¤t).context("Deserialzing staged file")?; + serde_json::from_str(¤t).context("Deserializing staged file")?; // Make the staged deployment not download_only new_staged.finalization_locked = false; diff --git a/crates/lib/src/cli.rs b/crates/lib/src/cli.rs index 9d1f7592c..578a74adb 100644 --- a/crates/lib/src/cli.rs +++ b/crates/lib/src/cli.rs @@ -283,7 +283,7 @@ pub(crate) enum SoftRebootMode { pub(crate) struct StatusOpts { /// Output in JSON format. /// - /// Superceded by the `format` option. + /// Superseded by the `format` option. #[clap(long, hide = true)] pub(crate) json: bool, diff --git a/crates/lib/src/install.rs b/crates/lib/src/install.rs index 9d0b2cbd4..a35934a46 100644 --- a/crates/lib/src/install.rs +++ b/crates/lib/src/install.rs @@ -2187,7 +2187,7 @@ async fn install_to_filesystem_impl( // For s390x, we set zipl as the bootloader // this needs to be done after the ostree commit is deployed, - // as we don't want zipl to run during the initial ostree deployement. + // as we don't want zipl to run during the initial ostree deployment. if cfg!(target_arch = "s390x") { Command::new("ostree") .args([ diff --git a/crates/lib/src/install/baseline.rs b/crates/lib/src/install/baseline.rs index 86061dffb..ddc98b3f4 100644 --- a/crates/lib/src/install/baseline.rs +++ b/crates/lib/src/install/baseline.rs @@ -364,7 +364,7 @@ fn systemd_repart( return Ok(layout); } - // Root partition is not defined, create defintion for the root part + // Root partition is not defined, create definition for the root part let mut root_conf = String::from("[Partition]\nType=root\n"); match root_size { @@ -380,7 +380,7 @@ fn systemd_repart( // Installing to a disk, compute the root ptn size // by taking all other partitions into account // - // We're doing this to accomodate for partitions that are + // We're doing this to accommodate for partitions that are // supposed to be crated on first boot, like home,var,swap etc let space_taken = dry_partitions .iter() diff --git a/crates/ostree-ext/src/tar/write.rs b/crates/ostree-ext/src/tar/write.rs index 7b4a9b2d8..13e970860 100644 --- a/crates/ostree-ext/src/tar/write.rs +++ b/crates/ostree-ext/src/tar/write.rs @@ -516,7 +516,7 @@ mod tests { #[test] fn test_remap_etc() { - // These shouldn't change. Test etcc to verify we're not doing string matching. + // These shouldn't change. Test etc to verify we're not doing string matching. let unchanged = ["", "foo", "/etcc/foo", "../etc/baz"]; for x in unchanged { similar_asserts::assert_eq!(x, remap_etc_path(x.into()).as_str()); diff --git a/tmt/tests/booted/test-install-repart.nu b/tmt/tests/booted/test-install-repart.nu index f82bf4978..0d806d8f5 100644 --- a/tmt/tests/booted/test-install-repart.nu +++ b/tmt/tests/booted/test-install-repart.nu @@ -196,7 +196,7 @@ EOF verify_part_layout_second_boot # Now run systemd-repart on the disk again to simulate what would happen on first boot - print "Runnin systemd-repart to simulate first boot" + print "Running systemd-repart to simulate first boot" ( podman run --privileged --rm -v /dev:/dev