From c7f5971f9f94f88ec4afb1d433908339533e0558 Mon Sep 17 00:00:00 2001 From: pjht Date: Fri, 6 Sep 2024 11:41:45 -0500 Subject: [PATCH] Copy boot config file to boot partition --- boot.json | 10 ++++++++++ build.rs | 16 +++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 boot.json diff --git a/boot.json b/boot.json new file mode 100644 index 0000000..e8d08c4 --- /dev/null +++ b/boot.json @@ -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 +} diff --git a/build.rs b/build.rs index 77eb826..a84a75d 100644 --- a/build.rs +++ b/build.rs @@ -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")