Makefile: initrd creation

This commit is contained in:
Matheus
2023-04-30 22:57:35 -03:00
parent 6aef90a979
commit c2e15306b3
3 changed files with 19 additions and 4 deletions
+2
View File
@@ -12,3 +12,5 @@ kernel-src/include/limine.h
kernel-src/include/printf.h kernel-src/include/printf.h
kernel-src/io/printf.c kernel-src/io/printf.c
kernel-src/flanterm kernel-src/flanterm
sysroot
minimalsysroot
+15 -2
View File
@@ -3,8 +3,10 @@ ISO=astral.iso
LIMINEDIR=$(shell pwd)/host-pkgs/limine/usr/local/share/limine/ LIMINEDIR=$(shell pwd)/host-pkgs/limine/usr/local/share/limine/
KERNEL=$(shell pwd)/pkgs/astral/boot/astral KERNEL=$(shell pwd)/pkgs/astral/boot/astral
QEMUFLAGS=-cdrom $(ISO) -m 2G -smp cpus=2 -no-shutdown -no-reboot -monitor stdio -debugcon file:/dev/stdout -serial file:/dev/stdout # hacky but works :') QEMUFLAGS=-cdrom $(ISO) -m 2G -smp cpus=2 -no-shutdown -no-reboot -monitor stdio -debugcon file:/dev/stdout -serial file:/dev/stdout # hacky but works :')
INITRD=$(shell pwd)/iso/initrd
DISTROTYPE=full
.PHONY: all kernel clean clean-kernel iso .PHONY: all kernel clean clean-kernel iso initrd full minimal
all: jinx all: jinx
make kernel make kernel
@@ -15,11 +17,22 @@ jinx:
curl https://raw.githubusercontent.com/mintsuki/jinx/trunk/jinx > jinx curl https://raw.githubusercontent.com/mintsuki/jinx/trunk/jinx > jinx
chmod +x jinx chmod +x jinx
$(ISO): limine.cfg liminebg.bmp $(KERNEL) $(ISO): limine.cfg liminebg.bmp $(KERNEL) initrd
mkdir -p $(ISODIR) mkdir -p $(ISODIR)
cp $(KERNEL) liminebg.bmp limine.cfg $(LIMINEDIR)/limine.sys $(LIMINEDIR)/limine-cd.bin $(LIMINEDIR)/limine-cd-efi.bin $(ISODIR) cp $(KERNEL) liminebg.bmp limine.cfg $(LIMINEDIR)/limine.sys $(LIMINEDIR)/limine-cd.bin $(LIMINEDIR)/limine-cd-efi.bin $(ISODIR)
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 --efi-boot-image --protective-msdos-label $(ISODIR) -o $(ISO) 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 --efi-boot-image --protective-msdos-label $(ISODIR) -o $(ISO)
initrd:
make $(DISTROTYPE)
full:
./jinx sysroot
cd sysroot; tar -cf $(INITRD) *
minimal:
./jinx install minimalsysroot mlibc
cd minimalsysroot; tar -cf $(INITRD) *
kernel: kernel:
rm -f builds/astral.configured rm -f builds/astral.configured
rm -f builds/astral.installed rm -f builds/astral.installed
+2 -2
View File
@@ -6,6 +6,6 @@ TIMEOUT=5
:Astral :Astral
PROTOCOL=limine PROTOCOL=limine
KERNEL_PATH=boot:///astral KERNEL_PATH=boot:///astral
#MODULE_PATH=boot:///initrd MODULE_PATH=boot:///initrd
#KERNEL_CMDLINE= KERNEL_CMDLINE=
COMMENT="The Astral operating system" COMMENT="The Astral operating system"