stub: rename sections for UKI compatibility
systemd 255 is stricter in what it considers UKIs. It demands .linux and .initrd sections. Rename our sections that contain the respective filenames to match these names.
This commit is contained in:
parent
14afe7ce9b
commit
5de0b3e54a
|
@ -47,10 +47,10 @@ pub fn lanzaboote_image(
|
||||||
let sections = vec![
|
let sections = vec![
|
||||||
s(".osrel", os_release, os_release_offs),
|
s(".osrel", os_release, os_release_offs),
|
||||||
s(".cmdline", kernel_cmdline_file, kernel_cmdline_offs),
|
s(".cmdline", kernel_cmdline_file, kernel_cmdline_offs),
|
||||||
s(".initrdp", initrd_path_file, initrd_path_offs),
|
s(".initrd", initrd_path_file, initrd_path_offs),
|
||||||
s(".kernelp", kernel_path_file, kernel_path_offs),
|
s(".linux", kernel_path_file, kernel_path_offs),
|
||||||
s(".initrdh", initrd_hash_file, initrd_hash_offs),
|
s(".initrdh", initrd_hash_file, initrd_hash_offs),
|
||||||
s(".kernelh", kernel_hash_file, kernel_hash_offs),
|
s(".linuxh", kernel_hash_file, kernel_hash_offs),
|
||||||
];
|
];
|
||||||
|
|
||||||
let image_path = tempdir.path().join(tmpname());
|
let image_path = tempdir.path().join(tmpname());
|
||||||
|
|
|
@ -271,11 +271,11 @@ impl Installer {
|
||||||
let stub = fs::read(&stub_target)?;
|
let stub = fs::read(&stub_target)?;
|
||||||
let kernel_path = resolve_efi_path(
|
let kernel_path = resolve_efi_path(
|
||||||
&self.esp_paths.esp,
|
&self.esp_paths.esp,
|
||||||
pe::read_section_data(&stub, ".kernelp").context("Missing kernel path.")?,
|
pe::read_section_data(&stub, ".linux").context("Missing kernel path.")?,
|
||||||
)?;
|
)?;
|
||||||
let initrd_path = resolve_efi_path(
|
let initrd_path = resolve_efi_path(
|
||||||
&self.esp_paths.esp,
|
&self.esp_paths.esp,
|
||||||
pe::read_section_data(&stub, ".initrdp").context("Missing initrd path.")?,
|
pe::read_section_data(&stub, ".initrd").context("Missing initrd path.")?,
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
if !kernel_path.exists() && !initrd_path.exists() {
|
if !kernel_path.exists() && !initrd_path.exists() {
|
||||||
|
|
|
@ -46,10 +46,10 @@ fn extract_hash(pe_data: &[u8], section: &str) -> Result<Hash> {
|
||||||
impl EmbeddedConfiguration {
|
impl EmbeddedConfiguration {
|
||||||
fn new(file_data: &[u8]) -> Result<Self> {
|
fn new(file_data: &[u8]) -> Result<Self> {
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
kernel_filename: extract_string(file_data, ".kernelp")?,
|
kernel_filename: extract_string(file_data, ".linux")?,
|
||||||
kernel_hash: extract_hash(file_data, ".kernelh")?,
|
kernel_hash: extract_hash(file_data, ".linuxh")?,
|
||||||
|
|
||||||
initrd_filename: extract_string(file_data, ".initrdp")?,
|
initrd_filename: extract_string(file_data, ".initrd")?,
|
||||||
initrd_hash: extract_hash(file_data, ".initrdh")?,
|
initrd_hash: extract_hash(file_data, ".initrdh")?,
|
||||||
|
|
||||||
cmdline: extract_string(file_data, ".cmdline")?,
|
cmdline: extract_string(file_data, ".cmdline")?,
|
||||||
|
|
Loading…
Reference in New Issue