1- use crate :: prompt;
1+ use crate :: { prompt, ReinstallOpts } ;
22
33use super :: ROOT_KEY_MOUNT_POINT ;
44use anyhow:: { ensure, Context , Result } ;
@@ -25,7 +25,7 @@ fn bootc_has_clean(image: &str) -> Result<bool> {
2525}
2626
2727#[ context( "reinstall_command" ) ]
28- pub ( crate ) fn reinstall_command ( image : & str , ssh_key_file : & str ) -> Result < Command > {
28+ pub ( crate ) fn reinstall_command ( opts : & ReinstallOpts , ssh_key_file : & str ) -> Result < Command > {
2929 let mut podman_command_and_args = [
3030 // We use podman to run the bootc container. This might change in the future to remove the
3131 // podman dependency.
@@ -72,11 +72,15 @@ pub(crate) fn reinstall_command(image: &str, ssh_key_file: &str) -> Result<Comma
7272 . map ( String :: from)
7373 . to_vec ( ) ;
7474
75+ if opts. composefs_backend {
76+ bootc_command_and_args. push ( "--composefs-backend" . into ( ) ) ;
77+ }
78+
7579 // Enable the systemd service to cleanup the previous install after booting into the
7680 // bootc system for the first time.
7781 // This only happens if the bootc version in the image >= 1.1.8 (this is when the cleanup
7882 // feature was introduced)
79- if bootc_has_clean ( image) ? {
83+ if bootc_has_clean ( & opts . image ) ? {
8084 bootc_command_and_args. push ( "--cleanup" . to_string ( ) ) ;
8185 }
8286
@@ -88,7 +92,7 @@ pub(crate) fn reinstall_command(image: &str, ssh_key_file: &str) -> Result<Comma
8892
8993 let all_args = [
9094 podman_command_and_args,
91- vec ! [ image. to_string( ) ] ,
95+ vec ! [ opts . image. to_string( ) ] ,
9296 bootc_command_and_args,
9397 ]
9498 . concat ( ) ;
0 commit comments