PDA

Bekijk de volledige versie : nvram, nvram_x



pipos
05-04-2004, 22:03
Hi,

Here is my problem:

I configure WL-500g for with my setting (start dropbear after boot, some iptables mods...etc)

then i save my config via web interface.

When I try to restore config after reseting wl-500g, bootCmd, and dss entry wasn't in my nvram (nvram show|more)
When i config file, dss and bootCmd entries was there.

i try to config manualy again, and save with nvram_x fget,
and restore with nvram_x fset....The same result

But when i create entry something like 9_x_bootCmd, and save config with web, or nvram_x, resotration work fine.(but bootCmd doesn't work of course)

Am I doing something wrong, or this is bug???
Could someone take a look at this.

I use FW 1.6.5.3-5

Thanks a lot

Oleg
06-04-2004, 09:28
Why you're trying to use nvram_x instead of nvram? Yes, there is a real difference between them in way how they treat variable names, so 9_x_bootCmd will never work, because rc.nvram does not expect this.

pipos
06-04-2004, 12:58
I need to make complete backup of my settings from nvram.
And when I restore it, all settings are restored except bootCmd and dss entries.

I don't know why at this time.

monnier
29-08-2004, 19:54
I though the nvram binary was accessing /dev/mtd/4, basically like flashfs, but it turns out that it uses /dev/nvram. Looking at the nvram_linux.c code on both user and kernel side, I do not quite understand what's going on.
E.g. it seems the nvram size is 32KB, but the nvram partition is 64KB.
Where did the factor of 2 go?

Does anybody know if the nvram is used by something else than /usr/lib/libnvram.so? I'm thinking of merging the flashfs and nvram partitions into a 128KB jffs2 partition and reimplement libnvram.so to store its data in a plain old filesystem.

Oleg
29-08-2004, 20:00
64k is just the page size of some flashes. You cant remove nvram completely - pmon uses it to boot linux.

Exirion
08-10-2004, 11:50
I'm currently implementing a system based on the WL500g platform and I'd like to store some data, preferably surviving power-offs. So NVRAM is the thing to use, and it works. However, I know that NVRAM can be flash-like memory that has a limited lifetime, related to the number of writes. Does anybody know what kind of memory is used as NVRAM in the WL500g?

I'm thinking of using files in /tmp and only use NVRAM as a backup to store data less frequently. But maybe this is not necessary? :)

WlanMan
08-10-2004, 13:51
Hi

Since NVRAM resists inside the Flash Memory it has some 1000 write cycles. This is enough for normal configuration files which are not changes more than every some days, you can calculate it for yourself how long it will survive :).
Modern ones like in the 500g have a guranteed 10000 cycles lifetime, mostly much more since thy gurantee it over the complete temperature range which is normaly not used in home envoirements (+85°C).

Greets

Exirion
08-10-2004, 14:38
Thanks alot :)

WlanMan
08-10-2004, 17:49
Hehe, what are you developing ?
I´m just curious :rolleyes:

Exirion
08-10-2004, 18:53
Unfortunately I cannot tell you. Company secret ;)

brubber
09-10-2004, 06:14
Unfortunately I cannot tell you. Company secret ;)
Thought a forum like this was meant to help each other and share information and knowledge.

Exirion
09-10-2004, 09:21
Thought a forum like this was meant to help each other and share information and knowledge.
What I'm doing with the WL500g is completely irrelevant for other people. I asked something about NVRAM, got a reply, and that might be valuable info for other people as well. That's what counts.

Styno
09-10-2004, 14:47
What I'm doing with the WL500g is completely irrelevant for other people. I asked something about NVRAM, got a reply, and that might be valuable info for other people as well. That's what counts.
Strictly speaking: you can't be the judge of that ;)

brubber
09-10-2004, 22:47
:D Getting back on topic. :D

:confused: Just wondering, what is the ASUS definition of NVRAM?

AFAIK NVRAM is battery backed up SRAM or in a less strict definition also a CMOS or an EEPROM

Styno
09-10-2004, 23:11
NVRAM stands for Non Volatile Random Access Memory. So it can be a lot of different types of memory as long as its non-volatile and random access. This includes battery backed SRAM and harddisks as well.

The NVRAM in the Asus WL-500g is a seperate section of the flash space available. 32k is used and the page size is 64k.

Info: http://wl500g.info/showthread.php?t=809

poz.
18-11-2004, 17:30
I have a lama question to ask. I got a Asus 500g and I would like to do following changes 16_x_FIsFtpServer=0, wan_ifname=ppp0. I have used nvram set wan_ifname=ppp0; nvram commit. However, I still get old values after reboot. Can anyone tell me where I make a mistake? Is it hard coded somewhere without a change to change it?

Best regards
Jamie Poz.

hugo
26-02-2005, 17:40
Hi,

I would like to know if every setting I can set up on Oleg's firmware is set in nvram value, and if so, is it possible to do a manual backup and restore.

I would like to go back from a mixed state configuration set and also to do a kind of configuration switch?

Oleg
26-02-2005, 18:18
Everything accessible via web interface is stored in the nvram.

hugo
26-02-2005, 18:23
but how can you make a backup restore in one operation? Do I have to script the nvram command, or can I use a /dev/mtd in some way?

hugo
27-02-2005, 15:47
after searching, there is some info about nvram_x, but this utility looked buggy and does'nt exist anymore. Do I have to script all value to save and restore nvram, or is there a new command to do so?

Oleg
27-02-2005, 17:37
Just use built-in save/restore configuration function. I think this should be enough for you.

hugo
27-02-2005, 18:10
yes, but it doesn't work on Wl-Hdd. I get a WLHDD.cfg file with 0k size.

On wl500 version (when I was testing it before your actual version for wl hdd), it was working.

Also, this method ask for a browser. I would need a telnet way, as I will be using non standard browsers.

Oleg
27-02-2005, 18:21
Well, you can play dangerous game with nvram then:


cat /dev/mtd/3 > /tmp/nvram.bin

should backup whole nvram


flash /tmp/nvram.bin /dev/mtd/3
reboot

should bring it back.

barsju
16-03-2005, 08:21
Is there a command I can use to remove entries from nvram?

I have UPnP entries that have been storded to nvram that I would like to remove. I find them with this command:

nvram show | grep forward_port

I could of course reset to factory default, but I'd rather not...

S.

RoofCat
16-03-2005, 13:05
Is there a command I can use to remove entries from nvram?

I have UPnP entries that have been storded to nvram that I would like to remove. I find them with this command:

nvram show | grep forward_port

I could of course reset to factory default, but I'd rather not...

S.


nvram unset var_name or smthg similar should work, I believe.

HTH
Roofcat

Antiloop
16-03-2005, 13:49
nvram unset var_name or smthg similar should work, I believe.

HTH
Roofcat
indeed that will work

also


nvram set var_name should work to erase the entry

after doing this do a commit

nvram commit

barsju
16-03-2005, 13:55
Thx! That works, and now I'm working on a script like this:


#!/bin/sh
i=$1
while [ $i -le $2 ]
do
nvram unset port_forward$i
i=$i + 1
done


but I keep getting

./clearUPnP: 8: +: not found

What gives??

S.