Copy boot config file to boot partition

This commit is contained in:
pjht 2024-09-06 11:41:45 -05:00
parent 922a5655fd
commit c7f5971f9f
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E
2 changed files with 19 additions and 7 deletions

10
boot.json Normal file
View File

@ -0,0 +1,10 @@
{
"frame_buffer": {
"minimum_framebuffer_height": null,
"minimum_framebuffer_width": null
},
"log_level": "Trace",
"frame_buffer_logging": true,
"serial_logging": true,
"_test_sentinel": 0
}

View File

@ -1,10 +1,4 @@
use std::{
env,
fs,
os::unix::ffi::OsStrExt,
path::PathBuf,
process::Command,
};
use std::{env, fs, os::unix::ffi::OsStrExt, path::PathBuf, process::Command};
use gpt::{mbr::ProtectiveMBR, GptConfig};
@ -15,6 +9,7 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rerun-if-changed=initrd_file_list");
println!("cargo:rerun-if-changed=bootloader-x86_64-uefi.efi");
println!("cargo:rerun-if-changed=boot.json");
// set by cargo, build scripts should use this directory for output files
let out_dir = std::env::var_os("OUT_DIR").unwrap();
@ -151,6 +146,13 @@ fn main() {
.arg("::ramdisk")
.output()
.unwrap();
Command::new("mcopy")
.arg("-i")
.arg("tmp_esp.img")
.arg("boot.json")
.arg("::")
.output()
.unwrap();
Command::new("dd")
.arg("if=tmp_esp.img")