36 lines
829 B
Bash
Executable file
36 lines
829 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 ../../init
|
|
if [ "$target" = "release" ]; then
|
|
cargo build --release
|
|
else
|
|
cargo build
|
|
fi
|
|
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
|