NSLU2-Linux
view · edit · print · history

further info is here http://www.nslu2-linux.org/wiki/SlugOS/NativeBuildForopenslug

Compiling natively is quite possible provided you have plenty of time, swap and diskspace. Below are some instructions to get you going. These should work on SlugOS 3.10 (and probably higher)

  1. Make sure you have lots of swap
  2. Add a normal user, 'slug' is recommended
  3. ipkg install slugos-native (this package is not yet available for 4.8beta)
  4. ipkg install libc6-dev (not needed after 3.10)
  5. ipkg install boost-dev
  6. ipkg install libz-dev
  7. ipkg install monotone-5 (this package is not yet available for 4.8beta)
  8. ipkg --force-overwrite install ipkg-utils
  9. Login as the normal user
  10. Run wget http://www.nslu2-linux.org/Makefile && make setup (this will take a while)
  11. At this point you need to create .../openslug/conf/topdir.conf. It should contain the path to your openslug dir (e.g. for me TOPDIR='/home/slug/OpenSlugHead/openslug'
  12. Run bash, then cd openslug && source setup-env
  13. Now you can run make to build everything supposed to be built natively (and be prepared to wait a loooong time), or use bb to build specific packages:
    bb -b openembedded/packages/setpwc/setpwc_1.1.bb

During the bb process you may get notifications like:
NOTE: Couldn't find shared library provider for libncurses.so.5
NOTE: Couldn't find shared library provider for libc.so.6
These can be ignored. Alternately you can get rid of the error by compiling with the -mthumb-interwork flag. E.g.:
gcc -o hello -mthumb-interwork hello.c

Other notes

compiling programs with gcc.
gcc -o hello hello.c will give you a warning like Warning: /tmp/ccJ12GPL.o does not support interworking, whereas hello does but will produce a working executable.

configuring libthread-db1:
//usr/lib/ipkg/info/libthread-db1.postinst: 4: ldconfig: not found libthread-db1.postinst returned 127 so run /sbin/ldconfig by hand

More notes:

My modifiations:
- ipkg install python-distutils
- ipkg install libc6-dev (because crt1.o missing)
- correct in bitbake.conf the following

  ASSUME_PROVIDED = 
to
ASSUME_PROVIDED +=
- touch bitbake.conf

And more notes

Running wget http://www.nslu2-linux.org/Makefile && make setup fails cant find monotone so i linked monotone to mtn And I end up with this error

monotone: error: failure extracting schema from sqlite_master

This is due to the master makefile now requiring montone 0.28 for which there is no package and so far I have been unable to compile it natively. I found a forum (sorry, can't remember where) which acknowledges this and stated that fixing it "wasn't a high priority". So basically, don't bother with native compliation as it's fatally bust and those cross compilers that broke it couldn't be bothered to update this page. If only I'd discovered that BEFORE I totally rebuilt my slug...

Fix for ldconfig: not found

If you log in as a regular user, then su to root, the PATH does not include /sbin, which is why ldconfig could not be found. Log in as root, and PATH will include /sbin, and ldconfig will be found.

Fix with ar

The following steps were also required to replace the busybox ar utility with a one enabling building your own libraries:

 # cd /usr/bin
 # rm ar
 # ln -s arm-linux-ar ar

With this fix for me is possible to compile.

view · edit · print · history · Last edited by dolphs.
Based on work by dolphs, Fabio, Sebastien, dawookie, jysue, krim, Harvy, die amme, and eFfeM.
Originally by eFfeM.
Page last modified on January 03, 2008, at 11:17 AM