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 | |
Modifying and Building the PortmapperNow we can move on to bigger and better things. It may seem a big step to go from "Hello World" to NFS, but it's not too bad. First we need to install and setup the Linux source tree in order to access the required include files. The source tree can be found in the snapgear tar file included on the CD distributed with the NSLU2. First untar the snapgear tar file in your build area. Since we are not going to be building the kernel, we'll take a shortcut setting up for an ARM architecture. Create and execute the following script from within the snapgear/linux-2.4.x directory : #!/bin/bash rm -f include/asm rm -f include/asm-arm/proc rm -f include/asm-arm/arch ( cd include; ln -s asm-arm asm ) ( cd include/asm-arm; ln -s proc-armv proc ) ( cd include/asm-arm; ln -s arch-ixp425 arch ) Now we should be set up for more complex builds. NFS is based on a Remote Procedure Call architecture. In order for RPC to function, it needs a helper daemon called the portmapper. I found portmapper source code here, and source for an NFS server here. After untarring the source trees you should end up with portmap_4 directory, a snapgear directory and a nfs-server-2.2beta47 directory along with the original gpl_code_2.03 directory. Next let's build the portmapper. I had to make a few changes to the Makefile to simplify the build. First, I commented out the line : HOSTS_ACCESS= -DHOSTS_ACCESS, to reduce an external library dependence. Everywhere I saw a reference to libwrap.a I also commented it out for the same reason. For a more secure server, these can be put back, but additional libraries will be needed. I then modified the CFLAGS line to point to my snapgear linux source tree : CFLAGS = $(COPT) -O $(NSARCHS) $(SETPGRP) -I /home/jbuzbee/snapgear/linux-2.4.x/include/ Finally, in the top of the makefile, I added the following line in order to invoke the cross compiler: CC=/home/jbuzbee/gpl_code_2.03/usr/local/openrg/armsaeb/bin/armv4b-hardhat-linux-gcc In addition to the makefile changes, I needed to make a small source change. In the file portmap.c, there's a perror function defined that overrides the standard perror. I changed the argument definition from const char to __const char so as to match the stdio.h definition in our cross compilation tree. Now, all that is required is a "make". This produces a number of warnings, but the build should run to completion. Next strip the binary to save memory for our little box: # armv4b-hardhat-linux-strip portmap 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 |
|
Are Cat6 and Cat5e not perfectly compatible?
Captive portal for security
D-Link DNS-323 Mysteries
Gigabit Network Help!
Synology DS-209+ review up!!
|
|
|
|
|
|
|
|
More |
|
You could win a Trendnet TEW-633GR Wireless N Gigabit Router and two TEW-621PC 300Mbps Wireless N-Draft PC Cards |
| Wireless Performance Charts: Belkin N+ Wireless Router |
| Router Performance Charts: Belkin N+ Wireless Router |
|
SearchWiki Search personalized by Google Analyst firm cuts 2009 PC growth expectations by 64% Graphene-based memory eyed by researchers to replace flash |
Cooper Wiring Devices intros Aspire RF Home Controller