File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ use rustix::{mount::MountFlags, path::Arg};
9696use schemars:: JsonSchema ;
9797use serde:: { Deserialize , Serialize } ;
9898
99- use crate :: bootc_kargs:: kargs_from_composefs_filesystem ;
99+ use crate :: bootc_kargs:: compute_new_kargs ;
100100use crate :: composefs_consts:: { TYPE1_ENT_PATH , TYPE1_ENT_PATH_STAGED } ;
101101use crate :: parsers:: bls_config:: { BLSConfig , BLSConfigType } ;
102102use crate :: parsers:: grub_menuconfig:: MenuEntry ;
@@ -564,7 +564,7 @@ pub(crate) fn setup_composefs_bls_boot(
564564 None
565565 } ;
566566
567- kargs_from_composefs_filesystem ( mounted_erofs, current_root, & mut cmdline_refs) ?;
567+ compute_new_kargs ( mounted_erofs, current_root, & mut cmdline_refs) ?;
568568
569569 let ( entry_paths, _tmpdir_guard) = match bootloader {
570570 Bootloader :: Grub => {
Original file line number Diff line number Diff line change @@ -73,8 +73,22 @@ fn compute_apply_kargs_diff(
7373 }
7474}
7575
76- /// Looks for files in usr/lib/bootc/kargs.d and parses cmdline agruments
77- pub ( crate ) fn kargs_from_composefs_filesystem (
76+ /// Computes new kernel arguments by applying the diff between existing and new kargs.d files.
77+ ///
78+ /// This function:
79+ /// 1. Loads kernel arguments from `usr/lib/bootc/kargs.d` in the new filesystem
80+ /// 2. Loads kernel arguments from the current root (if present)
81+ /// 3. Computes the difference between them (added/removed arguments)
82+ /// 4. Applies that difference to the provided `new_kargs` cmdline
83+ ///
84+ /// This allows bootc to maintain user customizations while applying changes from
85+ /// updated container images.
86+ ///
87+ /// # Arguments
88+ /// * `new_fs` - Directory handle to the new filesystem containing kargs.d files
89+ /// * `current_root` - Optional directory handle to current root filesystem
90+ /// * `new_kargs` - Mutable cmdline that will be modified with the computed diff
91+ pub ( crate ) fn compute_new_kargs (
7892 new_fs : & Dir ,
7993 current_root : Option < & Dir > ,
8094 new_kargs : & mut Cmdline ,
You can’t perform that action at this time.
0 commit comments