How to set UEFI variable?

Hi Nvidia,

I’m trying to set some UEFI variables depending on the type of Jetson board I use.
I found a list of available variables here: VariableList · NVIDIA/edk2-nvidia Wiki · GitHub
But it lacks the description how to exactly do it.
As a simple test, I booted the Jetson Orin Nano 8GB into the UEFI shell and tried to set an UEFI variable.
However, the shell replies:

Shell> setvar KernelCommandLine =L"loglevel=5"
setvar: Unable to set - 8BE4DF61-93CA-11D2-AA0D-00E098032B8C - KernelCommandLine

I tried many different combinations of attributes (-nv / -bs ) and without any attribute. It always fails.
Also, I tried other variable names, I tried overwriting already existing variables, it never works.

Is there something that has to be done to enable setting UEFI variables, or is this feature generally broken?

Hi business37,

What is your use case to set these variables?
Could you local build uefi binary successfully?

The variables in that list could be configured in edk2-nvidia/Platform/NVIDIA/NVIDIA.common.dsc.inc at main · NVIDIA/edk2-nvidia · GitHub.