Prevent running QEMU if disk mounted

This commit is contained in:
Wildan M 2026-05-08 19:30:35 +07:00
parent 260f98467e
commit 69dc41a1d8
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
2 changed files with 12 additions and 2 deletions

View File

@ -94,8 +94,12 @@ ifeq ($(FSTOOLS_IN_PODMAN),1)
$(PODMAN_RUN) make $@
else
@sync
-$(FUMOUNT) $(MOUNT_DIR)
ifneq ($(wildcard $(MOUNT_DIR)),)
$(FUMOUNT) $(MOUNT_DIR)
@rm -rf $(MOUNT_DIR)
@-$(FUMOUNT) /tmp/redox_installer 2>/dev/null || true
@echo "\033[1;36;49mFilesystem unmounted\033[0m"
else
@echo "\033[1;36;49mDisk is not mounted\033[0m"
endif
@-$(FUMOUNT) /tmp/redox_installer 2>/dev/null || true
endif

View File

@ -375,4 +375,10 @@ $(BUILD)/qemu_uboot.rom:
wget -O $@ https://gitlab.redox-os.org/Ivan/redox_firmware/-/raw/main/platform/qemu/qemu_arm64/u-boot-qemu-arm64.bin
qemu: qemu-deps
ifeq ($(wildcard $(MOUNT_DIR)),)
$(QEMU) $(QEMUFLAGS)
else
@echo "\033[1;38;5;196mDisk is mounted. Unmounting the disk...\033[0m";
$(MAKE) unmount
$(QEMU) $(QEMUFLAGS)
endif