Wip
This commit is contained in:
@@ -869,18 +869,45 @@ if [ "$QUICK_MODE" = false ] && [ -n "${OVMF_PATH:-}" ] && [ -f "${ISO}" ]; then
|
||||
OVMF_FLAGS="-bios ${OVMF_PATH}"
|
||||
fi
|
||||
|
||||
timeout 60 qemu-system-x86_64 \
|
||||
${KVM_FLAG} \
|
||||
-m 2G \
|
||||
-smp 2 \
|
||||
${OVMF_FLAGS} \
|
||||
-cdrom "$ISO" \
|
||||
-drive file="$QEMU_DISK",format=qcow2,if=virtio \
|
||||
-nographic \
|
||||
-serial mon:stdio \
|
||||
-no-reboot \
|
||||
2>"${LOG_DIR}/qemu-stderr.log" | head -200 > "${LOG_DIR}/qemu-output.log" &
|
||||
QEMU_PID=$!
|
||||
# Check if we have a real kernel for direct boot (more reliable than UEFI ISO in QEMU)
|
||||
HAS_KERNEL=false
|
||||
[ -f "${PROJECT_ROOT}/kernel/vmlinuz" ] && HAS_KERNEL=true
|
||||
|
||||
INITRD_FLAGS=""
|
||||
[ -f "${PROJECT_ROOT}/src/iso/initramfs.cpio.gz" ] && \
|
||||
INITRD_FLAGS="-initrd ${PROJECT_ROOT}/src/iso/initramfs.cpio.gz"
|
||||
|
||||
if [ "$HAS_KERNEL" = true ]; then
|
||||
echo " Using direct kernel boot (kernel + initramfs)..."
|
||||
timeout 60 qemu-system-x86_64 \
|
||||
${KVM_FLAG} \
|
||||
-m 2G \
|
||||
-smp 2 \
|
||||
-kernel "${PROJECT_ROOT}/kernel/vmlinuz" \
|
||||
${INITRD_FLAGS} \
|
||||
-append "console=ttyS0,115200n8" \
|
||||
-cdrom "$ISO" \
|
||||
-drive file="$QEMU_DISK",format=qcow2,if=virtio \
|
||||
-nographic \
|
||||
-serial mon:stdio \
|
||||
-no-reboot \
|
||||
2>"${LOG_DIR}/qemu-stderr.log" | head -200 > "${LOG_DIR}/qemu-output.log" &
|
||||
QEMU_PID=$!
|
||||
else
|
||||
echo " Using UEFI ISO boot (no compiled kernel found)..."
|
||||
timeout 60 qemu-system-x86_64 \
|
||||
${KVM_FLAG} \
|
||||
-m 2G \
|
||||
-smp 2 \
|
||||
${OVMF_FLAGS} \
|
||||
-cdrom "$ISO" \
|
||||
-drive file="$QEMU_DISK",format=qcow2,if=virtio \
|
||||
-nographic \
|
||||
-serial mon:stdio \
|
||||
-no-reboot \
|
||||
2>"${LOG_DIR}/qemu-stderr.log" | head -200 > "${LOG_DIR}/qemu-output.log" &
|
||||
QEMU_PID=$!
|
||||
fi
|
||||
|
||||
sleep 60
|
||||
kill $QEMU_PID 2>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user