@@ -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 ,
@@ -164,8 +161,8 @@ pub fn type1_entry_conf_file_name(sort_key: impl std::fmt::Display) -> String {
164161/// * repo - The composefs repository
165162#[ context( "Computing boot digest" ) ]
166163fn compute_boot_digest (
167- entry : & UsrLibModulesVmlinuz < Sha256HashValue > ,
168- repo : & ComposefsRepository < Sha256HashValue > ,
164+ entry : & UsrLibModulesVmlinuz < Sha512HashValue > ,
165+ repo : & crate :: store :: ComposefsRepository ,
169166) -> Result < String > {
170167 let vmlinuz = read_file ( & entry. vmlinuz , & repo) . context ( "Reading vmlinuz" ) ?;
171168
@@ -238,9 +235,9 @@ fn find_vmlinuz_initrd_duplicates(digest: &str) -> Result<Option<String>> {
238235#[ context( "Writing BLS entries to disk" ) ]
239236fn write_bls_boot_entries_to_disk (
240237 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 ,
244241) -> Result < ( ) > {
245242 let id_hex = deployment_id. to_hex ( ) ;
246243
@@ -283,8 +280,8 @@ fn write_bls_boot_entries_to_disk(
283280/// # Returns
284281/// - (title, version)
285282fn osrel_title_and_version (
286- fs : & FileSystem < Sha256HashValue > ,
287- repo : & ComposefsRepository < Sha256HashValue > ,
283+ fs : & crate :: store :: ComposefsFilesystem ,
284+ repo : & crate :: store :: ComposefsRepository ,
288285) -> Result < Option < ( Option < String > , Option < String > ) > > {
289286 // Every update should have its own /usr/lib/os-release
290287 let ( dir, fname) = fs
@@ -342,9 +339,9 @@ struct BLSEntryPath<'a> {
342339pub ( crate ) fn setup_composefs_bls_boot (
343340 setup_type : BootSetupType ,
344341 // 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 > ,
348345) -> Result < String > {
349346 let id_hex = id. to_hex ( ) ;
350347
@@ -552,8 +549,8 @@ pub(crate) fn setup_composefs_bls_boot(
552549/// Writes a PortableExecutable to ESP along with any PE specific or Global addons
553550#[ context( "Writing {file_path} to ESP" ) ]
554551fn write_pe_to_esp (
555- repo : & ComposefsRepository < Sha256HashValue > ,
556- file : & RegularFile < Sha256HashValue > ,
552+ repo : & crate :: store :: ComposefsRepository ,
553+ file : & RegularFile < Sha512HashValue > ,
557554 file_path : & Utf8Path ,
558555 pe_type : PEType ,
559556 uki_id : & String ,
@@ -571,7 +568,7 @@ fn write_pe_to_esp(
571568 let cmdline = uki:: get_cmdline ( & efi_bin) . context ( "Getting UKI cmdline" ) ?;
572569
573570 let ( composefs_cmdline, insecure) =
574- get_cmdline_composefs :: < Sha256HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
571+ get_cmdline_composefs :: < Sha512HashValue > ( cmdline) . context ( "Parsing composefs=" ) ?;
575572
576573 // If the UKI cmdline does not match what the user has passed as cmdline option
577574 // NOTE: This will only be checked for new installs and now upgrades/switches
@@ -659,7 +656,7 @@ fn write_grub_uki_menuentry(
659656 root_path : Utf8PathBuf ,
660657 setup_type : & BootSetupType ,
661658 boot_label : String ,
662- id : & Sha256HashValue ,
659+ id : & Sha512HashValue ,
663660 esp_device : & String ,
664661) -> Result < ( ) > {
665662 let boot_dir = root_path. join ( "boot" ) ;
@@ -747,7 +744,7 @@ fn write_systemd_uki_config(
747744 esp_dir : & Dir ,
748745 setup_type : & BootSetupType ,
749746 boot_label : String ,
750- id : & Sha256HashValue ,
747+ id : & Sha512HashValue ,
751748) -> Result < ( ) > {
752749 let default_sort_key = "0" ;
753750
@@ -816,9 +813,9 @@ fn write_systemd_uki_config(
816813pub ( crate ) fn setup_composefs_uki_boot (
817814 setup_type : BootSetupType ,
818815 // 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 > > ,
822819) -> Result < ( ) > {
823820 let ( root_path, esp_device, bootloader, is_insecure_from_opts, uki_addons) = match setup_type {
824821 BootSetupType :: Setup ( ( root_setup, state, ..) ) => {
0 commit comments