I need to add new variables to nvram in ‘Digi connect ME 9210’. I can add it but was unable to find a way to read it back once the kernel is loaded.
I believe that nvram utility is not built as part of the kernel. Also in general if we add new parameters to the nvram through the uboot bootloaded then is there any other way other than nvram utility as to how i can read them back once the kernel is loaded.
If nvram utility is the only way then where do I find the code for nvram utility. The current utility allows me to read only the predefined nvram variables so i will have to modify the nvram utility to read the new variables that i add?
To read nvram from command line, check the examples in /etc/init.d/S40networking.sh /etc/init.d/S95runapp.sh /etc/network/if-up.d/ifup
If you want to read the from C source code, the API is documented only in source code:
DEL59-DVD/toolchain/del_toolchain/packages/ubootenv/
it uses
DEL59-DVD/toolchain/del_toolchain/nvram/
and
DEL59-DVD/toolchain/del_toolchain/libdigi/
How to compile the source code on your own (for modifications):
cd …/nvram; cp SOMEFOLDER/nvram-Makefile Makefile; make
cd …/ubootenv
cp SOMEFOLDER/ubootenv-Makefile.in Makefile.in
cp SOMEFOLDER/cgi_env.c src
where SOMEFOLDER is where you extraced this application example source code
make
copy target/ubootenv.cgi into your rootfs /usr/share/www/cgi-bin
copy stylesheet.csss into your rootfs /usr/share/www
Make NVRAM /dev/mdt1 read+writable for CGI script (see above)
You might want to modify the source code src/cgi_env.c
See src/.[ch] and …/nvram/src/.[ch] for example source code