From efbb28dc996711944c5959d8e2187f687ebab164 Mon Sep 17 00:00:00 2001 From: nikstur Date: Thu, 24 Nov 2022 17:14:55 +0100 Subject: [PATCH] lanzatool: fix init --- rust/lanzatool/src/install.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/lanzatool/src/install.rs b/rust/lanzatool/src/install.rs index d0b8b4b..e56c7d5 100644 --- a/rust/lanzatool/src/install.rs +++ b/rust/lanzatool/src/install.rs @@ -1,5 +1,4 @@ use std::fs; -use std::str::from_utf8; use std::path::Path; @@ -31,11 +30,12 @@ pub fn install( let signer = Signer::new(&sbsigntool, &public_key, &private_key); println!("Assembling lanzaboote image..."); - let mut kernel_cmdline: Vec = vec![bootspec_doc + let init_string = bootspec_doc .init .into_os_string() .into_string() - .expect("Failed to convert init to string")]; + .expect("Failed to convert init to string"); + let mut kernel_cmdline: Vec = vec![format!("init={}", init_string)]; kernel_cmdline.extend(bootspec_doc.kernel_params); let lanzaboote_image = pe::assemble_image( @@ -44,7 +44,7 @@ pub fn install( &kernel_cmdline, &esp_paths.kernel, &esp_paths.initrd, - &esp_paths.esp + &esp_paths.esp, ) .context("Failed to assemble stub")?;