Where is the UEFI boot order stored?

Solution 1:

Moab was right, the order is stored in the pc in NVRAM.

From the link Moab shared: (https://www.happyassassin.net/2014/01/25/uefi-boot-how-does-that-actually-work-then/)

“The UEFI boot manager is a firmware policy engine that can be configured by modifying architecturally defined global NVRAM variables. The boot manager will attempt to load UEFI drivers and UEFI applications (including UEFI OS boot loaders) in an order defined by the global NVRAM variables.”

And from the linux efibootmgr manual (a utility to manipulate the boot order etc, here: https://linux.die.net/man/8/efibootmgr ):

Note: efibootmgr requires that the kernel support access to EFI non-volatile variables