Updated hacks.tar file for use with USB flash f/w
- Edited to fix indenting...
For those interested in using only a USB flash drive and using
the firmware that I've uploaded, I'm updated the hacks.tar
file to take advantage of the snapgear 3.0.0 build that
I've previously posted.
Note: I realize that this may have a rather limited
half-life due to rapid progress in the area of direct
USB flash boot. However, I'm using this for the time
being and others may find it useful.
1) You should be using the firmware I've loaded, which
simply runs the file /share/flash/data/hacks/rc.flash
upon boot. I suppose if you have some other way to run
rc.flash at boot that would work too.
2) Untar the hacks_romfs.tar file in the /share/flash/data
directory. This will create the hacks directory.
3) (Optional) untar the romfs.tar file in the
/share/flash/data directory. This will create the romfs
Before you reboot your router, you may want to tweak the
configuration a bit. Let me go over the files
The rc.d directory contains the individual functions
run at startup. All output is written to the
rc.flash.out file for debugging.
Simply a test script.
Copies the passwd file of your choosing to
the appropriate places. The root and
ourtelnetrescueuser password will be set
Same as above, only for smbpasswd. I don't use this
but have included it for completeness.
Same as above, only for .htpasswd.
Enables the telnet service. You may
rename telnetd.conf if you don't want
telnetd on boot (for whatever reason).
Enables ftpd (if romfs is loaded). You
MUST rename NO_ftpd.conf to ftpd.conf to
enable this service. I've disabled it by
default since you will likely want to
update your passwd file before turning
this on. For example, you may want to
disable anonymous ftp by deleting the
ftp user in your passwd file. You
may also want to disable the passwd
fields for admin, guest, and telnetrescueuser.
You can even disable root's passwd and
create an alternate root id. However,
hardening ftpd and the NLSU2 is probably
a different subject...
Enables a secondary thttpd webserver. I've
disabled this by default and you can enable
it by renaming the .conf file as above. I've
included the configuration that I use, but
it assumes that you have already moved the
admin web server to another port besides 80.
Edit the conf file as you like.
Restarts inetd so that telnet, ftpd can
This symlinks a select list of binaries from
the romfs build into /bin. Edit the list
romfs_bin.files to your liking. If you haven't
loaded romfs, this won't do anything.
This symlinks the busybox from the romfs
build into /bin. Note that I've chosen to
leave the existing busybox alone for compatibility
reasons. I then link in any new functions
into the /bin directory (e.g. grep, sed, etc).
See the file busybox.applets for a complete
list. Some of the links really should have
gone in another directory, but I was too lazy.
If you prefer a different or additional busybox,
just edit this script.
If you use the webserver, the configuration file
above assumes you have created the directory
/share/flash/data/html/<virtual_host> for each
virtual host you are serving. You, of course,
don't have to use virtual hosting, but it is
pretty cool that it works. Make sure you create
index.htm files for each directory or else
you will get some wierdness from the built-in
linksys pages in thttpd.
File protection is minimal if you are running the
default vfat filesystem on your FLASH drive. So, take
care in creating ftp accounts. This also affects
thttpd as well.
Now, reboot your router and play with the
new functions and services.
If you want to add new startup scripts, just
put then in the rc.d dirctory and name them
with a .sh extension and a leading three digit
TODO: Cleanup the file system layout.
TODO2: Create a sym link from /alt to /share/flash/data
or /share/hdd/data so that I can eliminate all of the
long ugly paths.