Hi Yani,
Excellent work with this - I'm glad to see you've packaged it properly and provided documentation. I think Shorewall is one of the key apps that will make a WRT54G with OpenWRT a truly flexible, powerful little box.
I've been playing with Shorewall on the WRT54G myself but have limited spare time at my disposal. I got bogged down getting 'printf' to work - Shorewall uses it to make log entries, but printf is not included in the standard OpenWRT busybox. However, 'awk' is in the default OpenWRT busybox and mbm has pointed out that 'awk' has a printf command that could be used replace the shell 'printf'. I've included a couple of diffs (created with 'diff -u ') to show how I've edited my 'shorewall' and 'firewall' Shorewall scripts to take advantage of this.
As an example - in the 'shorewall' script there is the line
printf '%7d %5d %sn' $count $port $srv
I replaced this with
echo $count $port $srv | awk '{printf("%7d %5dn",$1,$2,$3)}'
Thanks to mbm for pointing out how to do this with awk.
I'd actually prefer if Shorewall didn't log to the flash at all - I don't want to wear out the flash memory with it's limited read/write lifetime. From reading another thread I've seen that invoking syslogd like so:
syslogd -C
causes it to write to RAM as a circular log - i.e. the oldest entries are erased and the whole log remains at 200k in size. You can read the log by typing:
logread
The latest versions of OpenWRT have 'syslogd -C 16' set up by default in /etc/init.d/S10boot
If you reboot you lose the log - so my advice is if you want to keep the log, send it to a PC or other device with a hard-drive. As I understand it, syslogd allows you to log to both local RAM and an external PC at the same time.
In my diff files you'll notice that I've also removed a lot of the comments (except for the copyright and GPL comments) to save space. In my Shorewall I've actually removed the comments from most of the config files as well, simply becase I run Shorewall on my router PCs at home and can refer to the comments in their config files if I get stuck. Space is at a premium, espcecially in the WRT54G and I think a Shorewall package that has most of the comments removed from it's files would be a good option.