@@ -17,11 +17,11 @@ use crate::composefs_consts::COMPOSEFS_CMDLINE;
1717
1818#[ derive( Debug , PartialEq , Eq , Default ) ]
1919pub enum BLSConfigType {
20- EFI {
21- /// The path to the EFI binary, usually a UKI
22- efi : Utf8PathBuf ,
20+ UKI {
21+ /// The path to the UKI
22+ uki : Utf8PathBuf ,
2323 } ,
24- NonEFI {
24+ NonUKI {
2525 /// The path to the linux kernel to boot.
2626 linux : Utf8PathBuf ,
2727 /// The paths to the initrd images.
@@ -102,11 +102,11 @@ impl Display for BLSConfig {
102102 writeln ! ( f, "version {}" , self . version) ?;
103103
104104 match & self . cfg_type {
105- BLSConfigType :: EFI { efi } => {
106- writeln ! ( f, "efi {}" , efi ) ?;
105+ BLSConfigType :: UKI { uki } => {
106+ writeln ! ( f, "uki {}" , uki ) ?;
107107 }
108108
109- BLSConfigType :: NonEFI {
109+ BLSConfigType :: NonUKI {
110110 linux,
111111 initrd,
112112 options,
@@ -173,16 +173,16 @@ impl BLSConfig {
173173
174174 pub ( crate ) fn get_verity ( & self ) -> Result < String > {
175175 match & self . cfg_type {
176- BLSConfigType :: EFI { efi } => Ok ( efi
176+ BLSConfigType :: UKI { uki } => Ok ( uki
177177 . components ( )
178178 . last ( )
179- . ok_or ( anyhow:: anyhow!( "Empty efi field" ) ) ?
179+ . ok_or ( anyhow:: anyhow!( "Empty uki field" ) ) ?
180180 . to_string ( )
181181 . strip_suffix ( EFI_EXT )
182- . ok_or ( anyhow:: anyhow!( "efi doesn't end with .efi" ) ) ?
182+ . ok_or_else ( || anyhow:: anyhow!( "uki doesn't end with .efi" ) ) ?
183183 . to_string ( ) ) ,
184184
185- BLSConfigType :: NonEFI { options, .. } => {
185+ BLSConfigType :: NonUKI { options, .. } => {
186186 let options = options. as_ref ( ) . ok_or ( anyhow:: anyhow!( "No options" ) ) ?;
187187
188188 let cmdline = Cmdline :: from ( & options) ;
@@ -209,7 +209,7 @@ pub(crate) fn parse_bls_config(input: &str) -> Result<BLSConfig> {
209209 let mut title = None ;
210210 let mut version = None ;
211211 let mut linux = None ;
212- let mut efi = None ;
212+ let mut uki = None ;
213213 let mut initrd = Vec :: new ( ) ;
214214 let mut options = None ;
215215 let mut machine_id = None ;
@@ -232,7 +232,7 @@ pub(crate) fn parse_bls_config(input: &str) -> Result<BLSConfig> {
232232 "options" => options = Some ( CmdlineOwned :: from ( value) ) ,
233233 "machine-id" => machine_id = Some ( value) ,
234234 "sort-key" => sort_key = Some ( value) ,
235- "efi " => efi = Some ( Utf8PathBuf :: from ( value) ) ,
235+ "uki " => uki = Some ( Utf8PathBuf :: from ( value) ) ,
236236 _ => {
237237 extra. insert ( key. to_string ( ) , value) ;
238238 }
@@ -242,19 +242,19 @@ pub(crate) fn parse_bls_config(input: &str) -> Result<BLSConfig> {
242242
243243 let version = version. ok_or_else ( || anyhow ! ( "Missing 'version' value" ) ) ?;
244244
245- let cfg_type = match ( linux, efi ) {
246- ( None , Some ( efi ) ) => BLSConfigType :: EFI { efi } ,
245+ let cfg_type = match ( linux, uki ) {
246+ ( None , Some ( uki ) ) => BLSConfigType :: UKI { uki } ,
247247
248- ( Some ( linux) , None ) => BLSConfigType :: NonEFI {
248+ ( Some ( linux) , None ) => BLSConfigType :: NonUKI {
249249 linux,
250250 initrd,
251251 options,
252252 } ,
253253
254254 // The spec makes no mention of whether both can be present or not
255255 // Fow now, for us, we won't have both at the same time
256- ( Some ( _) , Some ( _) ) => anyhow:: bail!( "'linux' and 'efi ' values present" ) ,
257- ( None , None ) => anyhow:: bail!( "Missing 'linux' or 'efi ' value" ) ,
256+ ( Some ( _) , Some ( _) ) => anyhow:: bail!( "'linux' and 'uki ' values present" ) ,
257+ ( None , None ) => anyhow:: bail!( "Missing 'linux' or 'uki ' value" ) ,
258258 } ;
259259
260260 Ok ( BLSConfig {
@@ -285,13 +285,13 @@ mod tests {
285285
286286 let config = parse_bls_config ( input) ?;
287287
288- let BLSConfigType :: NonEFI {
288+ let BLSConfigType :: NonUKI {
289289 linux,
290290 initrd,
291291 options,
292292 } = config. cfg_type
293293 else {
294- panic ! ( "Expected non EFI variant" ) ;
294+ panic ! ( "Expected non UKI variant" ) ;
295295 } ;
296296
297297 assert_eq ! (
@@ -321,8 +321,8 @@ mod tests {
321321
322322 let config = parse_bls_config ( input) ?;
323323
324- let BLSConfigType :: NonEFI { initrd, .. } = config. cfg_type else {
325- panic ! ( "Expected non EFI variant" ) ;
324+ let BLSConfigType :: NonUKI { initrd, .. } = config. cfg_type else {
325+ panic ! ( "Expected non UKI variant" ) ;
326326 } ;
327327
328328 assert_eq ! (
0 commit comments