Honestly, seeing files being written all over the place, I did not have a good feeling about this.
/etc/original_backup (iirc, written only at inital setup?)
/usr/data/bwmon (bunch of files in there, written once a day?)
/usr/data/quotas (seems to be one file per quota rule, written once a day?)
There's also a reference to "/usr/data/webmon.txt" in "/etc/config/webmon_gargoyle", which I haven't looked into yet..
I know this was discussed prior in the following thread:
Quotas and shutdown
But I still feel a bit worried..
The best information I could find about this topic was at:
http://en.wikipedia.org/wiki/Flash_memory#Memory_wear
But the referenced source is titled: "NAND Flash Solid State Storage for the Enterprise, An In-depth Look at Reliability"Most commercially available flash products are guaranteed to withstand around 100,000 write-erase-cycles, before the wear begins to deteriorate the integrity of the storage.
I'm not sure if flash memory in home-routers would really match those aimed at the Enterprise. Something tells me, unlikely..
And are the (limited) flash chips in routers as sturdy/tough as those sold in "USB sticks"?The guaranteed cycle count may apply only to block zero (as is the case with TSOP NAND parts), or to all blocks (as in NOR).
Moreover, from:
http://en.wikipedia.org/wiki/Wear_levelling
moreover:EEPROM and flash memory media have individually erasable segments, each of which can be put through a limited number of erase cycles before becoming unreliable. This is usually around 1000 cycles[citation needed] but many flash devices have one block with a specially extended life of 100,000+ cycles that can be used by wear levelling controllers.
1000 (read, one thousand), does not sound like a lot at all.. If the 100,000+ cycles is limited to only one block, then it would explain why many router manufacturers limit the config area to only a 64 or 128kb block of the flash chip.In flash memory, one block is usually longer lifed than the others so that the wear levelling controller can store operational data with less chance of its corruption.
Think of how many times you update/flash different firmware version to the entire chip, how many times you change/commit changes, how often you install/update packages to (the root overlay) jffs partition, etc.. Saving to multiple files once a day is only sure to speed up wearing out the flash chip quite rapidly. I don't think flash memory in home/small-office routers were designed to withstand such.
I looked up the datasheet for the flash chip in my router, a Samsung K8D3216UBC-PI07
It says:
And that is the only reference to "erase cycles" or "endurance". It doesn't explicitly state whether that is guaranteed for the entire writeable area, or for a specific block..Endurance : 100,000 Program/Erase Cycles Minimum
As I'm still learning and experimenting with different firmwares (some custom-built), so I could appreciate a little more reassurance.

Anyhow, it would be really nice if there was an option in config to allow the end-user to choose whether they want the statistical data saved to tmpfs or to jffs.
Moreover, an option to run the monitor(s)/daemon(s) in sensor-mode, sending data to a remote SQL server (like BandwidthD) would also be fantastic.
Now, on to the technicalities:
1. Checked out gargoyle's (and kamikaze) sources from svn, as described in there documentation here.
2. Ran `make custom`, which in turn took me to the standard OpenWRT `make menuconfig` step.
Briefly, the main things I chose:
Code: Select all
Target System (TI AR7 [2.6])
Target Profile (Texas Instruments WiFi); adds kmod-acx-mac80211
Base system:
br2684ctl (for pppoe, just in case i ever need it)
busybox
Configuration
Networking Utilities
[ ] udhcp Client (udhcpc) <- removed it, since the WAN is PPP
[ ] httpd <- removed it, since gargoyle has its own ;)
Network
hostapd-mini
ppp
ppp-mod-pppoa (for PPPoA)
Kernel modules
Network Devices
kmod-sangam-atm-annex-a (for DSL over POTS, I'm not in Germany, so dont need annex-b - DSL over ISDN)
particularly, this line:
Code: Select all
IPKG_INSTROOT=$(TARGET_DIR) sh $(TARGET_DIR)/etc/rc.common $(TARGET_DIR)/etc/init.d/httpd disable

Luckily I was able to figure it all out quickly, commented out that line in "custom-src/include/image.mk" as well as in "custom-sdk/include/image.mk" just in case, resumed where it stopped, by evaluating the variables passed to make from full-build-809.sh to mimic the exact procedure, and a copy of the script slightly modified to pickup exactly where it left, and all went well.
N.B.: just in case these files get rewritten on next build, I modified:
"targets-8.09/custom/patches/06-image_mk.patch"
and commented out the culprit, so I don't run into this again
Perhaps we should have a condition there, to check if the file exists, before attempting to invoke it?
I mean, it's an httpd, not adding it to the image (since Gargoyle has its own ssl-capable httpd) means more space for other adding things, as well as less RAM (tmpfs) usage, no?

Caveats:
1. acx support is still broken for the wifi chip in this router (a TNETW1350A), so acx driver doesn't pick it up, and attempting to `rmmod acx` causes a segfault... Would be interesting to try openwrt trunk rather than 8.09.2 (stable) to see if this has changed any.
So for now, no chances for me to add wireless support for wireless on this platform, since it is broken in kamikaze (and probably will stay so for a while due to slow pace of development over at acx100 project). There's support for the wireless chip in RouterTech firmware, but that's based on Acorp's proprietary TI firmware which was GPL'ed at least four years back, so driver support is limited to 2.4.17 MontaVista Linux kernel, so don't know if it would be easy to port it even to a standard 2.4.x kernel in OpenWRT and lock it at that till we get decent wireless support in 2.6.x, as the case with brcm-2.4

2. I understand that gargoyle has not yet supported any DSL-equipped routers, but I would like to add at least some preliminary support so I can test other stuff, like QoS etc.
I'm a bit tired now, and have to get back to real-life later today for work, etc.. So if someone could save me the effort of having to find out for myself, and answer some basic questions for me (or provide any pointers), I'd be extremely grateful

I. Is the QoS/quota functionality in the interface dependant on WAN config detection - which is also in the interface?
I added a simple rule in "Quotas" (600MB combined/day limit for subnet 192.168.96/29) to see how it will be reflected on the command-line (checking by using `tc [qdisc|class|filter] show dev [eth0|ppp0|br-lan]`, etc.. but it doesn't seem like it actually did anything. Only result I got was for eth0 qdisc:
Code: Select all
root@OpenWrt:~# tc qdisc show dev eth0
qdisc pfifo_fast 0: root bands 3 priomap 1 2 2 2 1 2 0 0 1 1 1 1 1 1 1 1
Code: Select all
root@OpenWrt:~# cat /usr/data/quotas/quota_192.168.1.96_29_combined
789
0.0.0.0 0

II. I configured the ppp0 (wan) interface manually in /etc/config/network, but in the interface, Connection->Basic page, "Internet / WAN" -> "Connect Via:" is set to "disabled" , and there are only "DHCP (wireless)" and "Static (wireless") options, and that's understandable. "Ethernet Port Connects to:" is set to "LAN", so it seems to be picking up that part of the network config okay.
Any ideas/pointers on where to start? Preferable way(s) to implement this to possibly be able to propose a preliminary platform-independant support patch? Anyone already started working on this?
That's it for now... Cheers