OpenWiki

Liberated Libertas User Guide

Page Type: Article
Edit this page (last editedSeptember 24, 2006)
Bookmarks1: Bitsum | Wiki | Frontpage | RecentChanges | TitleIndex | CategoryIndex | UserPreferences | FindPage | HelpPage | SandBox
» Building DD-WRT » Welcome » Liberated Libertas User Guide

  1. Parent Page
  2. Quick Examples
    1. Telnet'ing into router
    2. Upgrading firmware from shell
    3. Erasing the JFFS2 partition
    4. Mounting NFS shares
    5. Executing code at startup
  3. About NVRAM variables
    1. Using the NVRAM utility
    2. Finding the meaning of nvram variables
    3. NVRAM Variables
  4. Installable packages
  5. Events
  6. Technical details
    1. mtd organization
  7. Misc notes
    1. VPN support
    2. Restarting the mvapd process (wireless AP)
    3. Free memory
    4. How many times can I flash my router?
  8. Support and Development
    1. IRC

Parent Page

[Primary WL-530g/LLF Page]

Quick Examples

Telnet'ing into router

Simply telnet into the router and use 'root' as a username, with the password being whatever your HTTP password is for the router's management console.

Upgrading firmware from shell

 cd /tmp
 wget http://www.bitsum.com/files/wl530g/WL530G_db90h_en_latest.bin
 mtd -r write WL530G_db90h_en_latest.bin /dev/mtd0

Erasing the JFFS2 partition

Sometimes its necessary to erase the JFFS2 partition. In fact, in alpha builds prior to 09/16/06 you had to manually do this every time you upgraded the firmware (because the change in location of the jffs2 partition would cause corruption).

 mtd -r erase /dev/mtd2

The above command will erase your JFFS2 partition and reboot your router.

Mounting NFS shares

Example of mounting 192.168.1.110:/home/db90h/downloads:

 mkdir /tmp/sharefolder
 mount 192.168.1.110:/home/db90h/downloads /tmp/sharefolder -o nolock

Executing code at startup

The following startup files are executed at system startup:

 /jffs/etc/init.d/rcS
 /jffs/etc/init.d/S*

Adding a new shell script matching one of those file specs will cause it to be executed at boot.

About NVRAM variables

NVRAM variables are used to configure most of the router's functionality. These are in a simple tuple based variable=value type format, i.e.

somevariable=somevalue somevariable2=somevalue2

Using the NVRAM utility

To list variables set on the system, use:

 nvram show

Note: Not all possible variables are listed. Some are unset by default, but can be set to change the behavior of the system. I'll document these eventually, or someone else can do it for me.

You can pipe it through 'grep' to find variables. For instance to list all variables named 'wl_*' (the wireless configuration):

 nvram show | grep wl

To set a variable use:

 nvram set somevariable=somevalue

To get a variable value use:

 nvram get somevariable

To unset a variable (remove it) use:

 nvram unset variable

To save the entire nvram to a file use:

 nvram save /tmp/mysettings.nvram

To restore the entire nvram to a file use:

 nvram restore /tmp/mysettings.nvram

Finding the meaning of nvram variables

Google can help you with most of them, as other embedded devices use nvram variables by the same (or similar) names. Other times the meaning can be inferred from the name of the variable. Lastly, experimentation will help you figure them out.

NVRAM Variables

There are too many to list quickly.. I'll add to this list as I get time.

In addition to those already used by the system by default, the following nvram variables are added by Liberated Libertas. Most are unset by default so won't show up in an 'nvram show' command. Not all may actually cause any effect to the system, we're still experimenting with them.

