From ada43910d2ceeda686a28d58d27abd5295b8c251 Mon Sep 17 00:00:00 2001 From: able Date: Wed, 20 Sep 2023 12:26:36 -0500 Subject: [PATCH] edits to support multi-arch iso --- repbuild/limine.cfg | 2 +- repbuild/src/main.rs | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/repbuild/limine.cfg b/repbuild/limine.cfg index 7f740f44..3b6a4502 100644 --- a/repbuild/limine.cfg +++ b/repbuild/limine.cfg @@ -12,7 +12,7 @@ TERM_BACKDROP=008080 :AbleOS COMMENT=Default AbleOS boot entry. PROTOCOL=limine - KERNEL_PATH=${ABLEOS_KERNEL} + KERNEL_PATH=${ABLEOS_KERNEL}_${ARCH} # execute is an array of boot modules to execute KERNEL_CMDLINE="execute=[0,1]" # Setting a default resolution for the framebuffer diff --git a/repbuild/src/main.rs b/repbuild/src/main.rs index e2b7f955..88d9ea2b 100644 --- a/repbuild/src/main.rs +++ b/repbuild/src/main.rs @@ -147,10 +147,17 @@ fn build(release: bool, target: Target) -> Result<(), Error> { _ => (), } + let mut path: String = "kernel".to_string(); let kernel_dir = match target { - Target::X86_64 => "target/x86_64-ableos", + Target::X86_64 => { + path.push_str("_x86-64"); + "target/x86_64-ableos" + } Target::Riscv64Virt => "target/riscv64-virt-ableos", - Target::Aarch64 => "target/aarch64-virt-ableos", + Target::Aarch64 => { + path.push_str("_aarch64"); + "target/aarch64-virt-ableos" + } }; (|| -> std::io::Result<_> { @@ -160,7 +167,7 @@ fn build(release: bool, target: Target) -> Result<(), Error> { .join(if release { "release" } else { "debug" }) .join("kernel"), )?, - &mut fs.root_dir().create_file("kernel")?, + &mut fs.root_dir().create_file(&path)?, ) .map(|_| ()) })()