NSLU2-Linux
view · edit · print · history

For those of you that cannot wait to get in touch with the latest hot version of the Unslung-firmware, here is the recipe.

I am a new member in the comunity, my first NSLU2 arrived yesterday, and I'm still in the process of unslinging ... so this document helps me to remember the steps taken and, possibly, will help the newbie to get a kickstart.

The NSLU2 has been shipped with the firmware V23RA5?.

The new version (called 6.x) of Unslung supports usb-hubs on the first port; this can be usefull if you intend, like me, to have an HDD and a printer sharing the first port, and the unslinging disk/flash on a second port.

COMPILING the firmware

I use redhat fedora 3 to compile, but the steps that follow should work on every linux distribution.

First of all you need something to read:

  1. the NewUsersGuide page of this wiki
  2. the http://www.nslu2-linux.org/wiki/HowTo/TelnetIntoRedBoot page of this wiki
  3. the http://www.nslu2-linux.org/wiki/HowTo/RecoverFromABadFlash page ...
  4. the readme file that comes in the package of a Unslung-5.x release firmware http://download.berlios.de/unslung/Unslung-5.5-beta-README.txt
  5. the http://www.nslu2-linux.org/wiki/Development/MasterMakefile page of this wiki
  6. the forum : http://news.gmane.org/gmane.comp.misc.nslu2.linux there are some threads on building the sirmware 6.x (something like this one
 http://article.gmane.org/gmane.comp.misc.nslu2.linux/11103,
 http://groups.yahoo.com/group/nslu2-linux/message/10593)

now you barely know what are the dangers, and you know that, in the worse case, you should simply reflash your firmware to get the NSLU2 working.

