@@ -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 ,
@@ -164,8 +161,8 @@ pub fn type1_entry_conf_file_name(sort_key: impl std::fmt::Display) -> String {
164
161
/// * repo - The composefs repository
165
162
#[ context( "Computing boot digest" ) ]
166
163
fn compute_boot_digest (
167
- entry : & UsrLibModulesVmlinuz < Sha256HashValue > ,
168
- repo : & ComposefsRepository < Sha256HashValue > ,
164
+ entry : & UsrLibModulesVmlinuz < Sha512HashValue > ,
165
+ repo : & crate :: store :: ComposefsRepository ,
169
166
) -> Result < String > {
170
167
let vmlinuz = read_file ( & entry. vmlinuz , & repo) . context ( "Reading vmlinuz" ) ?;
171
168
@@ -238,9 +235,9 @@ fn find_vmlinuz_initrd_duplicates(digest: &str) -> Result<Option<String>> {
238
235
#[ context( "Writing BLS entries to disk" ) ]
239
236
fn write_bls_boot_entries_to_disk (
240
237
boot_dir : & Utf8PathBuf ,
241
- deployment_id : & Sha256HashValue ,
242
- entry : & UsrLibModulesVmlinuz < Sha256HashValue > ,
243
- repo : & ComposefsRepository < Sha256HashValue > ,
238
+ deployment_id : & Sha512HashValue ,
239
+ entry : & UsrLibModulesVmlinuz < Sha512HashValue > ,
240
+ repo : & crate :: store :: ComposefsRepository ,
244
241
) -> Result < ( ) > {
245
242
let id_hex = deployment_id. to_hex ( ) ;
246
243
@@ -283,8 +280,8 @@ fn write_bls_boot_entries_to_disk(
283
280
/// # Returns
284
281
/// - (title, version)
285
282
fn osrel_title_and_version (
286
- fs : & FileSystem < Sha256HashValue > ,
287
- repo : & ComposefsRepository < Sha256HashValue > ,
283
+ fs : & crate :: store :: ComposefsFilesystem ,
284
+ repo : & crate :: store :: ComposefsRepository ,
288
285
) -> Result < Option < ( Option < String > , Option < String > ) > > {
289
286
// Every update should have its own /usr/lib/os-release
290
287
let ( dir, fname) = fs
@@ -342,9 +339,9 @@ struct BLSEntryPath<'a> {
342
339
pub ( crate ) fn setup_composefs_bls_boot (
343
340
setup_type : BootSetupType ,
344
341
// TODO: Make this generic
345
- repo : ComposefsRepository < Sha256HashValue > ,
346
- id : & Sha256HashValue ,
347
- entry : & ComposefsBootEntry < Sha256HashValue > ,
342
+ repo : crate :: store :: ComposefsRepository ,
343
+ id : & Sha512HashValue ,
344
+ entry : & ComposefsBootEntry < Sha512HashValue > ,
348
345
) -> Result < String > {
349
346
let id_hex = id. to_hex ( ) ;
350
347
@@ -552,8 +549,8 @@ pub(crate) fn setup_composefs_bls_boot(
552
549
/// Writes a PortableExecutable to ESP along with any PE specific or Global addons
553
550
#[ context( "Writing {file_path} to ESP" ) ]
554
551
fn write_pe_to_esp (
555
- repo : & ComposefsRepository < Sha256HashValue > ,
556
- file : & RegularFile < Sha256HashValue > ,
552
+ repo : & crate :: store :: ComposefsRepository ,
553
+ file : & RegularFile < Sha512HashValue > ,
557
554
file_path : & Utf8Path ,
558
555
pe_type : PEType ,
559
556
uki_id : & String ,
@@ -571,7 +568,7 @@ fn write_pe_to_esp(
571
568
let cmdline = uki:: get_cmdline ( & efi_bin) . context ( "Getting UKI cmdline" ) ?;
572
569
573
570
let ( composefs_cmdline, insecure) =
574
- get_cmdline_composefs :: < Sha256HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
571
+ get_cmdline_composefs :: < Sha512HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
575
572
576
573
// If the UKI cmdline does not match what the user has passed as cmdline option
577
574
// NOTE: This will only be checked for new installs and now upgrades/switches
@@ -659,7 +656,7 @@ fn write_grub_uki_menuentry(
659
656
root_path : Utf8PathBuf ,
660
657
setup_type : & BootSetupType ,
661
658
boot_label : String ,
662
- id : & Sha256HashValue ,
659
+ id : & Sha512HashValue ,
663
660
esp_device : & String ,
664
661
) -> Result < ( ) > {
665
662
let boot_dir = root_path. join ( "boot" ) ;
@@ -747,7 +744,7 @@ fn write_systemd_uki_config(
747
744
esp_dir : & Dir ,
748
745
setup_type : & BootSetupType ,
749
746
boot_label : String ,
750
- id : & Sha256HashValue ,
747
+ id : & Sha512HashValue ,
751
748
) -> Result < ( ) > {
752
749
let default_sort_key = "0" ;
753
750
@@ -816,9 +813,9 @@ fn write_systemd_uki_config(
816
813
pub ( crate ) fn setup_composefs_uki_boot (
817
814
setup_type : BootSetupType ,
818
815
// TODO: Make this generic
819
- repo : ComposefsRepository < Sha256HashValue > ,
820
- id : & Sha256HashValue ,
821
- entries : Vec < ComposefsBootEntry < Sha256HashValue > > ,
816
+ repo : crate :: store :: ComposefsRepository ,
817
+ id : & Sha512HashValue ,
818
+ entries : Vec < ComposefsBootEntry < Sha512HashValue > > ,
822
819
) -> Result < ( ) > {
823
820
let ( root_path, esp_device, bootloader, is_insecure_from_opts, uki_addons) = match setup_type {
824
821
BootSetupType :: Setup ( ( root_setup, state, ..) ) => {
0 commit comments