aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMarvin Borner2019-10-30 16:02:10 +0100
committerMarvin Borner2019-10-30 16:02:10 +0100
commit118898807865ba11f5d7754f6f0572a0403f8512 (patch)
tree0b69c881089d659ebb214c409b699cc06323ab3d /Makefile
parentfd4f0a11126a20e75d72f8f2e6d418598fd5f37d (diff)
Started implementation of initrd based vfs
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 16 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 6773be9..9f28fbb 100644
--- a/Makefile
+++ b/Makefile
@@ -43,6 +43,22 @@ build: clean
cp ./src/kernel/grub.cfg ./iso/boot/grub/; \
grub-mkrescue -o ./build/melvix.iso ./iso/;
+image: build
+ @set -e; \
+ gcc -w ./src/utils/make_initrd.c -o ./build/make_initrd || exit; \
+ ./build/make_initrd ./src/utils/test.txt test.txt || exit; \
+ mv initrd.img ./build/initrd.img || exit; \
+ dd if=/dev/zero of=./build/image.img iflag=fullblock bs=1M count=10 && sync; \
+ mkfs.ext2 ./build/image.img; \
+ device=$$(sudo losetup -f); \
+ sudo losetup $$device ./build/image.img || exit; \
+ mkdir ./build/mnt/ || exit; \
+ sudo mount $$device ./build/mnt/ || exit; \
+ sudo cp ./build/melvix.iso ./build/mnt/kernel || exit; \
+ sudo cp ./build/initrd.img ./build/mnt/initrd || exit; \
+ sudo umount $$device || exit; \
+ sudo losetup -d $$device;
+
cross:
@set -e; \
[ -d "./cross/" ] && echo "Please remove ./cross/ and try again" && exit; \