@@ -14,14 +14,11 @@ use cap_std_ext::{
14
14
} ;
15
15
use clap:: ValueEnum ;
16
16
use composefs:: fs:: read_file;
17
- use composefs:: tree:: { FileSystem , RegularFile } ;
17
+ use composefs:: tree:: RegularFile ;
18
18
use composefs_boot:: bootloader:: { PEType , EFI_ADDON_DIR_EXT , EFI_ADDON_FILE_EXT , EFI_EXT } ;
19
19
use composefs_boot:: BootOps ;
20
20
use fn_error_context:: context;
21
- use ostree_ext:: composefs:: {
22
- fsverity:: { FsVerityHashValue , Sha256HashValue } ,
23
- repository:: Repository as ComposefsRepository ,
24
- } ;
21
+ use ostree_ext:: composefs:: fsverity:: { FsVerityHashValue , Sha512HashValue } ;
25
22
use ostree_ext:: composefs_boot:: bootloader:: UsrLibModulesVmlinuz ;
26
23
use ostree_ext:: composefs_boot:: {
27
24
bootloader:: BootEntry as ComposefsBootEntry , cmdline:: get_cmdline_composefs,
@@ -32,14 +29,14 @@ use rustix::path::Arg;
32
29
use schemars:: JsonSchema ;
33
30
use serde:: { Deserialize , Serialize } ;
34
31
35
- use crate :: bootc_composefs:: repo:: open_composefs_repo;
36
32
use crate :: bootc_composefs:: state:: { get_booted_bls, write_composefs_state} ;
37
33
use crate :: bootc_composefs:: status:: get_sorted_uki_boot_entries;
38
34
use crate :: composefs_consts:: { TYPE1_ENT_PATH , TYPE1_ENT_PATH_STAGED } ;
39
35
use crate :: parsers:: bls_config:: { BLSConfig , BLSConfigType } ;
40
36
use crate :: parsers:: grub_menuconfig:: MenuEntry ;
41
37
use crate :: spec:: ImageReference ;
42
38
use crate :: task:: Task ;
39
+ use crate :: { bootc_composefs:: repo:: open_composefs_repo, store:: ComposefsFilesystem } ;
43
40
use crate :: {
44
41
composefs_consts:: {
45
42
BOOT_LOADER_ENTRIES , COMPOSEFS_CMDLINE , ORIGIN_KEY_BOOT , ORIGIN_KEY_BOOT_DIGEST ,
@@ -68,9 +65,9 @@ const SYSTEMD_UKI_DIR: &str = "EFI/Linux/bootc";
68
65
69
66
pub ( crate ) enum BootSetupType < ' a > {
70
67
/// For initial setup, i.e. install to-disk
71
- Setup ( ( & ' a RootSetup , & ' a State , & ' a FileSystem < Sha256HashValue > ) ) ,
68
+ Setup ( ( & ' a RootSetup , & ' a State , & ' a ComposefsFilesystem ) ) ,
72
69
/// For `bootc upgrade`
73
- Upgrade ( ( & ' a FileSystem < Sha256HashValue > , & ' a Host ) ) ,
70
+ Upgrade ( ( & ' a ComposefsFilesystem , & ' a Host ) ) ,
74
71
}
75
72
76
73
#[ derive(
@@ -107,8 +104,8 @@ impl TryFrom<&str> for BootType {
107
104
}
108
105
}
109
106
110
- impl From < & ComposefsBootEntry < Sha256HashValue > > for BootType {
111
- fn from ( entry : & ComposefsBootEntry < Sha256HashValue > ) -> Self {
107
+ impl From < & ComposefsBootEntry < Sha512HashValue > > for BootType {
108
+ fn from ( entry : & ComposefsBootEntry < Sha512HashValue > ) -> Self {
112
109
match entry {
113
110
ComposefsBootEntry :: Type1 ( ..) => Self :: Bls ,
114
111
ComposefsBootEntry :: Type2 ( ..) => Self :: Uki ,
@@ -181,8 +178,8 @@ pub fn type1_entry_conf_file_name(sort_key: impl std::fmt::Display) -> String {
181
178
/// * repo - The composefs repository
182
179
#[ context( "Computing boot digest" ) ]
183
180
fn compute_boot_digest (
184
- entry : & UsrLibModulesVmlinuz < Sha256HashValue > ,
185
- repo : & ComposefsRepository < Sha256HashValue > ,
181
+ entry : & UsrLibModulesVmlinuz < Sha512HashValue > ,
182
+ repo : & crate :: store :: ComposefsRepository ,
186
183
) -> Result < String > {
187
184
let vmlinuz = read_file ( & entry. vmlinuz , & repo) . context ( "Reading vmlinuz" ) ?;
188
185
@@ -255,9 +252,9 @@ fn find_vmlinuz_initrd_duplicates(digest: &str) -> Result<Option<String>> {
255
252
#[ context( "Writing BLS entries to disk" ) ]
256
253
fn write_bls_boot_entries_to_disk (
257
254
boot_dir : & Utf8PathBuf ,
258
- deployment_id : & Sha256HashValue ,
259
- entry : & UsrLibModulesVmlinuz < Sha256HashValue > ,
260
- repo : & ComposefsRepository < Sha256HashValue > ,
255
+ deployment_id : & Sha512HashValue ,
256
+ entry : & UsrLibModulesVmlinuz < Sha512HashValue > ,
257
+ repo : & crate :: store :: ComposefsRepository ,
261
258
) -> Result < ( ) > {
262
259
let id_hex = deployment_id. to_hex ( ) ;
263
260
@@ -300,8 +297,8 @@ fn write_bls_boot_entries_to_disk(
300
297
/// # Returns
301
298
/// - (title, version)
302
299
fn osrel_title_and_version (
303
- fs : & FileSystem < Sha256HashValue > ,
304
- repo : & ComposefsRepository < Sha256HashValue > ,
300
+ fs : & crate :: store :: ComposefsFilesystem ,
301
+ repo : & crate :: store :: ComposefsRepository ,
305
302
) -> Result < Option < ( Option < String > , Option < String > ) > > {
306
303
// Every update should have its own /usr/lib/os-release
307
304
let ( dir, fname) = fs
@@ -359,9 +356,9 @@ struct BLSEntryPath<'a> {
359
356
pub ( crate ) fn setup_composefs_bls_boot (
360
357
setup_type : BootSetupType ,
361
358
// TODO: Make this generic
362
- repo : ComposefsRepository < Sha256HashValue > ,
363
- id : & Sha256HashValue ,
364
- entry : & ComposefsBootEntry < Sha256HashValue > ,
359
+ repo : crate :: store :: ComposefsRepository ,
360
+ id : & Sha512HashValue ,
361
+ entry : & ComposefsBootEntry < Sha512HashValue > ,
365
362
) -> Result < String > {
366
363
let id_hex = id. to_hex ( ) ;
367
364
@@ -569,8 +566,8 @@ pub(crate) fn setup_composefs_bls_boot(
569
566
/// Writes a PortableExecutable to ESP along with any PE specific or Global addons
570
567
#[ context( "Writing {file_path} to ESP" ) ]
571
568
fn write_pe_to_esp (
572
- repo : & ComposefsRepository < Sha256HashValue > ,
573
- file : & RegularFile < Sha256HashValue > ,
569
+ repo : & crate :: store :: ComposefsRepository ,
570
+ file : & RegularFile < Sha512HashValue > ,
574
571
file_path : & Utf8Path ,
575
572
pe_type : PEType ,
576
573
uki_id : & String ,
@@ -588,7 +585,7 @@ fn write_pe_to_esp(
588
585
let cmdline = uki:: get_cmdline ( & efi_bin) . context ( "Getting UKI cmdline" ) ?;
589
586
590
587
let ( composefs_cmdline, insecure) =
591
- get_cmdline_composefs :: < Sha256HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
588
+ get_cmdline_composefs :: < Sha512HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
592
589
593
590
// If the UKI cmdline does not match what the user has passed as cmdline option
594
591
// NOTE: This will only be checked for new installs and now upgrades/switches
@@ -676,7 +673,7 @@ fn write_grub_uki_menuentry(
676
673
root_path : Utf8PathBuf ,
677
674
setup_type : & BootSetupType ,
678
675
boot_label : String ,
679
- id : & Sha256HashValue ,
676
+ id : & Sha512HashValue ,
680
677
esp_device : & String ,
681
678
) -> Result < ( ) > {
682
679
let boot_dir = root_path. join ( "boot" ) ;
@@ -764,7 +761,7 @@ fn write_systemd_uki_config(
764
761
esp_dir : & Dir ,
765
762
setup_type : & BootSetupType ,
766
763
boot_label : String ,
767
- id : & Sha256HashValue ,
764
+ id : & Sha512HashValue ,
768
765
) -> Result < ( ) > {
769
766
let default_sort_key = "0" ;
770
767
@@ -833,9 +830,9 @@ fn write_systemd_uki_config(
833
830
pub ( crate ) fn setup_composefs_uki_boot (
834
831
setup_type : BootSetupType ,
835
832
// TODO: Make this generic
836
- repo : ComposefsRepository < Sha256HashValue > ,
837
- id : & Sha256HashValue ,
838
- entries : Vec < ComposefsBootEntry < Sha256HashValue > > ,
833
+ repo : crate :: store :: ComposefsRepository ,
834
+ id : & Sha512HashValue ,
835
+ entries : Vec < ComposefsBootEntry < Sha512HashValue > > ,
839
836
) -> Result < ( ) > {
840
837
let ( root_path, esp_device, bootloader, is_insecure_from_opts, uki_addons) = match setup_type {
841
838
BootSetupType :: Setup ( ( root_setup, state, ..) ) => {
0 commit comments