feat: Added wrapper crate for including ipxe binaries

This commit is contained in:
2026-10-04 05:39:26 +02:00
parent 4bea843e53
commit f9da1d907b
9 changed files with 120 additions and 34 deletions
+5 -1
View File
@@ -11,6 +11,7 @@ use crete::tftp::ServerError;
use crete::{get_configs_path, get_repo_path, set_repo_path, tftp};
use futures::StreamExt;
use futures::future::join_all;
use ipxe::IPXE_DIR;
use minijinja::context;
use regex::Regex;
use thiserror::Error;
@@ -117,7 +118,10 @@ async fn main() -> Result<(), Error> {
println!("{filename}");
async move {
if let Some(caps) = re.captures(&filename) {
const IPXE_PATTERN: &str = "ipxe/";
if let Some(filename) = filename.strip_prefix(IPXE_PATTERN) {
Some(IPXE_DIR.get_file(filename)?.contents().to_owned())
} else if let Some(caps) = re.captures(&filename) {
let cluster = &caps["cluster"];
let node = &caps["node"];