@@ -45,7 +45,7 @@ pub struct App {
4545enum OciCommand {
4646 /// Stores a tar file as a splitstream in the repository.
4747 ImportLayer {
48- sha256 : String ,
48+ digest : String ,
4949 name : Option < String > ,
5050 } ,
5151 /// Lists the contents of a tar stream
@@ -102,7 +102,7 @@ enum Command {
102102 Transaction ,
103103 /// Reconstitutes a split stream and writes it to stdout
104104 Cat {
105- /// the name of the stream to cat, either a sha256 digest or prefixed with 'ref/'
105+ /// the name of the stream to cat, either a content identifier or prefixed with 'ref/'
106106 name : String ,
107107 } ,
108108 /// Perform garbage collection
@@ -118,7 +118,7 @@ enum Command {
118118 } ,
119119 /// Mounts a composefs, possibly enforcing fsverity of the image
120120 Mount {
121- /// the name of the image to mount, either a sha256 digest or prefixed with 'ref/'
121+ /// the name of the image to mount, either an fs-verity hash or prefixed with 'ref/'
122122 name : String ,
123123 /// the mountpoint
124124 mountpoint : String ,
@@ -191,32 +191,32 @@ where
191191 }
192192 }
193193 Command :: Cat { name } => {
194- repo. merge_splitstream ( & name, None , & mut std:: io:: stdout ( ) ) ?;
194+ repo. merge_splitstream ( & name, None , None , & mut std:: io:: stdout ( ) ) ?;
195195 }
196196 Command :: ImportImage { reference } => {
197197 let image_id = repo. import_image ( & reference, & mut std:: io:: stdin ( ) ) ?;
198198 println ! ( "{}" , image_id. to_id( ) ) ;
199199 }
200200 Command :: Oci { cmd : oci_cmd } => match oci_cmd {
201- OciCommand :: ImportLayer { name, sha256 } => {
201+ OciCommand :: ImportLayer { name, digest } => {
202202 let object_id = composefs_oci:: import_layer (
203- & repo,
204- & composefs :: util :: parse_sha256 ( sha256 ) ? ,
203+ repo,
204+ & digest ,
205205 name. as_deref ( ) ,
206206 & mut std:: io:: stdin ( ) ,
207207 ) ?;
208208 println ! ( "{}" , object_id. to_id( ) ) ;
209209 }
210210 OciCommand :: LsLayer { name } => {
211- composefs_oci:: ls_layer ( & repo, & name) ?;
211+ composefs_oci:: ls_layer ( repo, & name) ?;
212212 }
213213 OciCommand :: Dump {
214214 ref config_name,
215215 ref config_verity,
216216 } => {
217217 let verity = verity_opt ( config_verity) ?;
218218 let mut fs =
219- composefs_oci:: image:: create_filesystem ( & repo, config_name, verity. as_ref ( ) ) ?;
219+ composefs_oci:: image:: create_filesystem ( repo, config_name, verity. as_ref ( ) ) ?;
220220 fs. print_dumpfile ( ) ?;
221221 }
222222 OciCommand :: ComputeId {
@@ -226,9 +226,9 @@ where
226226 } => {
227227 let verity = verity_opt ( config_verity) ?;
228228 let mut fs =
229- composefs_oci:: image:: create_filesystem ( & repo, config_name, verity. as_ref ( ) ) ?;
229+ composefs_oci:: image:: create_filesystem ( repo, config_name, verity. as_ref ( ) ) ?;
230230 if bootable {
231- fs. transform_for_boot ( & repo) ?;
231+ fs. transform_for_boot ( repo) ?;
232232 }
233233 let id = fs. compute_image_id ( ) ;
234234 println ! ( "{}" , id. to_hex( ) ) ;
@@ -241,34 +241,34 @@ where
241241 } => {
242242 let verity = verity_opt ( config_verity) ?;
243243 let mut fs =
244- composefs_oci:: image:: create_filesystem ( & repo, config_name, verity. as_ref ( ) ) ?;
244+ composefs_oci:: image:: create_filesystem ( repo, config_name, verity. as_ref ( ) ) ?;
245245 if bootable {
246- fs. transform_for_boot ( & repo) ?;
246+ fs. transform_for_boot ( repo) ?;
247247 }
248- let image_id = fs. commit_image ( & repo, image_name. as_deref ( ) ) ?;
248+ let image_id = fs. commit_image ( repo, image_name. as_deref ( ) ) ?;
249249 println ! ( "{}" , image_id. to_id( ) ) ;
250250 }
251251 OciCommand :: Pull { ref image, name } => {
252- let ( sha256 , verity) =
253- composefs_oci:: pull ( & repo, image, name. as_deref ( ) , None ) . await ?;
252+ let ( digest , verity) =
253+ composefs_oci:: pull ( repo, image, name. as_deref ( ) , None ) . await ?;
254254
255- println ! ( "sha256 {}" , hex :: encode ( sha256 ) ) ;
255+ println ! ( "config {digest}" ) ;
256256 println ! ( "verity {}" , verity. to_hex( ) ) ;
257257 }
258258 OciCommand :: Seal {
259259 ref config_name,
260260 ref config_verity,
261261 } => {
262262 let verity = verity_opt ( config_verity) ?;
263- let ( sha256 , verity) = composefs_oci:: seal ( & repo, config_name, verity. as_ref ( ) ) ?;
264- println ! ( "sha256 {}" , hex :: encode ( sha256 ) ) ;
263+ let ( digest , verity) = composefs_oci:: seal ( repo, config_name, verity. as_ref ( ) ) ?;
264+ println ! ( "config {digest}" ) ;
265265 println ! ( "verity {}" , verity. to_id( ) ) ;
266266 }
267267 OciCommand :: Mount {
268268 ref name,
269269 ref mountpoint,
270270 } => {
271- composefs_oci:: mount ( & repo, name, mountpoint, None ) ?;
271+ composefs_oci:: mount ( repo, name, mountpoint, None ) ?;
272272 }
273273 OciCommand :: PrepareBoot {
274274 ref config_name,
@@ -279,17 +279,17 @@ where
279279 } => {
280280 let verity = verity_opt ( config_verity) ?;
281281 let mut fs =
282- composefs_oci:: image:: create_filesystem ( & repo, config_name, verity. as_ref ( ) ) ?;
283- let entries = fs. transform_for_boot ( & repo) ?;
284- let id = fs. commit_image ( & repo, None ) ?;
282+ composefs_oci:: image:: create_filesystem ( repo, config_name, verity. as_ref ( ) ) ?;
283+ let entries = fs. transform_for_boot ( repo) ?;
284+ let id = fs. commit_image ( repo, None ) ?;
285285
286286 let Some ( entry) = entries. into_iter ( ) . next ( ) else {
287287 anyhow:: bail!( "No boot entries!" ) ;
288288 } ;
289289
290290 let cmdline_refs: Vec < & str > = cmdline. iter ( ) . map ( String :: as_str) . collect ( ) ;
291291 write_boot:: write_boot_simple (
292- & repo,
292+ repo,
293293 entry,
294294 & id,
295295 args. insecure ,
@@ -302,7 +302,7 @@ where
302302 let state = args
303303 . repo
304304 . as_ref ( )
305- . map ( |p : & PathBuf | p. parent ( ) . unwrap_or ( p ) )
305+ . map ( |p : & PathBuf | p. parent ( ) . unwrap ( ) )
306306 . unwrap_or ( Path :: new ( "/sysroot" ) )
307307 . join ( "state/deploy" )
308308 . join ( id. to_hex ( ) ) ;
@@ -318,9 +318,9 @@ where
318318 bootable,
319319 stat_root,
320320 } => {
321- let mut fs = composefs:: fs:: read_filesystem ( CWD , path, Some ( & repo) , stat_root) ?;
321+ let mut fs = composefs:: fs:: read_filesystem ( CWD , path, Some ( repo. as_ref ( ) ) , stat_root) ?;
322322 if bootable {
323- fs. transform_for_boot ( & repo) ?;
323+ fs. transform_for_boot ( repo) ?;
324324 }
325325 let id = fs. compute_image_id ( ) ;
326326 println ! ( "{}" , id. to_hex( ) ) ;
@@ -337,21 +337,21 @@ where
337337 stat_root,
338338 ref image_name,
339339 } => {
340- let mut fs = composefs:: fs:: read_filesystem ( CWD , path, Some ( & repo) , stat_root) ?;
340+ let mut fs = composefs:: fs:: read_filesystem ( CWD , path, Some ( repo. as_ref ( ) ) , stat_root) ?;
341341 if bootable {
342- fs. transform_for_boot ( & repo) ?;
342+ fs. transform_for_boot ( repo) ?;
343343 }
344- let id = fs. commit_image ( & repo, image_name. as_deref ( ) ) ?;
344+ let id = fs. commit_image ( repo, image_name. as_deref ( ) ) ?;
345345 println ! ( "{}" , id. to_id( ) ) ;
346346 }
347347 Command :: CreateDumpfile {
348348 ref path,
349349 bootable,
350350 stat_root,
351351 } => {
352- let mut fs = composefs:: fs:: read_filesystem ( CWD , path, Some ( & repo) , stat_root) ?;
352+ let mut fs = composefs:: fs:: read_filesystem ( CWD , path, Some ( repo. as_ref ( ) ) , stat_root) ?;
353353 if bootable {
354- fs. transform_for_boot ( & repo) ?;
354+ fs. transform_for_boot ( repo) ?;
355355 }
356356 fs. print_dumpfile ( ) ?;
357357 }
0 commit comments