VARIABLE DEFAULT VALUE VALUES DESC
max_conntrack 1008 512-4096 Max number of connections router can track.
syslogd_size_kb 16 4-? Size of system log in kilobytes.
syslogd_mark_min 0 0-? Minutes between time marks in log.
wl_mode ap sta=station mode , ap=access point  
wl_mode_ex ap sta=station mode , ap=access point yes, these are redundant. One will be axed in the end.
wl_iwmode 3 1 - adhoc , 2 - client , 3 - AP , 4 - Network  
wl_short_retry_limit 7  
wl_long_retry_limit 4  
wl_current_tx_power_level 1 1-8 no txpwr support?
wl_short_preamble 1  
wl_minimal_eap 1  
wl_interface wlan0  
wl_logger_syslog -1  
wl_logger_syslog_level 1  
wl_logger_stdout -1  
wl_logger_stdout_level 4  
wl_debug 0  
wl_dump_file /tmp/hostapd.dump  
wl_daemonize 1  
wl_auto_link 0  toggles Turbo Setup feature (auto-configure)
wl_ssid_patch 0  
wl_speed_boster 0  
wl0_* * * Ignore these! They are set based on their wl_* counterparts so that the web UI can be used for both Broadcom and Marvell based devices without extensive changes.

Installable packages

You can install your own software by putting it on your router's writable storage (currently at /jffs). Here are some archives you can download and extract onto your router:

Download Name Description
http://www.bitsum.com/files/wl530g/cpu.tar.gz CPU Shows cpu usage.
http://www.bitsum.com/files/wl530g/ftp.tar.gz FTP Full-fledged ftp client.

To install, (builds 09/21/06 and later only):

install.sh [PACKAGEURL]

In example, to install the ftp package:

 install.sh http://www.bitsum.com/files/wl530g/ftp.tar.gz

Events

When certain events happen scripts are invoked. These scripts are named on_* and found in /etc/ and /jffs/etc. Here is a listing of currently defined events:

 on_ppp_up.sh
 on_ppp_down.sh
 on_wan_up_begin.sh
 on_wan_up_end.sh
 on_wan_down_begin.sh
 on_wan_down_end.sh

Technical details

mtd organization

MTD devices are mapped areas of the flash. They are documented below. Note that the size and filesystem types are subject to change.

Device Description
/dev/mtd0 entire flash except for boot loader.
/dev/mtd1 rootfs - currently cramfs
/dev/mtd2 RW persistant storage - jffs2
/dev/mtd3 nvram
/dev/mtd4 manufacturer data

Misc notes

VPN support

It is reported that VPN requires 'rmmod' of all pptp and gre releated kernel modules (use lsmod to list them). I can't myself make any warranties about this as I've not tried it out, and don't know why these kernel modules would need to be unloaded.

Restarting the mvapd process (wireless AP)

The mvapd application is the user mode component that controls the wireless access point. It's configuration is stored in /tmp/hostapd.conf, which is created from nvram variables at startup. So, you want to change variables in /tmp/hostapd.conf and restart mvapd?

You can not terminate the mvapd process, as it will cause a reboot of your router. However, there is a signal (-1) that will tell it to reinitialize.

killall -1 mvapd

Free memory

Free memory may not seem to be accurately reported by 'free' or /proc/meminfo.

How many times can I flash my router?

The LOW END of the range would be 10,000-100,000 times. Keep in mind that the device normally over-writes its nvram area with every configuration change, meaning this one area is erased much more than any other. Therefore, erasing less commonly flashed areas like those that hold the kernel and filesystem image are hardly a concern in comparison.

I should also note that the LLF firmware's nvram area is in a different location than is the original nvram area, so switching to LLF can give your router extended life if the old NVRAM was heavily abused. Milestone 2 will store the NVRAM inside the JFFS2 filesystem, taking advantage of wear-leveling.

The bottom line is that your router have far outlived its usefulness before your flash ROM dies even if you flash a new firmware every day.

Support and Development

IRC

Join #wl530g on freenode. [irc://irc.freenode.net?wl530g]

Summary : Liberated Libertas User Guide
Bookmarks1: Bitsum | Wiki | Frontpage | RecentChanges | TitleIndex | CategoryIndex | UserPreferences | FindPage | HelpPage | SandBox
Edit this page | Rename this page | View other revisions | Attachments (0) | Print this page | View XML | Page views: 49454
Find page by browsing, searching or an index | Page Revisions: 38
Last Edited September 24, 2006 by Jcollake | (diff)

Valid XHTML 1.0!Valid CSS!