From b5a6c0bc97295af52281da1f7810572f331e64f4 Mon Sep 17 00:00:00 2001 From: Michael Shaw Date: Sat, 11 Jul 2026 20:11:43 -0400 Subject: [PATCH] Makefile: create initramfs.cpio Signed-off-by: Michael Shaw --- Makefile | 1 + scripts/Makefile.limine | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2eb8485..5e1ccf7 100644 --- a/Makefile +++ b/Makefile @@ -90,6 +90,7 @@ $(KERNEL): $(KOBJ) linker.ld .PHONY: clean clean: $(Q)$(MAKE) -f scripts/Makefile.build _clean obj=. + $(Q)rm -rf $(INITRAMFS) $(Q)rm -rf $(IMG) $(Q)rm -rf iso_root $(Q)rm -rf os_root diff --git a/scripts/Makefile.limine b/scripts/Makefile.limine index 5ae0859..309ef77 100644 --- a/scripts/Makefile.limine +++ b/scripts/Makefile.limine @@ -1,5 +1,7 @@ # SPDX-License-Identifier: GPL-2.0-only # Makefile stuff for all the booting and bootloader related stuff +# +INITRAMFS := initramfs.cpio $(IMG): limine/limine $(KERNEL) rm -rf $(IMG) @@ -32,8 +34,13 @@ limine/limine: LDFLAGS="$(HOST_LDFLAGS)" \ LIBS="$(HOST_LIBS)" +$(INITRAMFS): initramfs/ + $(Q)echo " CPIO $@" + $(Q)mkdir -p initramfs/ + $(Q)cd initramfs/ && find . | cpio -oH newc > ../$(INITRAMFS) + .PHONY += run -run: edk2-ovmf $(IMG) +run: edk2-ovmf $(INITRAMFS) $(IMG) qemu-system-$(ARCH) \ -M q35 \ -drive if=pflash,unit=0,format=raw,file=edk2-ovmf/ovmf-code-$(ARCH).fd,readonly=on \