16 lines
564 B
Bash
Executable file
16 lines
564 B
Bash
Executable file
#!/bin/sh
|
|
set -e
|
|
rm -rf img
|
|
mkdir -p img/boot/efi/boot
|
|
cd kernel && cargo build --release && cd ..
|
|
cd loader && cargo build --release && cd ..
|
|
cp loader/target/x86_64-unknown-uefi/release/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
|