在烧写系统前,如何把httpv6,httpv4,pxev6,pxev4在uefi菜单中禁掉

我们插入usb网卡(可插拔的usb网卡)后,httpv6,httpv4,pexv6,pexev4就会自动调到最高优先级启动系统,如何在烧录时候就禁止该4个选项,使其即使插入usb网口,也能默认从nvme硬盘启动?

由于usb网口是可随意插拔的,即使通过uefi菜单调整顺序后,拔掉usb网卡,然后再插入usb网卡,httpv6,httpv4,pxev6,pxev4,又会默认调到最高级别

overriding the default boot order during flashing . There are some other methods on that document.

Overriding the Default Boot Order During Flashing

Note

This method only sets the default boot order on the first boot after flashing. If additional storage devices are added in subsequent boots, those storage devices will be appended to the top or the bottom boot order based on UEFI Boot Order setting in the UEFI menu regardless of the storage device type.

In addition to customizing the default boot order, you can also override the default boot order by providing a DTBO through ADDITIONAL_DTB_OVERLAY environment variable. For example, you can set the NVMe as default boot device for Jetson AGX Orin:

sudo ADDITIONAL_DTB_OVERLAY="BootOrderNvme.dtbo" ./flash.sh jetson-agx-orin-devkit nvme0n1p1

To set another storage device as the default boot device, set the following DTBO to the ADDITIONAL_DTB_OVERLAY environment variable:

  • eMMC device: BootOrderEmmc.dtbo

  • USB device: BootOrderUsb.dtbo

  • UFS device: BootOrderUfs.dtbo

  • SATA device: BootOrderSata.dtbo

  • PXE boot: BootOrderPxe.dtbo

I have tried the method mentioned above. With the USB network card plugged in all the time, the flashing process can set the default boot from NVMe. However, since the USB network card can be plugged in or out freely, after unplugging and re-plugging it, the USB network card boot option will be moved to the top of the UEFI menu again. Therefore, is there a way to disable the recognition of the USB network card in UEFI while enabling it in the system? Or is it possible to directly disable network boot in UEFI?

image

Additionally, an attempt was also made to modify kernel/dtb/L4TConfiguration.dtbo, but it still did not work.

This may work; unless it’s what you already did.

/* BootOrderNoNet.dts — set DefaultBootPriority = "nvme,usb,ufs" and lock it */
 /dts-v1/;
 /plugin/;

 / {
   fragment@0 {
     target-path = "/";

     board_config {
       sw-modules = "uefi";
     };

     __overlay__ {
       firmware {
         uefi {
           variables {
             gNVIDIATokenSpaceGuid {
               DefaultBootPriority {
                 data = "nvme,usb,ufs";
                 locked;
               };
             };
           };
         };
       };
     };
   };
 };

dtc -I dts -O dtb -o BootOrderNoNet.dtbo BootOrderNoNet.dts

cp BootOrderNoNet.dtbo Linux_for_Tegra/kernel/dtb/

cd Linux_for_Tegra

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNoNet.dtbo" ./flash.sh jetson-agx-thor-devkit internal

or should it be something like

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNoNet.dtbo" \
  ./l4t_initrd_flash.sh \
  --external-device nvme0n1p1 \
  -c tools/kernel_flash/flash_l4t_t264_nvme.xml \
  -p "-c bootloader/generic/cfg/flash_t264_qspi.xml" \
  --showlogs \
  jetson-agx-thor-devkit external

it still did not work!

xyz-eai@xyz-eai-ThinkStation-K:/mnt/other/hyj/nvidia/Linux_for_Tegra$ cat BootOrderNoNet.dts
/dts-v1/;

