Do not launch qemu by default.

This commit is contained in:
Andrius Štikonas 2022-08-20 15:33:06 +01:00
parent d5ce9bff72
commit d6800a8a9e
2 changed files with 11 additions and 8 deletions

View File

@ -35,14 +35,14 @@ $(build_dir)/%.o : %.c
.PHONY : clean rootfs qemu
all: $(targets2)
qemu: $(build_dir)/disk.img $(OVMF_IMG)
$(QEMU) -cpu qemu64 -net none \
$(QEMU_KVM) \
-drive if=pflash,format=raw,unit=0,file=$(OVMF_IMG),readonly=on \
-drive if=ide,format=raw,file=$<
all: $(targets2)
$(build_dir)/disk.img: $(build_dir)/esp.img
dd if=/dev/zero of=$@ bs=512 count=$(DISK_SIZE_SECTORS)
parted $@ -s -a minimal mklabel gpt

View File

@ -21,18 +21,21 @@ boot_dir = $(rootfs_dir)/EFI/BOOT
.PHONY : clean rootfs qemu
qemu: $(build_dir)/disk.img $(OVMF_IMG)
$(QEMU) -cpu qemu64 -net none \
$(QEMU_KVM) \
-drive if=pflash,format=raw,unit=0,file=$(OVMF_IMG),readonly=on \
-drive if=ide,format=raw,file=$<
$(build_dir)/disk.img: $(build_dir)/esp.img
dd if=/dev/zero of=$@ bs=512 count=$(DISK_SIZE_SECTORS)
parted $@ -s -a minimal mklabel gpt
parted $@ -s -a minimal mkpart EFI FAT32 2048s $(ESP_SIZE_SECTORS)s
parted $@ -s -a minimal toggle 1 boot
dd if=$< of=$@ bs=512 seek=2048 conv=notrunc
@echo -e "\n"
@echo "stage0-uefi disk image was created at" $@
@echo -e "\nRun 'make qemu' to try it inside QEMU"
qemu: $(build_dir)/disk.img $(OVMF_IMG)
$(QEMU) -cpu qemu64 -net none \
$(QEMU_KVM) \
-drive if=pflash,format=raw,unit=0,file=$(OVMF_IMG),readonly=on \
-drive if=ide,format=raw,file=$<
$(build_dir)/esp.img: rootfs
dd if=/dev/zero of=$@ bs=512 count=$(ESP_SIZE_SECTORS)