Install on your system _boost_, _monotone 0.25_. Download them, unpack them, run

 ./configure; make && sudo make install   (read http://venge.net/monotone/INSTALL)

Or

 yum install monotone boost-devel.

The latest Makefile only works with the latest monotone, at least you should have version 0.27.

Now make a directory on a ext3 filesystem (some filenames, pathdepths could be to loong to be managed by a fat32); this will be the root for the building tree.

 mkdir -p /home/slug
 cd /home/slug
 mkdir downloads

In the "downloads" directoy you will put the two files you download from the Intel site (do you rember? you have read it). It seems that you do not need to put the md5s of those files, they are never checked.

get the Makefile

 wget http://www.nslu2-linux.org/Makefile

and start processing it

 make setup
 make unslung

Now take a break, read something.

I am getting some strange error messages, mhhhh ....

NOTE: package unslung-rootfs-2.3r63-r8: task do_package: started
NOTE: unslung-rootfs contains dangling symlink to /var/tmp/log
NOTE: unslung-rootfs contains dangling symlink to /usr/local/localtime
NOTE: unslung-rootfs contains dangling symlink to /opt/doc
NOTE: Couldn't find shared library provider for libnetwork.so
...
Packaged contents of unslung-rootfs into /mnt/shared2/slug/unslung/tmp/deploy/ipk/unslung-rootfs_2.3r63-r8_armeb.ipk
NOTE: package unslung-rootfs-2.3r63-r8: task do_package: completed

In the thread http://thread.gmane.org/gmane.comp.misc.nslu2.linux/8651 , David Karlström says that they are not really errors.....

but everything seems to end gracefully with

NOTE: package unslung-image-1.0: completed
NOTE: build 200601281100: completed
Build statistics:
  Attempted builds: 34
make[1]: Leaving directory `/mnt/shared2/slug/unslung'

After the compilation I issued (probably unusefull):

 make unslung-image

And I got

( cd unslung ; make image)
make[1]: Entering directory `/mnt/shared2/slug/unslung'
. conf/topdir.conf && test "`pwd`" = "$TOPDIR" || echo "TOPDIR='`pwd`'" > conf/topdir.conf
. ./setup-env; exec bitbake "unslung"-image
NOTE: Psyco JIT Compiler (http://psyco.sf.net) not available. Install it to increase performance.
NOTE: Using cache in '/mnt/shared2/slug/unslung/tmp/cache'
NOTE: Parsing finished. 387 cached, 0 parsed, 16 skipped, 0 masked.
NOTE: build 200601281239: started

OE Build Configuration:
BB_VERSION    = "1.3.2.1"
OE_REVISION   = "7a7a7b77dc6e8829e4d9d213431730e12a84aa0b"
TARGET_ARCH   = "armeb"
TARGET_OS     = "linux"
MACHINE       = "nslu2"
DISTRO        = "unslung"
TARGET_FPU    = "soft"

NOTE: package unslung-image-1.0: started
NOTE: package unslung-image-1.0-r11: task do_fetch: started
NOTE: package unslung-image-1.0-r11: task do_fetch: completed
NOTE: package unslung-image-1.0-r11: task do_rootfs: started
NOTE: package unslung-image-1.0-r11: task do_rootfs: completed
NOTE: package unslung-image-1.0-r11: task do_build: started
NOTE: package unslung-image-1.0-r11: task do_build: completed
NOTE: package unslung-image-1.0: completed
NOTE: build 200601281239: completed
Build statistics:
  Attempted builds: 1
make[1]: Leaving directory `/mnt/shared2/slug/unslung'

In the directory unslung/tmp/deploy/images/ there is the firmware. In my case:

 unslung-nslu2-20060128100038.flashdisk.img

Flashing the firmware

Now starts the flash reprogramming ...

Read

  1. http://www.nslu2-linux.org/wiki/Main/UpSlug2
  2. http://www.nslu2-linux.org/wiki/HowTo/InstallUnslungFirmware

Following the readme file of the firmware 5.5, I flushed successfully the new firmware.

UNSLINGING

This took more than expected.

I used 128Mb and 256Mb flash (as unslinging disks) disks and for both the web-interface was not able to format it. In this case read http://www.nslu2-linux.org/wiki/HowTo/UseAMemoryStickAsMainDrive.

My partitioning is:

 230 Mb for 1st partition
  20 Mb for the second
   6 Mb for the swap

I followed the informations in http://download.berlios.de/unslung/Unslung-5.5-beta-README.txt to unslig, and everithing went file.

After reboot, I have created the file /unslung/rc.local containing the following lines

 #!/bin/sh
 mount -oremount,noatime /dev/sda1 /
 /sbin/swapoff /dev/sda3
 return 1

This will prevent linux to corrupt the flash-disk because of the frequent rewriting of the inodes and the swap area.

Now read my note on http://www.nslu2-linux.org/wiki/HowTo/UseAMemoryStickAsMainDrive where I explain how to ACTIVATE A SWAP PARTITION. The NSLU2 has too few memory, if you don't activate a swap partition on a secondary HDD you risk randoom errors!!!

The NSLU is now unslugged!

After some time playing around with the version V2.3R63-uNSLUng-6.5-alpha I can say that it works!

Configuring CUPS

http://www.nslu2-linux.org/wiki/HowTo/AddPrinter

I have an usb Laserjet printer, thus the CUPS installation is very easy.

  1. Install the cups packages.
  2. start the daemon
  3. create the directory /dev/usb
  4. create the nodes (es. mknod /dev/usb/lp1 c 180 1 )
ls -al /dev/usb
drwxr-xr-x    2 root     root         1024 Jan 31 19:26 .
drwxr-xr-x    4 root     root         3072 Jan 31 19:25 ..
crw-r--r--    1 root     root     180,   0 Jan 31 19:25 lp0
crw-r--r--    1 root     root     180,   1 Jan 31 19:26 lp1
crw-r--r--    1 root     root     180,   2 Jan 31 19:26 lp2
crw-r--r--    1 root     root     180,   3 Jan 31 19:26 lp3
  1. modify the file /opt/etc/cups/cupsd.conf in order to allow the access to the cup interface from your PC
  2. create the spool directory
 
mkdir -P /var/spool/samba
chmod +rwx /var/spool/samba
chmod +rx /var/spool
  1. attach the printer
  2. check if the NSLU2 sees the printer (es. dmesg)
  3. point your browser to the NSLU2 address at port 631
  4. use the web interface to add the printer (preferrably a RAW printer)

Configuring the SAMBA file sharing/printer sharing

The Hdd and the printer are attacched through a USB-hub to the first port. The Web interface doesn't see the HDD, thus all the settings have to be done manually.

  1. modify the /unslung/rc.local
mount -t vfat -o rw,defaults,users /dev/sdb1 /share/myHDD/1
mount -t vfat -o rw,defaults,users /dev/sdb2 /share/myHDD/2
ln -sf /unslung/smb.conf /etc/samba/smb.conf
  1. modify the /etc/smb.conf
cat /unslung/smb.conf                                             
[global]
config file=/etc/samba/smb.conf
unix charset = CP850
dos charset = CP850
os level = 8
workgroup = Default
server string = unslinged ...
printcap name = /etc/printcap
load printers = yes
printings = cups
cups options = raw
max log size = 10
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_KEEPALIVE SO_SNDBUF=16384 SO_RCVBUF=16384
preferred master = yes
dns proxy = no 
preserve case = yes
short preserve case = yes
default case = upper
case sensitive = no
mangled names = yes 
null passwords = yes
dos filetimes = yes
veto files = /.ShareConfFile/quota.user/quota.user~/lost+found/$*/System Volume Information/
delete veto files = False
force directory mode=771
force create mode=660
create mask=771
map system=yes
map to guest=Bad User
guest account=guest
name resolve order = wins bcast
username map=no
include = /etc/samba/user_smb.conf
[ADMIN 2]
valid users=@"administrators"
comment=
path=/share/flash/data/
read only=yes
write list=@"administrators"
[DISK 2]
valid users=@"administrators",@"everyone"
comment=For everyone
path=/share/flash/data/public/
read only=yes
write list=@"administrators",@"everyone"
[filesystem]
valid users=@"administrators",@"everyone" 
comment= the whole fs
path=/
read only=yes
write list=@"administrators"
[myhdd1]
valid users=@"administrators",@"everyone" 
comment=first partition
path=/share/myHDD/1/
read only=yes
write list=@"administrators"
[myhdd2]
valid users=@"administrators",@"everyone" 
comment=second partition
path=/share/myHDD/2/
read only=yes
write list=@"administrators"
[printers]
comment = printers
path = /var/spool/samba
browseable =  yes
printable = yes
public = yes
guest ok = yes
use client driver = yes
print command = /opt/bin/lpr -P %p -o raw %s
lpq command = /opt/bin/lpstat -o %p
lprm command = /opt/bin/cancel %p -%j

stay tuned ...


do not consider the following links, I attach them only for my purposes, they are not related with the argument:

 http://thread.gmane.org/gmane.comp.misc.nslu2.linux/884
view · edit · print · history · Last edited by tnq.
Based on work by dustinemptyspace, marceln, and rwhitby.
Originally by dustinemptyspace.
Page last modified on August 05, 2006, at 05:39 PM