OpenWrt Forum Archive

Topic: repost: can someone please explain what this hacks do ..

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

hi
can someone please explain what the following hacks do

# linksys bug; remove when not using static configuration for lan
NVRAM_lan_proto="static"

remap () {
  for type in lan wifi wan pppoe
  do
    for s in '' s
    do
      eval NVRAM_${type}_ifname$s=\"$(nvram get ${type}_ifname$s|sed s/$1/$2/g)\" 
    done
  done
}

and


# hacks for buffalo wla2-g54l
[  "$(nvram get boardnum)" = "00" \
-a "$(nvram get product_name)" = "Product_name" \
-o "$(nvram get product_name)" = "WLA2-G54L" ] && {
  debug "### wla2-g54l hacks ###"
  NVRAM_wan_ifname="none"
  NVRAM_lan_ifnames="vlan0"
}

I am trying to patch dd-wrt to support Buffalo WBR2-G54S .. it is running OpenWRT , but have strange behaviour running dd-wrt (orginal source reboots indefinetly during boot, the version I ruined boots , but no eth is working , just wl )

especially I would like to know what line

  NVRAM_lan_ifnames="vlan0"

do ?



regards

E

svabo2k wrote:

hi
can someone please explain what the following hacks do

# linksys bug; remove when not using static configuration for lan
NVRAM_lan_proto="static"

remap () {
  for type in lan wifi wan pppoe
  do
    for s in '' s
    do
      eval NVRAM_${type}_ifname$s=\"$(nvram get ${type}_ifname$s|sed s/$1/$2/g)\" 
    done
  done
}

and


# hacks for buffalo wla2-g54l
[  "$(nvram get boardnum)" = "00" \
-a "$(nvram get product_name)" = "Product_name" \
-o "$(nvram get product_name)" = "WLA2-G54L" ] && {
  debug "### wla2-g54l hacks ###"
  NVRAM_wan_ifname="none"
  NVRAM_lan_ifnames="vlan0"
}

I am trying to patch dd-wrt to support Buffalo WBR2-G54S .. it is running OpenWRT , but have strange behaviour running dd-wrt (orginal source reboots indefinetly during boot, the version I ruined boots , but no eth is working , just wl )

especially I would like to know what line

  NVRAM_lan_ifnames="vlan0"

do ?



regards

E

The WLA2 has a buggy nvram variable there (at least in that firmware version I saw), thatswhy we workaround it. Because it's mostly used as a wlan bridge (eg. the wireless is separated), I've vlan0 as the lan ifname. Of course, you have the choice to hear your voice, if more ppl want it to be bridged by default, just let me know.

thanks for your answer
just one more thing
what does
NVRAM_lan_ifnames="vlan0"
do ?
as far as I can see it does not set nvram variable permanently ?

svabo2k wrote:

thanks for your answer
just one more thing
what does
NVRAM_lan_ifnames="vlan0"
do ?
as far as I can see it does not set nvram variable permanently ?

Yes, it workarounds that bug this way.

The discussion might have continued from here.