From 3c0335f7be3deb4647817a04f9a4d9d1372200a3 Mon Sep 17 00:00:00 2001
From: sigsegv7 <ian@vegaa.systems>
Date: Tue, 26 Sep 2023 19:20:16 -0400
Subject: build: Use limine v5.x

Signed-off-by: sigsegv7 <ian@vegaa.systems>
---
 Makefile.in | 13 ++++++++-----
 bootstrap   |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 63a0a35..fa3c4f9 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -77,6 +77,7 @@ sys/include/machine/:
 	cd sys/include/; ln -sf arch/$(ARCH) machine
 
 base/boot/vega-kernel: $(KERNEL_OBJECTS) $(KERNEL_ASMOBJECTS)
+	rm -rf iso_root
 	mkdir -p base/boot/
 	$(PROMPT) " LD " $(shell pwd)/base/boot/vega-kernel
 	$(LD) $(KERNEL_LDFLAGS) $(KERNEL_OBJECTS) $(KERNEL_ASMOBJECTS) -o base/boot/vega-kernel
@@ -88,14 +89,16 @@ base/boot/vega-kernel: $(KERNEL_OBJECTS) $(KERNEL_ASMOBJECTS)
 	$(PROMPT) " RAMFS " $(shell pwd)/initramfs.tar
 	# === Building ISO ===
 	mkdir -p iso_root/boot/
-	cp conf/limine.cfg stand/limine/limine.sys \
-		stand/limine/limine-cd.bin stand/limine/limine-cd-efi.bin iso_root/
+	mkdir -p iso_root/EFI/BOOT/
+	cp stand/limine/BOOTX64.EFI iso_root/EFI/BOOT/
+	cp conf/limine.cfg stand/limine/limine-bios.sys \
+		stand/limine/limine-bios-cd.bin stand/limine/limine-uefi-cd.bin iso_root/
 	cp base/boot/vega-kernel iso_root/boot/
 	mv initramfs.tar iso_root/boot/
-	xorriso -as mkisofs -b limine-cd.bin -no-emul-boot -boot-load-size 4\
-		-boot-info-table --efi-boot limine-cd-efi.bin -efi-boot-part \
+	xorriso -as mkisofs -b limine-bios-cd.bin -no-emul-boot -boot-load-size 4\
+		-boot-info-table --efi-boot limine-uefi-cd.bin -efi-boot-part \
 		--efi-boot-image --protective-msdos-label iso_root -o Vega.iso > /dev/null
-	stand/limine/limine-deploy Vega.iso > /dev/null
+	stand/limine/limine bios-install Vega.iso
 	$(PROMPT) " ISO " $(shell pwd)/Vega.iso
 
 -include $(KERNEL_HEADER_DEPS)
diff --git a/bootstrap b/bootstrap
index 13affeb..9c4ad77 100755
--- a/bootstrap
+++ b/bootstrap
@@ -15,7 +15,7 @@ try_fetch() {
 }
 
 fetch() {
-    try_fetch "git clone https://github.com/limine-bootloader/limine.git --branch=v4.x-branch-binary --depth=1" "stand/limine"
+    try_fetch "git clone https://github.com/limine-bootloader/limine.git --branch=v5.x-branch-binary --depth=1" "stand/limine"
 }
 
 build_limine() {
-- 
cgit v1.2.3