os/build.sh
Mathieu Strypsteen 9dd71885d3
All checks were successful
Build / build (push) Successful in 2m53s
Add debug target
2024-12-13 13:00:55 +01:00

30 lines
737 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
target=${OS_TARGET:-release}
rm -rf img
mkdir -p img/boot/efi/boot
cd lib/acpica-build
make -j4
cd ../../kernel
if [ "$target" = "release" ]; then
cargo build --release
else
cargo build
fi
cd ../loader
if [ "$target" = "release" ]; then
cargo build --release
else
cargo build
fi
cd ..
cp target/x86_64-unknown-uefi/$target/loader.efi img/boot/efi/boot/bootx64.efi
cd img
dd if=/dev/zero of=boot.img bs=1M count=16 status=none
mformat -i boot.img
mcopy -si boot.img boot/* ::
dd if=/dev/zero of=os.img bs=1M count=32 status=none
parted -s os.img mklabel gpt
parted -s os.img mkpart primary fat32 2048s 100%
parted -s os.img set 1 esp on
dd if=boot.img of=os.img bs=1M seek=1 conv=notrunc status=none