Note that you can now use the instructions at NativelyCompileUnslungPackages to natively packages directly from the Unslung CVS repository.
a success on 10/28/2011
This page is my (TJ Yang) learning note about compiling packages natively on nslu2.
This page will retire and merge with other page when time is right.
This is a hack not a real solution.
The real solution is to modify unslung/Makefile to support both platform better without following hacks.
Bill of materials and procedures:
- A NSLU2 box with Unslung 3.16 or 3.17 beta firmware.
- A good network connection to the Internet.
- Check out the package sources from NSLU2 CVS server.
- Install the native gcc compiler for NSLU2. See NativeFloatingPointToolchain.
- Modify unslung/Makefile for NSLU2 environment.
- Disable the crosstool build triggered by making other package.
Example: you need do adjust the real absolute path to your own setting before running following two commands.These two command will let make skip the making of crosstool.
- Adjust the CROSS_TARGET variable to gcc installed at 4.
Example:Modify TARGET_CROSS variable to point to the arm5b native compiler you downloaded and installed.
- All the scripts in make/*.mk assumes that the shell is bash. This is ok when it run on a Linux workstation but Unslung's "sh" is "ash". for now, I cheated by linking sh to /opt/bin/bash.
"chmod go+w /dev/null;chmod go+rw /tmp" to fix a wrong mode from Unslung firmware (both 3.16 and 3.17 beta)
- make sure ar and strip exists, they are missing from gcc-3.4.2-glibc-2.3.2 version of rene's gcc.
cp /share/hdd/data/tools/gcc/armv5b-softfloat-linux/bin/strip /share/hdd/data/tools/gcc/bin/armv5b-softfloat-linux-strip
cp /share/hdd/data/tools/gcc/armv5b-softfloat-linux/bin/ar /share/hdd/data/tools/gcc/bin/armv5b-softfloat-linux-ar
- Do a test make by "
make zlib" and you should see zlib compilation and should not see crosstool compilation.
- "ipkg -force-overwrite install bash" install bash.
T.J. Yang (firstname.lastname@example.org)