@@ -32,7 +32,7 @@ const DISTRO_CENTOS_9: &str = "centos-9";
3232const COMPOSEFS_KERNEL_ARGS : [ & str ; 1 ] = [ "--karg=enforcing=0" ] ;
3333
3434// Import the argument types from xtask.rs
35- use crate :: { RunTmtArgs , TmtProvisionArgs } ;
35+ use crate :: { Bootloader , RunTmtArgs , TmtProvisionArgs } ;
3636
3737/// Generate a random alphanumeric suffix for VM names
3838fn generate_random_suffix ( ) -> String {
@@ -111,7 +111,11 @@ const DEFAULT_SB_KEYS_DIR: &str = "target/test-secureboot";
111111///
112112/// For sealed images, secure boot keys must be present or an error is returned.
113113#[ context( "Building firmware arguments" ) ]
114- fn build_firmware_args ( sh : & Shell , image : & str ) -> Result < Vec < String > > {
114+ fn build_firmware_args (
115+ sh : & Shell ,
116+ image : & str ,
117+ bootloader : & Option < Bootloader > ,
118+ ) -> Result < Vec < String > > {
115119 let is_sealed = is_sealed_image ( sh, image) ?;
116120 let sb_keys_dir = Utf8Path :: new ( DEFAULT_SB_KEYS_DIR ) ;
117121
@@ -133,6 +137,8 @@ fn build_firmware_args(sh: &Shell, image: &str) -> Result<Vec<String>> {
133137 sb_keys_dir
134138 ) ;
135139 }
140+ } else if matches ! ( bootloader, Some ( Bootloader :: Systemd ) ) {
141+ vec ! [ "--firmware=uefi-insecure" . into( ) ]
136142 } else {
137143 Vec :: new ( )
138144 } ;
@@ -310,7 +316,7 @@ pub(crate) fn run_tmt(sh: &Shell, args: &RunTmtArgs) -> Result<()> {
310316 println ! ( "Detected distro: {}" , distro) ;
311317 println ! ( "Detected VARIANT_ID: {variant_id}" ) ;
312318
313- let firmware_args = build_firmware_args ( sh, image) ?;
319+ let firmware_args = build_firmware_args ( sh, image, & args . bootloader ) ?;
314320
315321 // Create tmt-workdir and copy tmt bits to it
316322 // This works around https://github.com/teemtee/tmt/issues/4062
@@ -697,7 +703,8 @@ pub(crate) fn tmt_provision(sh: &Shell, args: &TmtProvisionArgs) -> Result<()> {
697703 println ! ( " Image: {}" , image) ;
698704 println ! ( " VM name: {}\n " , vm_name) ;
699705
700- let firmware_args = build_firmware_args ( sh, image) ?;
706+ // TODO: Send bootloader param here
707+ let firmware_args = build_firmware_args ( sh, image, & None ) ?;
701708
702709 // Launch VM with bcvk
703710 // Use ds=iid-datasource-none to disable cloud-init for faster boot
0 commit comments