(Optional) Declare ADDITIONAL_DTB_OVERLAY_OPT= where can be BootOrderNvme.dtbo.
This allows UEFI to prioritize booting from NVMe SSD. can also be BootOrderUsb.dtbo, which
allows UEFI to prioritize booting from the USB storage drive
I have tried this method, but ADDITIONAL_DTB_OVERLAY_OPT cannot solve this issue. The root cause of the issue is that when UEFI detects a change in the boot device (insertion of a network card), it will force the newly added network card to be inserted at the top of the boot order.
Upon reading UEFI code, it can be observed that the priority of refreshing the boot sequence list for hot-plugged devices is higher than that of BootOrderNvme.dtbo.
“The BootNext variable is a single UINT16 that defines the Boot#### option that is to be tried first on the next boot. After the BootNext boot option is tried the normal BootOrder list is used. To prevent loops, the boot manager deletes this variable before transferring control to the preselected boot option.”
Currently, I can only temporarily configure CONFIG_NETWORKING=n to disable the network function to circumvent this issue, but this solution is not thorough. If I insert a USB mobile hard drive next time, it may also cause the boot sequence to be disrupted. I still believe that we should consider how to solve this problem from the perspective of UEFI software design. Other methods only address the symptoms and not the root cause.
I think if you were to change 0x01 to 0x00 in this file it would cause uefi to add new devices to bottom of list. Then configure and build edk2-nvidia.
#Option to add new boot device at top or bottom of list
gNVIDIATokenSpaceGuid.PcdNewDeviceHierarchy|0x00|UINT8|0x00000068
Config and then build edk2-nvidia:
cd nvidia-uefi
edk2-nvidia/Platform/NVIDIA/Tegra/build.sh --init-defconfig edk2-nvidia/Platform/NVIDIA/Tegra/DefConfigs/t26x_general.defconfig
cp nvidia-uefi/images/uefi_t26x_general_RELEASE.bin Linux_for_Tegra/bootloader/uefi_t26x_general.bin
Then flash Thor to confirm.
Here’s the built as configured uefi_t26x_general_RELEASE.bin and other files from the image directory that you could test if so inclined. You may want to read Linux_for_Tegra/bootloader/uefi_bins/README_uefi.txt which discusses smaller uefi*.bin that decrease boot time in production; which you can build with edk2-nvidia.
Edit nvidia-uefi/edk2/NetworkPkg/NetworkDefines.dsc.inc
change TRUE to FALSE / or from command line flag.
# These flags can be defined before the !include line, or changed on the command
# line to enable or disable related feature support.
# -D FLAG=VALUE
DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE
And edit and change y to n in
nvidia-uefi/nvidia-config/t26x_general/config.dsc.inc:CONFIG_NETWORKING_HTTP=n
To remove UEFI PXEv4, UEFI PXEv6 try following.
Edit nvidia-uefi/edk2/NetworkPkg/NetworkPkg.dec
change 0x01 to 0x00
I’m fairly certain that PcdNewDeviceHierarchy|0x00 would control the option shown in the attached picture and that if you were to thereafter plug a new usb drive into Thor it would go to the bottom.
You can look at your Thor settings in uefi-bios at a subsequent boot of Thor.
#Option to add new boot device at top or bottom of list
gNVIDIATokenSpaceGuid.PcdNewDeviceHierarchy|0x00|UINT8|0x00000068
https://github.com/NVIDIA/edk2-nvidia/blob/main/Silicon/NVIDIA/NVIDIA.dec
nvidia-uefi/edk2-nvidia/Silicon/NVIDIA/NVIDIA.dec