OpenWrt Forum Archive

Topic: nvram package for 2.6 kernel?

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

I am trying to build a 2.6 kernel based image (mainly because of the ip_conntrack_sip support). I noticed that the nvram package depends on BR2_LINUX_2_4_BRCM. Is there some other package I need to be using to get nvram support on 2.6 ?

I didn't see any open tickets about this.


Another possibility is to see if ip_conntrack_sip can be ported to 2.4.

Just a thought.  You might have better luck backporting what you need to 2.4 (or finding someone who has).  Going from 2.4 to 2.6 for an entire platform is no small task.  There's a lot of new packages that you would need instead of what's in openwrt.  Not to mention the fact that, in general, 2.6 kernel images are MUCH larger than 2.4 ones.

I'm not sure what that particular module that you're looking to 2.6 for does, but if it's related to iptables, I'd imaging it could be ported to 2.4 since netfilter was in 2.4 as well.

--Jason

The platforms running the 2.6 kernels aren't using nvram .. there's a /etc/config directory instead

mbm wrote:

The platforms running the 2.6 kernels aren't using nvram .. there's a /etc/config directory instead

ahh this I did not know. I'll need to load a 2.6 again to see how that works.

Can I set things like boot_wait within that directory? (I'm running WRT54GL)

Thanks!

I suppose for CFE purposes there will still be *some* NVRAM entries (to identify boardrev and friends for example).
Only for the operation of the OS itself, newer releases will no longer rely on NVRAM... which means that boot_wait will still be there (in NVRAM).
Correct me if I'm wrong.
BTW, it would be nice to know why this decision has been made: because NVRAM space is (too) limited (to 32K)? to spread flash wear?

Getting rid of nvram was decided when it came to extend openwrt to other devices and platforms that do not rely on the use of a nvram such as x86, au1000, ar7 ...

florian_ wrote:

Getting rid of nvram was decided when it came to extend openwrt to other devices and platforms that do not rely on the use of a nvram such as x86, au1000, ar7 ...

Even I am using ASUS WL500GD, I think getting rid of nvram and using a config file is a very good idea. But why do we still have the flash mapping like this?

0x00000000-0x00040000 : "cfe"
0x00040000-0x003f0000 : "linux"
0x000f0000-0x003f0000 : "rootfs"
0x003f0000-0x00400000 : "nvram"

Wouldn't it better to use the space of "nvram" for "rootfs"?

You can't use the nvram space to extend your root filesystem because the bootloader depends on some of the nvram variables.

I understand the reasons beyond removing nvram support. However, I think there should be an nvram tool available for the latest OpenWrt's as well.

For example:
I'm running on wrt54g with WAN port and 4 LAN ports, and I want to remap the vlans. Normally this is done by the bootloader using the nvram variables, right? Ok, even without nvram I could use robocfg or such to remap them at boot time. But then the 4 lan ports would be bridged for a few seconds when the router boots. I imagine that could cause trouble, such as 2 dhcp servers in same lan, or maybe OSPF hellos leaking out to wrong network...?

Is there/will there be an nvram tool, as a seperate package?

Hey,

if you just want to read nvram you can try the following:

# alias nvram_show="cat /dev/mtd/3 | egrep -i "[[:alnum:]]+=" | sort"
or
# nvram_show() { cat /dev/mtd/3 | egrep -i "[[:alnum:]]+=" | sort ; } ;
keitsi wrote:

I'm running on wrt54g with WAN port and 4 LAN ports, and I want to remap the vlans. Normally this is done by the bootloader using the nvram variables, right?

You can now change the vlan assignments using /etc/config/network.

mbm wrote:

You can now change the vlan assignments using /etc/config/network.

But these settings will only be used by the switch driver and the settings in nvram will be used until the switch driver is loaded. So I guess there's still a demand vor a nvram package.

maybe it is useful to have the nvram package available for the case where someone flashes 2.6 and wants to put boot wait on ?
(easy enough to manually edit .config and add it though I suppose)

Ok, there is no nvram anymore, but how can I enable 32MB of RAM in my ASUS WL-500gP??

BusyBox v1.4.1 (2007-02-04 21:27:39 CET) Built-in shell (ash)
Enter 'help' for a list of built-in commands.

  _______                     ________        __
|       |.-----.-----.-----.|  |  |  |.----.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
KAMIKAZE (bleeding edge, r6263) -------------------
  * 10 oz Vodka       Shake well with ice and strain
  * 10 oz Triple sec  mixture into 10 shot glasses.
  * 10 oz lime juice  Salute!
---------------------------------------------------
root@OpenWrt:~# free
              total         used         free       shared      buffers
  Mem:        13752        10092         3660            0          216
Swap:            0            0            0
Total:        13752        10092         3660
root@OpenWrt:~#


EDIT: ofcourse I can flash ex. WR RC6 then edit proper nvrams and back to kamikaze but it isn't comfortable solution...

(Last edited by Marek on 6 Feb 2007, 09:07)

Let's just make the nvram package available for installation via ipkg?

The discussion might have continued from here.