How to persist domU efi boot order ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How to persist domU efi boot order ?

Håkon Alstadheim
I've been playing around with ovmf, hoping to get better support for my
graphics card, but efforts are hampered by loooong wait while ovmf is
searching for floppies (I believe, at least there is a long wait). I
have managed to get into the boot menu in ovmf and remove the floppies
from the boot order. (Hit escape repeatedly at the domU console ) . A
file "NvVars" gets created in the top-level of the "esp" partition, but
still next time i boot the VM, the same wait occurs.

What am I doing wrong?

Either ovmf is not reading NvVars, or else NvVars gets created without
my settings. Maybe my "esp" partition is not found until _after_ ovmf
searches all drives, also non-existant ones?

I _have_ checked to see that the floppies are removed from the
boot-order before I continue the boot-process,

Googling around I found this <https://lists.gt.net/xen/users/420486>, in
which

"wei.liu2 at citrix" says:
 > "As said in other email, we play a trick in our test system to
 > make ovmf load grub automatically. "

Anybody have a clue what that trick is, and care to share?

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xen.org/xen-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to persist domU efi boot order ?

James Dingwall
On Mon, Mar 20, 2017 at 08:03:37PM +0100, Håkon Alstadheim wrote:

> I've been playing around with ovmf, hoping to get better support for my
> graphics card, but efforts are hampered by loooong wait while ovmf is
> searching for floppies (I believe, at least there is a long wait). I
> have managed to get into the boot menu in ovmf and remove the floppies
> from the boot order. (Hit escape repeatedly at the domU console ) . A
> file "NvVars" gets created in the top-level of the "esp" partition, but
> still next time i boot the VM, the same wait occurs.
>
> What am I doing wrong?
>
> Either ovmf is not reading NvVars, or else NvVars gets created without
> my settings. Maybe my "esp" partition is not found until _after_ ovmf
> searches all drives, also non-existant ones?
>
> I _have_ checked to see that the floppies are removed from the
> boot-order before I continue the boot-process,
>
> Googling around I found this <https://lists.gt.net/xen/users/420486>, in
> which
>
> "wei.liu2 at citrix" says:
>  > "As said in other email, we play a trick in our test system to
>  > make ovmf load grub automatically. "
>
> Anybody have a clue what that trick is, and care to share?

IIRC Once you have have the NvVars created then you can make persistent modifications from an EFI shell.  You
cannot make persistent modifications from the OS unless you write the NvVars file directly because OVMF cannot
modify the NvVars files once the OS has started.  You can preconfigure the ESP with a bootx64.efi which is grub
or any other EFI executable or create a startup.nsh which configures the persistent boot options.

e.g.

cat << EOF > startup.nsh
bcfg boot add 0 fs0:\EFI\example\my.efi "My EFI Executable"
rm fs0:\startup.nsh
reset
EOF

James

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xen.org/xen-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How to persist domU efi boot order ?

Håkon Alstadheim


Den 21. mars 2017 14:11, skrev James Dingwall:
> On Mon, Mar 20, 2017 at 08:03:37PM +0100, Håkon Alstadheim wrote:
...

>> Either ovmf is not reading NvVars, or else NvVars gets created without
>> my settings. Maybe my "esp" partition is not found until _after_ ovmf
>> searches all drives, also non-existant ones?
>>
...

>> Googling around I found this <https://lists.gt.net/xen/users/420486>, in
>> which
>>
>> "wei.liu2 at citrix" says:
>>  > "As said in other email, we play a trick in our test system to
>>  > make ovmf load grub automatically. "
>>
>> Anybody have a clue what that trick is, and care to share?
>
> IIRC Once you have have the NvVars created then you can make persistent modifications from an EFI shell.  You
> cannot make persistent modifications from the OS unless you write the NvVars file directly because OVMF cannot
> modify the NvVars files once the OS has started.  You can preconfigure the ESP with a bootx64.efi which is grub
> or any other EFI executable or create a startup.nsh which configures the persistent boot options.
>
> e.g.
>
> cat << EOF > startup.nsh
> bcfg boot add 0 fs0:\EFI\example\my.efi "My EFI Executable"
> rm fs0:\startup.nsh
> reset
> EOF
>

Seems using the shell rather than the boot menu to modify boot settings
gets me no further.

The timestamp on NvVars does get updated, but the boot options are gone
once i hit "reset" in the shell.

Tried interactively as well. Installed Shell.efi to
/boot/efi/EFI/Boot/BOOTX64.EFI Here are some excerpts from a session:
------------
Shell> ls fs0:\EFI\debian
01/25/2017  10:28 <DIR>         4,096  .
01/25/2017  10:28 <DIR>         4,096  ..
01/25/2017  23:38             119,808  grubx64.efi
------------
bcfg boot add 0 fs0:\EFI\debian\grubx64.efi "Direkte EFI grub"

------------
Shell> bcfg boot dump
Option: 00. Variable: Boot000A
   Desc    - Direkte EFI grub
   DevPath -
PciRoot(0x0)/Pci(0x1,0x1)/Ata(0x0)/HD(1,GPT,90D5552B-FCC8-41EB-83A9-81A66A8995B6,0x800,0x1DC800)/\EFI\debian\grubx64.efi
   Optional- N
Option: 01. Variable: Boot0000
   Desc    - EFI Floppy
   DevPath - PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0)
   Optional- N
...
--------------
The screen gets a bit messed up, old output not clearing and such, seems
the efi shell is not aware of the size of the console window, but I'm
pretty sure the above is a correct rendition of what happened. After
entering "reset", I'm back at a long wait followed by the first boot
entry being floppy.

_______________________________________________
Xen-users mailing list
[hidden email]
https://lists.xen.org/xen-users
Loading...