/ {
overlay-name = “L4T Configuration Settings”;

    fragment@0 {
            target-path = "/";

            board_config {
                    sw-modules = "uefi";
            };

            __overlay__ {

                    firmware {

                            uefi {

                                    variables {

                                            gNVIDIAPublicVariableGuid {

                                                    QuickBootEnabled {
                                                            data = [00];
                                                            non-volatile;
                                                    };

                                                    NewDeviceHierarchy {
                                                            data = [01];
                                                            runtime;
                                                            non-volatile;
                                                    };

                                                    RootfsRetryCountMax {
                                                            data = <0x3000000>;
                                                            runtime;
                                                            locked;
                                                    };

                                                    RootfsRedundancyLevel {
                                                            data = <0x00>;
                                                            runtime;
                                                            locked;
                                                    };

                                                    AutoUpdateBrBct {
                                                            data = <0x1000000>;
                                                            non-volatile;
                                                    };

                                                    L4TDefaultBootMode {
                                                            data = <0x1000000>;
                                                            runtime;
                                                            non-volatile;
                                                    };

                                                    ExposeRtRtcService {
                                                            data = [00];
                                                            runtime;
                                                            non-volatile;
                                                    };
                                            };

                                            gNVIDIATokenSpaceGuid {

                                                    DefaultBootPriority {
                                                            data = "nvme,ufs";
                                                            locked;
                                                    };
                                            };
                                    };
                            };
                    };
            };
    };

};

image

flash command:

image

I have not tried this. But uefi shell documents show that you could delete the network boot entries.

Boot Manager / UEFI Shell

List boot entries and take a photo of it in case you need to add them back

bcfg boot dump

Remove them (replace ?? with the number):

bcfg boot rm ??


Or at any time after flash:

sudo efibootmgr

Note the number {?} and -B remove it.

sudo efibootmgr -b 000? -B

It did not work!We are a pluggable USB network card. After these environment variables are deleted, if you power off the device, then power it on, and unplug and re-plug the USB network card, the environment variables will be placed at the top again.

You may need to build your own uefi with GitHub - NVIDIA/edk2-nvidia: NVIDIA EDK2 platform support . It is not funny that prepending ADDITIONAL_DTB_OVERLAY=“BootOrderNvme.dtbo” failed.

I think everything may have failed because L4TConfiguration.dtbo has the locked attribute set. for example
gNVIDIATokenSpaceGuid {
DefaultBootPriority {
locked;

The wiki build documents or at least the example refers to t23x, so change that to t26x. I’ve never built that and am curious so will try it via the docker method later.

Thank you for your reply! I have successfully compiled the UEFI using the reference document (via the non-Docker method), but how can I replace the files in Linux_for_tegra?

The operation process basically refers to the following link.The configuration of t26x was used.

Compilation Reference Link: https://github.com/NVIDIA/edk2-nvidia/wiki/Build-without-docker

I noticed that there are two files in the bootloader directory under Linux_for_Tegra: uefi_t26x_embedded.bin and uefi_t26x_general.bin

should be at ~/nvidia-uefi/images/uefi_t26x_general_RELEASE.bin

I just shut down my x86 workstation and thor. but it goes somewhere under Linux_for_Tegra

I tried 22.04 and 24.04 docker images and that failed. I’ll try not docker tomorrow.

this the branch I checked out that is supposed to contain updates post 38.2.0

git clone https://github.com/NVIDIA/edk2-nvidia.git

git switch -c r38.2-updates --track origin/r38.2-updates

The issue has been resolved by modifying ./edk2/NetworkPkg/NetworkPkg.dec in the UEFI source code.

The effect is as follows:

1 Like

Replacement Method:

Nvidia should add your solution to its DeveloperGuide. Thanks for posting it.

Hi 1516775545,

uefi_t26x_embedded.bin is similar as the miniUEFI we called in Jetpack 6. It will disable few functions in UEFI and keep all necessary drivers for booting.

It is the expected behavior as the system detect the new boot device.
After you plug the USB network card, it will add the new boot device to the Top of the boot order.
Thank you for sharing the method to remove them from boot device list.
Alternatively, you can also refer to Rin Nano 8GB Developer Kit - Realtek PHY MAC Address Change Causes Boot Issue - #8 by KevinFFF for the similar use case.

Thank you for your reply. We will use it this way for the project for the time being (there is no requirement to boot the system from the network), and we will try the method you provided when we have time