lanzatool: fix init

This commit is contained in:
nikstur 2022-11-24 17:14:55 +01:00
parent e75d892964
commit efbb28dc99
1 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,4 @@
use std::fs; use std::fs;
use std::str::from_utf8;
use std::path::Path; use std::path::Path;
@ -31,11 +30,12 @@ pub fn install(
let signer = Signer::new(&sbsigntool, &public_key, &private_key); let signer = Signer::new(&sbsigntool, &public_key, &private_key);
println!("Assembling lanzaboote image..."); println!("Assembling lanzaboote image...");
let mut kernel_cmdline: Vec<String> = vec![bootspec_doc let init_string = bootspec_doc
.init .init
.into_os_string() .into_os_string()
.into_string() .into_string()
.expect("Failed to convert init to string")]; .expect("Failed to convert init to string");
let mut kernel_cmdline: Vec<String> = vec![format!("init={}", init_string)];
kernel_cmdline.extend(bootspec_doc.kernel_params); kernel_cmdline.extend(bootspec_doc.kernel_params);
let lanzaboote_image = pe::assemble_image( let lanzaboote_image = pe::assemble_image(
@ -44,7 +44,7 @@ pub fn install(
&kernel_cmdline, &kernel_cmdline,
&esp_paths.kernel, &esp_paths.kernel,
&esp_paths.initrd, &esp_paths.initrd,
&esp_paths.esp &esp_paths.esp,
) )
.context("Failed to assemble stub")?; .context("Failed to assemble stub")?;