@@ -9,7 +9,8 @@ use cfsctl::composefs_oci;
99use composefs:: fsverity:: { FsVerityHashValue , Sha512HashValue } ;
1010use composefs_boot:: { BootOps , bootloader:: BootEntry as ComposefsBootEntry } ;
1111use composefs_oci:: {
12- PullResult , image:: create_filesystem as create_composefs_filesystem, pull as composefs_oci_pull,
12+ image:: create_filesystem as create_composefs_filesystem,
13+ pull_image as composefs_oci_pull_image, skopeo:: PullResult ,
1314} ;
1415
1516use ostree_ext:: container:: ImageReference as OstreeExtImgRef ;
@@ -56,13 +57,25 @@ pub(crate) async fn initialize_composefs_repository(
5657 } = & state. source . imageref ;
5758
5859 // transport's display is already of type "<transport_type>:"
59- composefs_oci_pull (
60+ let ( pull_result , _stats ) = composefs_oci_pull_image (
6061 & Arc :: new ( repo) ,
6162 & format ! ( "{transport}{image_name}" ) ,
6263 None ,
6364 None ,
6465 )
65- . await
66+ . await ?;
67+
68+ tracing:: info!(
69+ message_id = COMPOSEFS_REPO_INIT_JOURNAL_ID ,
70+ bootc. operation = "repository_init" ,
71+ bootc. manifest_digest = pull_result. manifest_digest,
72+ bootc. manifest_verity = pull_result. manifest_verity. to_hex( ) ,
73+ bootc. config_digest = pull_result. config_digest,
74+ bootc. config_verity = pull_result. config_verity. to_hex( ) ,
75+ "Pulled image into composefs repository" ,
76+ ) ;
77+
78+ Ok ( pull_result)
6679}
6780
6881/// skopeo (in composefs-rs) doesn't understand "registry:"
@@ -85,19 +98,26 @@ pub(crate) fn get_imgref(transport: &str, image: &str) -> String {
8598 }
8699}
87100
101+ /// Result of pulling a composefs repository, including the OCI manifest digest
102+ /// needed to reconstruct image metadata from the local composefs repo.
103+ #[ allow( dead_code) ]
104+ pub ( crate ) struct PullRepoResult {
105+ pub ( crate ) repo : crate :: store:: ComposefsRepository ,
106+ pub ( crate ) entries : Vec < ComposefsBootEntry < Sha512HashValue > > ,
107+ pub ( crate ) id : Sha512HashValue ,
108+ pub ( crate ) fs : crate :: store:: ComposefsFilesystem ,
109+ /// The OCI manifest content digest (e.g. "sha256:abc...")
110+ pub ( crate ) manifest_digest : String ,
111+ }
112+
88113/// Pulls the `image` from `transport` into a composefs repository at /sysroot
89114/// Checks for boot entries in the image and returns them
90115#[ context( "Pulling composefs repository" ) ]
91116pub ( crate ) async fn pull_composefs_repo (
92117 transport : & String ,
93118 image : & String ,
94119 allow_missing_fsverity : bool ,
95- ) -> Result < (
96- crate :: store:: ComposefsRepository ,
97- Vec < ComposefsBootEntry < Sha512HashValue > > ,
98- Sha512HashValue ,
99- crate :: store:: ComposefsFilesystem ,
100- ) > {
120+ ) -> Result < PullRepoResult > {
101121 const COMPOSEFS_PULL_JOURNAL_ID : & str = "4c3b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8" ;
102122
103123 tracing:: info!(
@@ -120,15 +140,19 @@ pub(crate) async fn pull_composefs_repo(
120140
121141 tracing:: debug!( "Image to pull {final_imgref}" ) ;
122142
123- let pull_result = composefs_oci_pull ( & Arc :: new ( repo) , & final_imgref, None , None )
124- . await
125- . context ( "Pulling composefs repo" ) ?;
143+ let ( pull_result, _stats) =
144+ composefs_oci_pull_image ( & Arc :: new ( repo) , & final_imgref, None , None )
145+ . await
146+ . context ( "Pulling composefs repo" ) ?;
126147
127148 tracing:: info!(
128149 message_id = COMPOSEFS_PULL_JOURNAL_ID ,
129- id = pull_result. config_digest,
130- verity = pull_result. config_verity. to_hex( ) ,
131- "Pulled image into repository"
150+ bootc. operation = "pull" ,
151+ bootc. manifest_digest = pull_result. manifest_digest,
152+ bootc. manifest_verity = pull_result. manifest_verity. to_hex( ) ,
153+ bootc. config_digest = pull_result. config_digest,
154+ bootc. config_verity = pull_result. config_verity. to_hex( ) ,
155+ "Pulled image into composefs repository" ,
132156 ) ;
133157
134158 let mut repo = open_composefs_repo ( & rootfs_dir) ?;
@@ -141,7 +165,13 @@ pub(crate) async fn pull_composefs_repo(
141165 let entries = fs. transform_for_boot ( & repo) ?;
142166 let id = fs. commit_image ( & repo, None ) ?;
143167
144- Ok ( ( repo, entries, id, fs) )
168+ Ok ( PullRepoResult {
169+ repo,
170+ entries,
171+ id,
172+ fs,
173+ manifest_digest : pull_result. manifest_digest ,
174+ } )
145175}
146176
147177#[ cfg( test) ]
0 commit comments