NetBSD Problem Report #55582

From  Mon Aug 17 20:28:00 2020
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 9D2B41A9239
	for <>; Mon, 17 Aug 2020 20:28:00 +0000 (UTC)
Message-Id: <>
Date: Mon, 17 Aug 2020 20:27:58 +0000 (UTC)
Subject: OVMF files limit qemu boot capabilities
X-Send-Pr-Version: www-1.0

>Number:         55582
>Category:       pkg
>Synopsis:       OVMF files limit qemu boot capabilities
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Aug 17 20:30:00 +0000 2020
>Originator:     Bob Nestor
>Release:        pkgsrc-current
NetBSD 9.99.70 NetBSD 9.99.70 (GENERIC) #0: Fri Aug 14 03:54:46 UTC 2020 amd64
Some CDs and hard disks that are bootable on bare metal are not bootable under qemu and hang during boot about 2/3 of the way thru the process. This can be seen in the progress bar of the boot sequence.  The problem appears to be the version of OVMF in pkgsrc, which is built off of a stable2018 release.  Using the OVMF files built from the stable202005 release allows qemu to (mostly) boot from the problem CDs and hard disks. Even with the newer OVMF files there appear to be some issues with CDs, but booting from disks works. 
Download a copy of the rEFInd CD from

Create a small bootable disk using files on the CD
vndconfig -c vnd0 refind-cd-0.12.0.iso
mount -t cd9660 /dev/vnd0a /media
rm -fr refind.dsk /tmp/refind
mkdir -p -m 0755 /tmp/refind/EFI/boot /tmp/refind/EFI/refind
cp /media/refind/refind_x64.efi /tmp/refind/EFI/boot/bootx64.efi
cp -r /media/refind/* /tmp/refind/EFI/refind/
echo 'fs0:\EFI\refind\refind_x64.efi' >/tmp/refind/startup.nsh
cd /tmp/refind/EFI/refind
cp refind.conf-sample refind.conf
rm -fr bootaa64.efi drivers_aa64 bootia32.efi drivers_ia32 refind_aa64.efi
rm -fr refind_ia32.efi tools_aa64 tools_ia32
cd ${cwd}
umount /media
vndconfig -u vnd0
makefs -M 1m -m 4m -B 1234   -t msdos -o F=16,c=1 refind.dsk /tmp/refind

Try booting the newly created disk using
accel="-vga cirrus"
if [ ! -f ${vars} ]; then
    dd if=/dev/zero of=${vars} count=4 bs=1024
qemu-system-x86_64 -m 4096 -machine q35 ${accel} -boot menu=on \
    -device qemu-xhci -device usb-tablet -device usb-mouse -smbios type=2 \
    -drive if=pflash,format=raw,readonly,file=${ovmf} \
    -drive if=pflash,format=raw,file=${vars} \
    -device ich9-ahci,id=sata \
    -device ide-hd,bus=sata.0,drive=disk \
    -drive id=disk,if=none,media=disk,format=raw,file=${disk} 

The boot stalls with the boot progress bar about 2/3 of the way complete. Replacing the OVMF file with one built from the stable202005 release allows the boot to complete.
Updating the build of ovmf in pkgsrc to use the latest stable202005 release is the obvious solution, although it doesn't fully address the
problem of booting CDs like the rEFInd one which may be a problem in ovmf or in qemu.

I've looked at updating the build of ovmf in pkgsrc, but it's way over my head.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.