From 088efd4b569372285264526194dc2cbef51c70f3 Mon Sep 17 00:00:00 2001 From: antifallobst Date: Fri, 10 Mar 2023 12:48:57 +0100 Subject: [PATCH] feature (build system): added toolchain check to build.sh --- build.sh | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 1c7fc7c..091f84d 100755 --- a/build.sh +++ b/build.sh @@ -30,6 +30,27 @@ workspace_setup() { echo "" } +check_toolchain() { + echo " --> Checking Toolchain" + hash gcc + echo " |--> found gcc" + hash ld + echo " |--> found ld" + hash nasm + echo " |--> found nasm" + hash cmake + echo " |--> found cmake" + hash xorriso + echo " |--> found xorriso" + hash qemu-system-x86_64 + echo " |--> found qemu" + + [ ! -d "/usr/share/ovmf/x64/" ] && echo "OVMF binaries not found!" && exit 255 + echo " |--> found ovmf" + + echo " --> All checks passed" +} + kernel_build() { echo " --> Building kernel" @@ -88,11 +109,18 @@ generate_image() { echo "!=====[ NoxOS build script ]=====!" -workspace_setup -kernel_build -[ ! -d "build/limine" ] && limine_install -generate_initial_ramdisk -generate_image +case $1 in + "check") + check_toolchain + ;; + *) + workspace_setup + kernel_build + [ ! -d "build/limine" ] && limine_install + generate_initial_ramdisk + generate_image + ;; +esac echo "!=====[ Finished ]=====!"