Skip to content

Commit c87d041

Browse files
committed
Include boot config when using TFTP booting
1 parent 510a44b commit c87d041

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/uefi/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ impl UefiBoot {
6868
bootloader_path,
6969
self.kernel.as_path(),
7070
self.ramdisk.as_deref(),
71+
self.config.as_deref(),
7172
out_path,
7273
)
7374
.context("failed to create UEFI PXE tftp folder")?;

src/uefi/pxe.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
use std::path::Path;
22

33
use anyhow::Context;
4+
use bootloader_boot_config::BootConfig;
45

56
pub fn create_uefi_tftp_folder(
67
bootloader_path: &Path,
78
kernel_binary: &Path,
89
ramdisk_path: Option<&Path>,
10+
boot_config: Option<&str>,
911
out_path: &Path,
1012
) -> anyhow::Result<()> {
1113
std::fs::create_dir_all(out_path)
@@ -39,5 +41,10 @@ pub fn create_uefi_tftp_folder(
3941
})?;
4042
}
4143

44+
if let Some(config) = boot_config {
45+
let to = out_path.join("boot.json");
46+
std::fs::write(to, config).context("failed to write boot.json")?;
47+
}
48+
4249
Ok(())
4350
}

0 commit comments

Comments
 (0)