@@ -7,15 +7,18 @@ use crate::{
77 get_efi_uuid_source, get_uki_name, parse_os_release, type1_entry_conf_file_name,
88 } ,
99 rollback:: { rename_exchange_bls_entries, rename_exchange_user_cfg} ,
10- status:: { get_bootloader, get_sorted_grub_uki_boot_entries, get_sorted_type1_boot_entries} ,
10+ status:: {
11+ ComposefsCmdline , get_bootloader, get_sorted_grub_uki_boot_entries,
12+ get_sorted_type1_boot_entries,
13+ } ,
1114 } ,
1215 composefs_consts:: {
1316 ORIGIN_KEY_BOOT , ORIGIN_KEY_BOOT_TYPE , STATE_DIR_RELATIVE , TYPE1_BOOT_DIR_PREFIX ,
1417 TYPE1_ENT_PATH_STAGED , UKI_NAME_PREFIX , USER_CFG_STAGED ,
1518 } ,
1619 parsers:: bls_config:: { BLSConfig , BLSConfigType } ,
1720 spec:: Bootloader ,
18- store:: { BootedComposefs , Storage } ,
21+ store:: Storage ,
1922} ;
2023use anyhow:: { Context , Result } ;
2124use camino:: Utf8PathBuf ;
@@ -159,7 +162,7 @@ fn stage_bls_entry_changes(
159162 storage : & Storage ,
160163 boot_dir : & Dir ,
161164 entries : & Vec < BLSConfig > ,
162- booted_cfs : & BootedComposefs ,
165+ cfs_cmdline : & ComposefsCmdline ,
163166) -> Result < ( RenameTransaction , Vec < ( String , BLSConfig ) > ) > {
164167 let mut rename_transaction = RenameTransaction :: new ( ) ;
165168
@@ -186,7 +189,7 @@ fn stage_bls_entry_changes(
186189
187190 let mut new_entry = entry. clone ( ) ;
188191
189- let conf_filename = if * booted_cfs . cmdline . digest == digest {
192+ let conf_filename = if * cfs_cmdline . digest == digest {
190193 type1_entry_conf_file_name ( os_id, new_entry. version ( ) , FILENAME_PRIORITY_PRIMARY )
191194 } else {
192195 type1_entry_conf_file_name ( os_id, new_entry. version ( ) , FILENAME_PRIORITY_SECONDARY )
@@ -236,12 +239,12 @@ fn create_staged_bls_entries(boot_dir: &Dir, entries: &Vec<(String, BLSConfig)>)
236239 fsync ( staged_entries. reopen_as_ownedfd ( ) ?) . context ( "fsync" )
237240}
238241
239- fn get_boot_type ( storage : & Storage , booted_cfs : & BootedComposefs ) -> Result < BootType > {
242+ fn get_boot_type ( storage : & Storage , cfs_cmdline : & ComposefsCmdline ) -> Result < BootType > {
240243 let mut config = String :: new ( ) ;
241244
242245 let origin_path = Utf8PathBuf :: from ( STATE_DIR_RELATIVE )
243- . join ( & * booted_cfs . cmdline . digest )
244- . join ( format ! ( "{}.origin" , booted_cfs . cmdline . digest) ) ;
246+ . join ( & * cfs_cmdline . digest )
247+ . join ( format ! ( "{}.origin" , cfs_cmdline . digest) ) ;
245248
246249 storage
247250 . physical_root
@@ -263,13 +266,13 @@ fn get_boot_type(storage: &Storage, booted_cfs: &BootedComposefs) -> Result<Boot
263266
264267fn handle_bls_conf (
265268 storage : & Storage ,
266- booted_cfs : & BootedComposefs ,
269+ cfs_cmdline : & ComposefsCmdline ,
267270 boot_dir : & Dir ,
268271 is_uki : bool ,
269272) -> Result < ( ) > {
270273 let entries = get_sorted_type1_boot_entries ( boot_dir, true ) ?;
271274 let ( rename_transaction, new_bls_entries) =
272- stage_bls_entry_changes ( storage, boot_dir, & entries, booted_cfs ) ?;
275+ stage_bls_entry_changes ( storage, boot_dir, & entries, cfs_cmdline ) ?;
273276
274277 if rename_transaction. operations . is_empty ( ) {
275278 tracing:: debug!( "Nothing to do" ) ;
@@ -305,15 +308,15 @@ fn handle_bls_conf(
305308#[ context( "Prepending custom prefix to EFI and BLS entries" ) ]
306309pub ( crate ) async fn prepend_custom_prefix (
307310 storage : & Storage ,
308- booted_cfs : & BootedComposefs ,
311+ cfs_cmdline : & ComposefsCmdline ,
309312) -> Result < ( ) > {
310313 let boot_dir = storage. require_boot_dir ( ) ?;
311314
312315 let bootloader = get_bootloader ( ) ?;
313316
314- match get_boot_type ( storage, booted_cfs ) ? {
317+ match get_boot_type ( storage, cfs_cmdline ) ? {
315318 BootType :: Bls => {
316- handle_bls_conf ( storage, booted_cfs , boot_dir, false ) ?;
319+ handle_bls_conf ( storage, cfs_cmdline , boot_dir, false ) ?;
317320 }
318321
319322 BootType :: Uki => match bootloader {
@@ -378,7 +381,7 @@ pub(crate) async fn prepend_custom_prefix(
378381 }
379382
380383 Bootloader :: Systemd => {
381- handle_bls_conf ( storage, booted_cfs , boot_dir, true ) ?;
384+ handle_bls_conf ( storage, cfs_cmdline , boot_dir, true ) ?;
382385 }
383386
384387 Bootloader :: None => unreachable ! ( "Checked at install time" ) ,
0 commit comments