Skip to content

run_qemu.sh: replace qemu -S + KVM with a long bootloader timeout #135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion run_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,11 @@ update_rootfs_boot_kernel()

defconf="$builddir/mnt/loader/loader.conf"
local loader_timeout=4
if [[ $_arg_kvm == "on" ]] && [[ $_arg_gdb == "on" ]]; then
# KVM is not compatible with qemu -S, see
# https://github.com/pmem/run_qemu/issues/11
loader_timeout=301
fi

# mkosi->"bootctl install ..." creates a stub loader.conf.
# It can also come from a previous run of this script.
Expand Down Expand Up @@ -1872,7 +1877,22 @@ prepare_qcmd()
fi

if [ "$_arg_gdb" == "on" ]; then
qcmd+=("-gdb" "tcp::10000" "-S")
qcmd+=("-gdb" "tcp::10000")
# -S seems to rely on a _software_ breakpoint which seems incompatible with KVM,
# see https://github.com/pmem/run_qemu/issues/11
if [[ "$_arg_kvm" == 'on' ]]; then
{
printf '\n\nWARNING: qemu "-S" option seems incompatible with KVM; not used.\n'
if [[ "$_arg_direct_kernel" == 'on' ]]; then
printf '\tOption --no-direct-kernel is recommended.\n\n'
else
printf '\tBoot loader will wait a few minutes.\n\n'
fi
} >&2
sleep 2
else
qcmd+=("-S")
fi
fi

# cpu + mem nodes (i.e. the --nodes option)
Expand Down