Try manually running the postinstall script using /opt/bin/bash instead of /bin/sh.
FWIW, I've installed the gcc toolset on my router and while natively compiling various libraries and software packages, I have noticed that *lots* of scripts, makefiles, etc. assume that /bin/sh is actually a bash shell. Your script is probably trying to do something tricky that our busybox ash shell cannot do.
For my next firmware image, I want to give advanced users the ability to hook/replace certain system binaries. This would include being able to redirect /bin/sh to /opt/bin/bash.
- K.C.
IMM22: But what is the propose of the screen?
gratitude182: could you tell me, how do get c-torrent to work? i would like to try this....
OK, first thing is to follow all the kfurge instructions, and thus get the firmware installed and running. You have to get an rc.local in the right spot with the right permissions. You have to set up a user account via the web interface, and you have to edit a .profile file for that user. Include the setting of TERM and TERMINFO environment variables. (These are part of kfurges instructions).
In short, you have to do everything in steps 1 through 5, and use rc.local #3 (although you can comment out the section "# Restart the web server").
After doing all that, you should have wget ncurses, ncursesw, termcap & ipkg installed, and bash, dropbear and sudo all installed.
You have to install the following additional optware packages: screen & enhanced-ctorrent. I also installed nano, less & mc.
I also created a symbolic link between /shares/MYVOLUME1/MYSHARE1/Download and /opt/home/<user>/Download.
You have to have an ssh client program running on your client PC. I used ssh or kssh under Linux, but PuTTY under Windows will do as well.
Using ssh or PuTTY on your PC, log in to the dropbear server on the WL700GE. Now we find out how (and why) to use "screen".
On the WL700ge at the command-line prompt, type: 'screen -R' (without the quotes). This creates a new "virtual screen" (which you can "detach" and "re-attach" later on).
On the virtual screen, type 'cd Download' (or cd /shares/MYVOLUME1/MYSHARE1/Download if you don't have the symbolic link).
Type 'wget http://path.to.torrent.file.that.you.want/file.torrent' <== you get the idea here. I always find it best to copy the text of URLs from my browser and paste that text into the terminal programs directly.
Once you have got a local copy of the .torrent file in the Download place, then type:
'enhanced-ctorrent file.torrent'. (... where file.torrent is the name of the torrent file you downloaded in the previous step. I always find it best to type the 'enh', then press the tab key, then type the first few letters of the .torrent filename, then press the tab key).
OK, the bitorent download should start, and begin displaying progress on the screen. After you have got bored watching that for a while, press and hold the Ctrl key, press 'a' and then 'd'. (Ctrl-a-d). This will "detach" the screen.
Type 'screen -R' to re-attach the screen. Press (Ctrl-a-d) to detach it again. Do this as many times as you want. This demonstrates the effect.
When the screen is detached, you may logout (type 'exit'). The torrent download will continue on the WL700GE. You can shutdown your client PC and turn it off, but still the torrent download will continue on the WL700GE.
Even days later, you can fire up your PC, start PuTTY or ssh again, login to the WL700GE, and type 'screen -R' to see how your torrent download is progressing. Once the download has finally completed, type (Ctrl-C) to stop the enhanced-ctorrent program from running. Type 'exit' to kill the virtual screen. Type 'exit' again to logout.
Your torrent download is ready.
Last edited by hal2k1; 15-12-2006 at 08:51.
Hi all,
This is my first post on this group. I have been watching this forum for a while, generally being very interested in the potential of this box. I have to say that I'm impressed at the speed the firmware is progressing.
Anyway getting back to my original question, I use newsgroups as opposed to torrents and in particular I use hellanzb to get the posts via .nzb files. I was wondering whether anybody thinks that it would be able to be complied and ran on this box, before I spend some money to investigate it further.
Cheers..
I see that the file /etc/hosts on the router is a symlink to /tmp/hosts , and that it contains the very minimalist contents:
--------------------
127.0.0.1 localhost.localdomain localhost
--------------------
The file /etc/nsswitch contains the contents:
--------------------
hosts: files dns
--------------------
That means the the router will use local files for dns lookup and then, if there is no entry for the IP address of interest, it will look up an address on the wider internet.
OK, so that means if I can put static addresses in the /etc/hosts file, my router will know the local LAN addresses when it does a DNS lookup.
At present, my router has a problem finding the hostnames of linux machines on the LAN. I'd rather use MAC addresses and DHCP to assign IP addresses, then put those addresses into /etc/hosts.
So does anyone have a suggestion on how I can get additional info (perhaps on boot) into the /etc/hosts file?
Can anyone suggest some commands to put into rc.local, perhaps?
Possibly something along the lines of :
----------------------------
cat /opt/etc/hosts.lan >> /tmp/hosts
----------------------------
Can I put such a thing in rc.local, or would it have to be part of the firmware?
Dear K.C.
Thanks for the great work!
One quick question, does Step 5.7 (changing default login shell & home directory) survive over router reboot? Any chance to make it do so?
Thanks,
Lewis
I don't see why not. Look at the huge collection of packages already available!
I've installed the gcc toolkit on my box and compile my applications directly on it. I've even gone so far as to get gphoto (and all of it's dependent libraries) working. I use the front USB port to download pictures straight off of my camera. Works great!
IMHO, the potential of this box is only limited by your desire and expertise.
Some time soon I plan to rework the "copy" button on the front to auto-download pictures when the camera is pugged in, and auto-backup the HDD when an external drive is plugged in. I've already begun experimenting with manipulating the gpio pins. I had a close call, actually, since one of them apparently controls power to the internal HDD.... ;-)
- K.C.
@hal2k1
thanks for the tutorial... i will try it when i'm back in my flat to test it (so about in 2-3 weeks)... thanks
@kfurge
great work and thanks to post that all ;-)
Nice - I have the transmission package working on my router - this does some proper upload/download speed limiting and has a web access page to manage torrents.
Anyone who is interested, this is how I set it up: http://wl700g.info/showpost.php?p=43330&postcount=5
kfurge - do you know if it's possible to use gpio to turn off the front panel lights - I would like to keep my router on, but it's in my bedroom and the flashing lights keep me awake![]()
Maybe it's getting configured after rcex/rc.local is called. Try something like this in rc.local:
(sleep 10; cat /opt/etc/hosts.lan >> /tmp/hosts) &
Dial in the sleep time so that it's not too long. From the looks of the date/time stamps on my box, this file might get touched regularly after boot-up... The hack above might be better as a script to see if the file changes, then update it via a cron job.
We might be able to make this more elegant with the next firmware if I'm able to hook into the system binaries as they're run.
- K.C.