Hello All,
I want to add a validation rule to a custom variable I'm defining in the u-boot environment. Let's call it foo, and the only values foo should accept are null or ttyLP0,115200.
My u-boot environment is protected, so only specific variables are whitelisted. foo will be whitelisted.
I was able to achieve this for fw_setenv by creating patch for libubootenv under src/fw_printenv.c for the Linux user-space:
root@localhost:~# fw_setenv foo woof
Error: invalid value for "foo": woof
root@localhost:~#
root@localhost:~# fw_setenv foo null
root@localhost:~# fw_printenv | grep foo
foo=null
Now, I'm trying to figure out how to do this for u-boot-imx setenv. I looked into the cmd/nvedit.c function env_set and applied the same logic, but that did not work. Am I in the right place for setenv, or is there different code for setenv?
Any help will be highly appreciated.
Cheers,