OpenWrt Forum Archive

Topic: NVRAM <--> configuration files

The content of this topic has been archived on 7 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

In http://wiki.openwrt.org/oldwiki/openwrt … figuration is says:

"As OpenWRT expanded to new platforms without NVRAM, NVRAM was abandoned in favour of configuration files in /etc/config."

Where are these configuration files stored, if not in NVRAM.  (The Linksys  WRT54GL does not have a hard drive, as far as I can tell.)

Thanks & Best Regards,

Vwaju
New York City

Vwaju wrote:

In http://wiki.openwrt.org/oldwiki/openwrt … figuration is says:

"As OpenWRT expanded to new platforms without NVRAM, NVRAM was abandoned in favour of configuration files in /etc/config."

Where are these configuration files stored, if not in NVRAM.  (The Linksys  WRT54GL does not have a hard drive, as far as I can tell.)

You already pointed out above that the configuration files are stored in /etc/config directory.

Thank you for responding, mazilo.

What I meant was:  What *hardware* is used for storage of the file system?

Vwaju
New York City

Vwaju wrote:

What I meant was:  What *hardware* is used for storage of the file system?

I may be wrong; however, I believe this is hardware dependent. If you do a df when logged into your system, it should tell you where the /etc directory is. On my Netgear WGT634U, the df spits out the following partitions information:

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/root                 1792      1792         0 100% /rom
tmpfs                    14560        72     14488   0% /tmp
tmpfs                      512         0       512   0% /dev
/dev/mtdblock3            4608       404      4204   9% /jffs
mini_fo:/jffs             1792      1792         0 100% /
/dev/sda1               116648     15896     94730  14% /mnt/sda1

According to the above information, the /etc directory resides on /dev/mtdblock3 partition. A copy of READ ONLY file system, including /etc directory can be found on /rom directory.

It's normally stored in the JFFS2 partition.

Vwaju wrote:

Thank you for responding, mazilo.

What I meant was:  What *hardware* is used for storage of the file system?

Vwaju
New York City

OpenWRT uses a read-only squashfs filesystem for the rootfs and then uses a program called mini_fo to overlay a read/write JFFS2 partition to store changes and modifications.

A standard embedded linux setup might have a partition called "nvram." OpenWRT has "rootfs" and "rootfs_data" the first being squashfs and the latter being JFFS2.


System configuration is done via a utility called UCI. NVRAM for instance has one "config" file that is setup:

key=value
key=value
key=value

and this is written to a partition.

UCI's config files are stored in /etc/config/ and have a different syntax. If any modifications are made to these files, or any file on the filesystem for that matter, the "dirty" copy is stored on JFFS2 partition.



I hope this explanation makes sense. It's a quite different approach than the standard nvram setup. Though the standard nvram setup is outdated and not very flexible.





Edit: I re-read your question. Everything is just stored on the flash chip, on different partitions. Typcially a router with an "nvram" setup just had a partition on the flash chip called "nvram" ... not some special piece of hardware made specifically for storing settings.

(Last edited by aport on 3 Nov 2009, 22:29)

Thanks, aport.  That's helpful.

Vwaju

The discussion might have continued from here.