Write the paths to the initrd and kernel to files in the build script

This commit is contained in:
pjht 2024-06-09 18:40:37 -05:00
parent 6e7424bbf0
commit c63a523b6c
Signed by: pjht
GPG Key ID: 7B5F6AFBEC7EE78E
2 changed files with 6 additions and 1 deletions

2
.gitignore vendored
View File

@ -1,2 +1,4 @@
target
sysroot
initrd_path
kernel_path

View File

@ -1,4 +1,4 @@
use std::{path::{Path, PathBuf}, process::Command};
use std::{os::unix::ffi::OsStrExt, path::{Path, PathBuf}, process::Command};
extern crate bootloader;
@ -43,4 +43,7 @@ fn main() {
println!("cargo:rustc-env=UEFI_PATH={}", uefi_path.to_string_lossy());
println!("cargo:rustc-env=BIOS_PATH={}", bios_path.to_string_lossy());
std::fs::write("kernel_path", kernel.as_os_str().as_bytes()).unwrap();
std::fs::write("initrd_path", initrd_path.as_os_str().as_bytes()).unwrap();
}