@@ -14,14 +14,11 @@ use cap_std_ext::{
1414} ;
1515use clap:: ValueEnum ;
1616use composefs:: fs:: read_file;
17- use composefs:: tree:: { FileSystem , RegularFile } ;
17+ use composefs:: tree:: RegularFile ;
1818use composefs_boot:: bootloader:: { PEType , EFI_ADDON_DIR_EXT , EFI_ADDON_FILE_EXT , EFI_EXT } ;
1919use composefs_boot:: BootOps ;
2020use 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 } ;
2522use ostree_ext:: composefs_boot:: bootloader:: UsrLibModulesVmlinuz ;
2623use ostree_ext:: composefs_boot:: {
2724 bootloader:: BootEntry as ComposefsBootEntry , cmdline:: get_cmdline_composefs,
@@ -32,14 +29,14 @@ use rustix::path::Arg;
3229use schemars:: JsonSchema ;
3330use serde:: { Deserialize , Serialize } ;
3431
35- use crate :: bootc_composefs:: repo:: open_composefs_repo;
3632use crate :: bootc_composefs:: state:: { get_booted_bls, write_composefs_state} ;
3733use crate :: bootc_composefs:: status:: get_sorted_uki_boot_entries;
3834use crate :: composefs_consts:: { TYPE1_ENT_PATH , TYPE1_ENT_PATH_STAGED } ;
3935use crate :: parsers:: bls_config:: { BLSConfig , BLSConfigType } ;
4036use crate :: parsers:: grub_menuconfig:: MenuEntry ;
4137use crate :: spec:: ImageReference ;
4238use crate :: task:: Task ;
39+ use crate :: { bootc_composefs:: repo:: open_composefs_repo, store:: ComposefsFilesystem } ;
4340use crate :: {
4441 composefs_consts:: {
4542 BOOT_LOADER_ENTRIES , COMPOSEFS_CMDLINE , ORIGIN_KEY_BOOT , ORIGIN_KEY_BOOT_DIGEST ,
@@ -68,9 +65,9 @@ const SYSTEMD_UKI_DIR: &str = "EFI/Linux/bootc";
6865
6966pub ( crate ) enum BootSetupType < ' a > {
7067 /// 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 ) ) ,
7269 /// For `bootc upgrade`
73- Upgrade ( ( & ' a FileSystem < Sha256HashValue > , & ' a Host ) ) ,
70+ Upgrade ( ( & ' a ComposefsFilesystem , & ' a Host ) ) ,
7471}
7572
7673#[ derive(
@@ -107,8 +104,8 @@ impl TryFrom<&str> for BootType {
107104 }
108105}
109106
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 {
112109 match entry {
113110 ComposefsBootEntry :: Type1 ( ..) => Self :: Bls ,
114111 ComposefsBootEntry :: Type2 ( ..) => Self :: Uki ,
@@ -181,8 +178,8 @@ pub fn type1_entry_conf_file_name(sort_key: impl std::fmt::Display) -> String {
181178/// * repo - The composefs repository
182179#[ context( "Computing boot digest" ) ]
183180fn compute_boot_digest (
184- entry : & UsrLibModulesVmlinuz < Sha256HashValue > ,
185- repo : & ComposefsRepository < Sha256HashValue > ,
181+ entry : & UsrLibModulesVmlinuz < Sha512HashValue > ,
182+ repo : & crate :: store :: ComposefsRepository ,
186183) -> Result < String > {
187184 let vmlinuz = read_file ( & entry. vmlinuz , & repo) . context ( "Reading vmlinuz" ) ?;
188185
@@ -255,9 +252,9 @@ fn find_vmlinuz_initrd_duplicates(digest: &str) -> Result<Option<String>> {
255252#[ context( "Writing BLS entries to disk" ) ]
256253fn write_bls_boot_entries_to_disk (
257254 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 ,
261258) -> Result < ( ) > {
262259 let id_hex = deployment_id. to_hex ( ) ;
263260
@@ -300,8 +297,8 @@ fn write_bls_boot_entries_to_disk(
300297/// # Returns
301298/// - (title, version)
302299fn osrel_title_and_version (
303- fs : & FileSystem < Sha256HashValue > ,
304- repo : & ComposefsRepository < Sha256HashValue > ,
300+ fs : & crate :: store :: ComposefsFilesystem ,
301+ repo : & crate :: store :: ComposefsRepository ,
305302) -> Result < Option < ( Option < String > , Option < String > ) > > {
306303 // Every update should have its own /usr/lib/os-release
307304 let ( dir, fname) = fs
@@ -359,9 +356,9 @@ struct BLSEntryPath<'a> {
359356pub ( crate ) fn setup_composefs_bls_boot (
360357 setup_type : BootSetupType ,
361358 // 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 > ,
365362) -> Result < String > {
366363 let id_hex = id. to_hex ( ) ;
367364
@@ -569,8 +566,8 @@ pub(crate) fn setup_composefs_bls_boot(
569566/// Writes a PortableExecutable to ESP along with any PE specific or Global addons
570567#[ context( "Writing {file_path} to ESP" ) ]
571568fn write_pe_to_esp (
572- repo : & ComposefsRepository < Sha256HashValue > ,
573- file : & RegularFile < Sha256HashValue > ,
569+ repo : & crate :: store :: ComposefsRepository ,
570+ file : & RegularFile < Sha512HashValue > ,
574571 file_path : & Utf8Path ,
575572 pe_type : PEType ,
576573 uki_id : & String ,
@@ -588,7 +585,7 @@ fn write_pe_to_esp(
588585 let cmdline = uki:: get_cmdline ( & efi_bin) . context ( "Getting UKI cmdline" ) ?;
589586
590587 let ( composefs_cmdline, insecure) =
591- get_cmdline_composefs :: < Sha256HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
588+ get_cmdline_composefs :: < Sha512HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
592589
593590 // If the UKI cmdline does not match what the user has passed as cmdline option
594591 // NOTE: This will only be checked for new installs and now upgrades/switches
@@ -676,7 +673,7 @@ fn write_grub_uki_menuentry(
676673 root_path : Utf8PathBuf ,
677674 setup_type : & BootSetupType ,
678675 boot_label : String ,
679- id : & Sha256HashValue ,
676+ id : & Sha512HashValue ,
680677 esp_device : & String ,
681678) -> Result < ( ) > {
682679 let boot_dir = root_path. join ( "boot" ) ;
@@ -764,7 +761,7 @@ fn write_systemd_uki_config(
764761 esp_dir : & Dir ,
765762 setup_type : & BootSetupType ,
766763 boot_label : String ,
767- id : & Sha256HashValue ,
764+ id : & Sha512HashValue ,
768765) -> Result < ( ) > {
769766 let default_sort_key = "0" ;
770767
@@ -833,9 +830,9 @@ fn write_systemd_uki_config(
833830pub ( crate ) fn setup_composefs_uki_boot (
834831 setup_type : BootSetupType ,
835832 // 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 > > ,
839836) -> Result < ( ) > {
840837 let ( root_path, esp_device, bootloader, is_insecure_from_opts, uki_addons) = match setup_type {
841838 BootSetupType :: Setup ( ( root_setup, state, ..) ) => {
0 commit comments