From 118898807865ba11f5d7754f6f0572a0403f8512 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Wed, 30 Oct 2019 16:02:10 +0100 Subject: Started implementation of initrd based vfs --- Makefile | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'Makefile') 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; \ -- cgit v1.2.3