use std::path::PathBuf;

fn main() {
    let out_dir = PathBuf::from(std::env::var_os("OUT_DIR").unwrap());
    let kernel = PathBuf::from(std::env::var_os("CARGO_BIN_FILE_HEX_KERNEL_hex_kernel").unwrap());

    // Create UEFI kernel
    let kernel_path = out_dir.join("kernel.img");
    bootloader::UefiBoot::new(&kernel)
        .create_disk_image(&kernel_path)
        .unwrap();

    // Pass image path to main.rs
    println!("cargo:rustc-env=KERNEL_PATH={}", kernel_path.display());
}