[UEFI] Update flash script for macOS host
set -e
cd uefi
-make
+# make
cd ..
make
-dd if=/dev/zero of=fat.img bs=512 count=2880
-mformat -i fat.img -f 2880 ::
+cd kernel
+make
+cd ..
+
+dd if=/dev/zero of=fat.img bs=512 count=131072
+# mformat -i fat.img -f 92160 ::
+disk=$(hdiutil attach -imagekey diskimage-class=CRawDiskImage -nomount ./fat.img)
+echo $disk
+newfs_msdos -F 32 -S 512 -s 131072 $disk
mmd -i fat.img ::/EFI
mmd -i fat.img ::/EFI/BOOT
mcopy -i fat.img BOOTX64.EFI ::/EFI/BOOT
mmd -i fat.img ::/EFI/AXLE
mcopy -i fat.img kernel/kernel.elf ::/EFI/AXLE/KERNEL.ELF
+mcopy -i fat.img initrd.img ::/EFI/AXLE/INITRD.IMG
+
+# umount $disk
-qemu-system-x86_64 -bios /home/phillip/Downloads/OVMF-pure-efi.fd -usb -drive if=none,id=stick,format=raw,file=./fat.img -device usb-storage,drive=stick -monitor stdio -m 2G
+qemu-system-x86_64 -bios /Users/philliptennen/Downloads/RELEASEX64_OVMF.fd -usb -drive if=none,id=stick,format=raw,file=./fat.img -device usb-storage,drive=stick -monitor stdio -m 2G
