NAS
NAS How To
How To: Hacking the Linksys NSLU2 - Part 2 - Adding NFS | How To: Hacking the Linksys NSLU2 - Part 2 - Adding NFS |
|
|
| Jim Buzbee | |
| August 10, 2004 | |
A Toolchain ShortcutThe thought of installing a cross-compilation toolchain instills fear in the hearts of many developers. The idea of compiling a compiler and C library and linker, plus support libraries and utilities is just too much. Fortunately in the age of the Internet, there has to be someone out there who has already gone through the pain and is sharing their effort. For gcc cross-compilers that someone is Dan Kegel. Dan has a terrific script that starts from scratch. It downloads the required sources, patches them as necessary and builds a complete toolchain - and can do it for many different processors. I've used Dan's scripts to build a cross-compilation toolchain for the MIPS based Linksys WRT54G and it was a breeze. I've heard from at least one person that Dan's scripts will build a toolchain that produces NSLU2 compatible binaries. I highly recommend Dan's tools, but for the purposes of this article I 'm going to take a short cut. Linksys appears to be struggling a bit with the release of source code as required under the GPL license. Many of their devices run Linux internally, but their GPL releases differ greatly. Some include a complete build environment while others like the NSLU2 have a less than complete release. The CD that accompanies the NSLU2 has a great deal of source, but no toolchain. Fortunately, Linksys has another Linux-based device - their WRV54G Wireless-G VPN Broadband Router - that appears to be based on the same Intel IXP425 development board. Since they have released a toolchain for that product, we'll use it. Download the 125 MB (!) file and untar it in your home directory. For me, the top of the tree looks like : /home/jbuzbee/gpl_code_2.03 Inside this directory you'll find a file called toolchain.tgz. It looks like this was designed to be untarred from the root directory but I choose to untar it in place so as to keep all of my build environment in my home directory. After untarring it, you'll find the required compilers, linkers, include files, etc. The binaries reside in the usr/local/openrg/armsaeb/bin directory and all have a prefix of armv4b-hardhat-linux-. I put that directory in my $PATH so I don't have to type out the full directory tree each time I compile. Testing the Compiler Let's try out the compiler to make sure it generates a good binary. The first thing any self-respecting C programmer writes is "Hello World", so I created a file called hello.c: #include <stdio.h> main( int argc char *argv[] ) { printf("Hello world!n"); } then compiled it : # export PATH=home/jbuzbee/gpl_code_2.03/usr/local/openrg/armsaeb/bin/:$PATH # armv4b-hardhat-linux-gcc hello.c -o hello and checked the resulting file type : # file hello hello: ELF 32-bit MSB executable, ARM, version 1 (ARM), for GNU/Linux 2.0.0, dynamically linked (uses shared libs), not stripped Looks good. Now move the file over to your NSLU2 by ftp'ing it starting from your NSLU2 box. Remember to do a binary transfer and to mark the file as executable. Once it's there, try it out : # ./hello Hello World! It works! Now we have the ability to create and run arbitrary programs on our NSLU2. Make sure that anything you want to keep gets put on your NSLU2 hard drive. By default, the home directory for the root account is on a ram disk. Create a new directory in the normal Linux way and then put your new binary in it. For me it's : # mkdir /share/hdd/data/jim/nslu2 # mv hello /share/hdd/data/jim/nslu2/ Tags: BYOD, Hacking, How To, Linksys, NAS, NSLU2, Related Articles:How To:Hacking the Linksys NSLU2 - Part 3 - Adding an iTunes serverHow To: Hacking the Linksys NSLU2 - Part 4- Customizing the Flash How To: Hacking the Linksys NSLU2 - Part 5- Moving to Unslung Hacking the Linksys NSLU2 Part VI - Installing a Media Server How To: Hacking the Linksys NSLU2 - Part 1 |
|
Need advice which Router/AP I should use (newbe)
Problem with RDP over VPN
Fios Router P2P issue? Or throttling?
TP-LINK TL-WR941ND (review request)
Improving Linksys WRT610N Range
|
|
|
|
|
|
|
|
More |
|
You could win a Trendnet TE100-MP2U 2-Port Multi-Function Print Server and IOGEAR GUIP201 USB Net ShareStation |
| Wireless Performance Charts: Linksys WRT610N |
| Router Performance Charts: Linksys WRT610N |
|
Behold the five radiators, six graphics cards and 50+ fans “DayWalker” system Logitech’s Slim Devices intros Squeezebox Boom network player |
|
Google goes to 'Android Market' in App Store challenge Nominum clobbers DNS cache poisoning vulnerability Telstra's UK 'expert' all "false assumptions and bias" says T4 |
Z-Wave SmartPhone Home Control Systems Offer Energy Saving Features