Add initrd
diff --git a/src/Makefile b/src/Makefile
index 11ea55c..2aa05f5 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,6 +4,6 @@
$(MAKE) -C kernel install
mkinitrd:
- $(MAKE) -C mkinitrd
+ $(MAKE) -C mkinitrd install
.PHONY: kernel mkinitrd
diff --git a/src/kernel/Makefile b/src/kernel/Makefile
index 3cb20f8..60a95ab 100644
--- a/src/kernel/Makefile
+++ b/src/kernel/Makefile
@@ -48,9 +48,13 @@
.s.o:
nasm $(ASMFLAGS) $<
-install: kernel.elf
+$(JAYROOT)/boot/initrd.img:
+ $(MAKE) -C $(JAYROOT)/boot/initrd initrd.img
+ cp $(JAYROOT)/boot/initrd/initrd.img $(JAYROOT)/boot/
+
+install: kernel.elf $(JAYROOT)/boot/initrd.img
cp kernel.elf $(JAYROOT)/boot/
rm -f $(JAYROOT)/bin/bluejay.iso
grub-mkrescue -o $(JAYROOT)/bin/bluejay.iso $(JAYROOT)
-.PHONY: install qemu clean qemu-iso debug
+.PHONY: install qemu clean qemu-iso debug $(JAYROOT)/boot/initrd.img
diff --git a/src/mkinitrd/Makefile b/src/mkinitrd/Makefile
index 66b7893..b121b75 100644
--- a/src/mkinitrd/Makefile
+++ b/src/mkinitrd/Makefile
@@ -5,7 +5,10 @@
mkinitrd: $(OBJECTS)
$(CC) -o $@ $^
+install: mkinitrd
+ cp mkinitrd $(JAYROOT)/bin
+
clean:
rm -f *.o mkinitrd
-.PHONY: clean
+.PHONY: clean install
diff --git a/src/mkinitrd/main.c b/src/mkinitrd/main.c
index 228b04b..f2b3f71 100644
--- a/src/mkinitrd/main.c
+++ b/src/mkinitrd/main.c
@@ -53,7 +53,7 @@
.size = file_size(in),
};
- strncpy(file.name, 64, argv[i + 2]);
+ strcpy(file.name, argv[i + 2]);
char c;
while ((c = getc(in)) != EOF)