[edk2-devel] BUG: tianocore does not honor the bootorder

Gregory Lee Bartholomew gregory.lee.bartholomew at gmail.com
Fri Feb 17 16:23:22 UTC 2023


On Fri, 2023-02-17 at 14:08 +0100, Gerd Hoffmann wrote:
> On Wed, Feb 15, 2023 at 02:20:23PM -0600, Gregory Lee Bartholomew wrote:
> > I have a script that uses Qemu to install a Linux OS to the supplied device. At
> > the end of the install script, efibootmgr is called to create UEFI boot entries
> > and set the boot order. However, every time I boot the VM, it boots to entry
> > 0004 "UEFI Misc Device" instead of the proper entry specified in the bootorder.
> > This is confusing a script that I have for managing multiple ESPs (the script
> > needs to detect the current ESP and sync its contents to secondary/backup ESPs).
>  
> > Please fix tianocore to honor the bootorder instead of creating its own entries.
> 
> ovmf orders the boot entries according to the qemu configuration
> (bootindex property for devices).  If you don't want that just remove
> all bootindex properties from your qemu command line.
> 
> take care,
>   Gerd
> 

I don't believe I've set a bootindex. Below is the script that I'm using to
start the qemu instances.

#!/usr/bin/bash
# vim:set ts=3:

if [[ -z $1 ]]; then
	echo "usage: ${0##*/} <nework interface>" 1>&2
	exit 1
fi

if ! [[ -e /sys/class/net/$1 ]]; then
	echo "error: network interface '$1' not found" 1>&2
	exit 1
fi

TAP=$(ls /sys/class/net/$1/macvtap 2>/dev/null | grep -m 1 '^tap[0-9]\+$')

if [[ -z $TAP ]]; then
	echo "error: network interface '$1' does not appear to be" \
		"a macvtap device" 1>&2
	exit 1
fi

MAC=$(</sys/class/net/$1/address)

set -e

exec {fd}<>"/dev/$TAP"

DIR="${0%/*}"

source "$DIR/environment"

ARCH=$(uname -m)
exec qemu-system-$ARCH \
	-name "foz" \
	-machine "accel=kvm,vmport=off" \
	-m "${QEMU_MEMORY}" \
	-cpu "host" -smp "${QEMU_PROCESSORS}" \
	-netdev "tap,id=$1,fd=$fd" \
	-device "virtio-net-pci,netdev=$1,mac=$MAC" \
	-chardev "spicevmc,id=c1,name=vdagent" -device "virtio-serial-pci" \
	-device "virtserialport,chardev=c1,id=c1,name=com.redhat.spice.0" \
	-drive
"if=pflash,format=raw,unit=0,file=$DIR/efi/OVMF_CODE.fd,readonly=on" \
	-drive "if=pflash,format=raw,unit=1,file=$DIR/efi/OVMF_VARS.fd" \
	-drive "if=virtio,format=raw,file=${QEMU_DRIVE1}" \
	-drive "if=virtio,format=raw,file=${QEMU_DRIVE2}" \
	-vga "qxl" \
	-spice "$(printf -- '%s' \
		"x509-dir=$DIR/crt," \
		"password=${SPICE_PASSWORD}," \
		"addr=${SPICE_ADDRESS}," \
		"tls-port=${SPICE_PORT}" \
	)" \
	-monitor "unix:/run/foz.socket,server,nowait"



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#100325): https://edk2.groups.io/g/devel/message/100325
Mute This Topic: https://groups.io/mt/97012103/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list