Difference between revisions of "NSLU2"
Jump to navigation
Jump to search
m (→Debian) |
m (Reverted edits by Etegohy (Talk) to last revision by PhilippeTeuwen) |
||
(50 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
+ | http://www.andreabeggi.net/wp-content/53006-nslu2.jpg |
||
+ | |||
+ | ==Intro== |
||
+ | * XScale processor from Intel (ARM) at 266MHz (133MHz before hacking...) |
||
+ | * 32Mb SDRAM |
||
+ | * 8Mb Flash |
||
+ | * 2 USB 2.0 ports |
||
+ | |||
==Links== |
==Links== |
||
− | * http://en.wikipedia.org/wiki/NSLU2 |
+ | * [http://en.wikipedia.org/wiki/NSLU2 Description] on wikipedia |
+ | * [http://www.nslu2-linux.org/wiki/OpenSlug/HomePage OpenSlug] |
||
+ | |||
==Todo== |
==Todo== |
||
+ | * Mine came with |
||
− | * check if we need to http://www.nslu2-linux.org/wiki/HowTo/OverClockTheSlug |
||
+ | ** Server Name: LKG63472F |
||
+ | ** Version: V2.3RA5 |
||
+ | * Connect USB printer? |
||
+ | * Install backuppc -> I tried but slug is really too slow for that :-( |
||
+ | * Connect Tuxdroid dongle |
||
+ | |||
==Debian== |
==Debian== |
||
− | * [http://www. |
+ | * [http://www.nslu2-linux.org/wiki/Debian/HomePage Debian/NSLU2] |
− | * |
+ | * [http://www.cyrius.com/debian/nslu2/ How to install Debian on NSLU2] |
+ | ===Installation=== |
||
+ | To install, follow the [http://www.cyrius.com/debian/nslu2/install.html howto], here are the big steps: |
||
+ | * Get [http://www.slug-firmware.net/d-dls.php Debian 4.0r0] firmware from http://www.slug-firmware.net/ and unzip it |
||
+ | * Power the NSLU2 and wait a bit (green light) before plugging it to the network if you've a DHCP, so the NSLU2 will choose itself IP 192.168.1.77, otherwise look to your DHCP server logs to find the IP attribution |
||
+ | * Go to the admin webpage, tab administration, login admin/admin |
||
+ | * Configure ALL network params if you don't have DHCP |
||
+ | * Go to the admin webpage, tab administration, login admin/admin, tab advanced, tab upgrade |
||
+ | * Upload di-nslu2.bin, start upgrade |
||
+ | * Wait for "upgrading ok" (5mins) -> wait for 3 bips (5-10mins) |
||
+ | * This is the last moment to plug an external USB mass-storage if you didn't do so yet |
||
+ | * Login via ssh installer@192.168.1.77 (or another IP got by DHCP...) pwd "install" |
||
+ | ** I did it from an xterm but exported term mode is pure console so it's better to login from a real text console otherwise the ncurses menu is a bit broken (but still usable) |
||
+ | * Start installation, manually load the following modules: |
||
+ | ** ext3-modules-2.6.18-4-ixp4xx-di |
||
+ | ** partman-auto |
||
+ | ** partman-ext3 |
||
+ | ** scsi-core-modules-2.6.18-4-ixp4xx-di |
||
+ | ** usb-storage-modules-2.6.18-4-ixp4xx-di |
||
+ | * Whatever system you choose to partition your disk, be sure to have at least 128M of swap, I've set up 512M on my 400G drive. |
||
+ | * In total it took about 100 mins to complete |
||
+ | * If you need a console, start a second ssh connection and choose to obtain a shell |
||
+ | * On tasksel, I chose absolutely nothing, I prefer to take only what I need later |
||
+ | ===After first reboot=== |
||
+ | * dpkg --get-selections|wc -l |
||
+ | 142 |
||
+ | * du -hs / |
||
+ | 179M |
||
+ | * dmesg: |
||
+ | Linux version 2.6.18-4-ixp4xx (Debian 2.6.18.dfsg.1-12) (waldi@debian.org) (gcc versi |
||
+ | on 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 Tue Mar 27 18:01:56 BST 2007 |
||
+ | CPU: XScale-IXP42x Family [690541f1] revision 1 (ARMv5TE), cr=0000397f |
||
+ | Machine: Linksys NSLU2 |
||
+ | Memory policy: ECC disabled, Data cache writeback |
||
+ | On node 0 totalpages: 8192 |
||
+ | DMA zone: 8192 pages, LIFO batch:1 |
||
+ | CPU0: D VIVT undefined 5 cache |
||
+ | CPU0: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets |
||
+ | CPU0: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets |
||
+ | Built 1 zonelists. Total pages: 8192 |
||
+ | Kernel command line: console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug |
||
+ | IRQ lockup detection disabled |
||
+ | PID hash table entries: 256 (order: 8, 1024 bytes) |
||
+ | Console: colour dummy device 80x30 |
||
+ | Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) |
||
+ | Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) |
||
+ | Memory: 32MB = 32MB total |
||
+ | Memory: 25780KB available (1948K code, 496K data, 92K init) |
||
+ | |||
+ | Calibrating delay loop... 132.71 BogoMIPS (lpj=663552) |
||
+ | ... |
||
+ | * hdparm -tT /dev/sda |
||
+ | /dev/sda: |
||
+ | Timing cached reads: 86 MB in 2.04 seconds = 42.20 MB/sec |
||
+ | Timing buffered disk reads: 28 MB in 3.12 seconds = 8.98 MB/sec |
||
+ | ===Tweaks=== |
||
+ | * Ok so our NSLU2 is well underclocked, let's restore its full speed following [http://www.nslu2-linux.org/wiki/HowTo/OverClockTheSlug this howto] |
||
+ | Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200) |
||
+ | Much better :-) |
||
+ | /dev/sda: |
||
+ | Timing cached reads: 90 MB in 2.00 seconds = 44.98 MB/sec |
||
+ | Timing buffered disk reads: 32 MB in 3.03 seconds = 10.56 MB/sec |
||
+ | A bit better but nothing fantastic... |
||
+ | * Setup static network parameters |
||
+ | ** apt-get install resolvconf |
||
+ | ** edit /etc/network/interfaces |
||
+ | allow-hotplug eth0 |
||
+ | iface eth0 inet static |
||
+ | address 192.168.1.77 |
||
+ | netmask 255.255.255.0 |
||
+ | gateway 192.168.1.1 |
||
+ | dns-nameservers 192.168.1.2 192.168.1.1 |
||
+ | * From /usr/share/doc/nslu2-utils/README.Debian: |
||
+ | ** sed -i 's/^FSCKFIX=.*$/FSCKFIX=yes/' /etc/default/rcS |
||
+ | ** sed -i 's/^BOOTLOGD_ENABLE=.*$/BOOTLOGD_ENABLE=yes/' /etc/default/bootlogd |
||
+ | ** Reorder the booting sequence to get ssh up earlier: |
||
+ | ls -l /etc/rcS.d/ |
||
+ | S21resolvconf -> ../init.d/resolvconf |
||
+ | S22ifupdown -> ../init.d/ifupdown |
||
+ | S23networking -> ../init.d/networking |
||
+ | S23ssh -> ../init.d/ssh |
||
+ | |||
+ | ** By default the power button restarts the slug, change the call to shutdown in /etc/inittab: |
||
+ | ca:12345:ctrlaltdel:/sbin/shutdown -h now |
||
+ | |||
+ | ==Devel== |
||
+ | Be prepared to do some native compilation... |
||
+ | * apt-get install build-essential |
||
+ | ===Tuxdroid=== |
||
+ | ====Basics==== |
||
+ | * apt-get install subversion libusb-dev libglib2.0-dev ipython |
||
+ | * mkdir /home/tuxdroid; cd /home/tuxdroid |
||
+ | * svn co http://svn.tuxisalive.com tuxdroid-svn |
||
+ | * cd tuxdroid-svn/daemon/trunk |
||
+ | * make |
||
+ | * mkdir -p /opt/tuxdroid/api |
||
+ | * ln -s /home/tuxdroid/tuxdroid-svn/software /opt/tuxdroid/api/python |
||
+ | * mkdir -p /opt/tuxdroid/bin |
||
+ | * ln -s /home/tuxdroid/tuxdroid-svn/daemon/trunk/tuxdaemon /opt/tuxdroid/bin |
||
+ | * ln -s /opt/tuxdroid/bin/tuxdaemon /usr/local/bin/tuxdaemon |
||
+ | * echo -e "#/bin/bash\npython -i /opt/tuxdroid/api/python/tux.py" > /opt/tuxdroid/bin/tuxsh |
||
+ | * chmod 755 /opt/tuxdroid/bin/tuxsh |
||
+ | * ln -s /opt/tuxdroid/bin/tuxsh /usr/local/bin/tuxsh |
||
+ | ===Flashing tools=== |
||
+ | * cd /home/tuxdroid |
||
+ | * cd tuxdroid-svn/firmware/tuxup/trunk/ |
||
+ | * make |
||
+ | * ln -s /home/tuxdroid/tuxdroid-svn/firmware/tuxup/trunk/tuxup /opt/tuxdroid/bin |
||
+ | * ln -s /opt/tuxdroid/bin/tuxup /usr/local/bin/tuxup |
||
+ | * wget http://belnet.dl.sourceforge.net/sourceforge/dfu-programmer/dfu-programmer-0.4.0.tar.gz |
||
+ | * tar xzf dfu-programmer-0.4.0.tar.gz |
||
+ | * cd dfu-programmer-0.4.0 |
||
+ | * ./configure |
||
+ | * make |
||
+ | * ln -s /home/tuxdroid/dfu-programmer-0.4.0/src/dfu-programmer /usr/local/bin |
||
+ | * apt-get install gcc-avr avr-libc gdb-avr libsvn-dev |
||
+ | * wget http://svnwcrev.tigris.org/files/documents/3444/29110/svnwcrev-0.1.tar.gz |
||
+ | * tar -xzf svnwcrev-0.1.tar.gz |
||
+ | * cd svnwcrev-0.1 |
||
+ | * sed 's/apr-0/apr-1.0/' config_mk.template > config.mk |
||
+ | * make |
||
+ | * ln -s /home/tuxdroid/svnwcrev-0.1/svnwcrev /usr/local/bin/ |
||
+ | |||
+ | ===Audio=== |
||
+ | * apt-get install alsa-utils mpg321 |
||
+ | * cat /proc/asound/cards |
||
+ | 0 [Droid ]: USB-Audio - Tux Droid |
||
+ | Kysoh Tux Droid at usb-0000:00:01.0-1, full speed |
||
+ | * with a more recent firmware you get: |
||
+ | 0 [default ]: USB-Audio - TUX RF DONGLE |
||
+ | C2ME BELGIUM TUX RF DONGLE at usb-0000:00:01.0-1, full speed |
||
+ | For oss layer: |
||
+ | * modprobe snd_pcm_oss |
||
+ | * modprobe snd_mixer_oss |
||
+ | |||
+ | '''[[Webradio]]''' |
||
+ | |||
+ | ===Status=== |
||
+ | * compiling tuxdaemon '''OK''' |
||
+ | * running tuxdaemon '''FAIL''' |
||
+ | ** USB part seems ok (displays tux events properly) but not TCP part, seems not to be listening on port |
||
+ | * compiling tuxup '''OK''' |
||
+ | * compiling dfu-programmer '''OK''' |
||
+ | * compiling svncrev '''OK''' |
||
+ | * compiling tuxcore tuxaudio '''OK''' |
||
+ | * flashing tuxcore.hex tuxcore.eep tuxaudio.hex tuxaudio.eep '''OK''' |
||
+ | * sound '''PARTLY''' |
||
+ | ** ALSA and OSS-emulation layers are up |
||
+ | ** the sound is quite hashed and lot of "alsa underrun" msgs, slightly better results through oss than alsa |
||
+ | ** recording at 8000 Hz mono is very poor (played on host) |
||
+ | ** playing at 8000 Hz mono is poor (recorded on host) |
||
+ | ** madplay -b8 -R8000 ...mp3 is correct |
||
+ | ==Misc== |
||
+ | ===Boot diagnostics=== |
||
+ | From /usr/share/doc/nslu2-utils/README.Debian but in case of problems I prefer to have the text here :-) |
||
+ | Some of the led states during boot include: |
||
+ | - Cycling down all the leds from top to bottom: The APEX boot loader. |
||
+ | - Amber status led: Initramfs is running, mounting root filesystem. |
||
+ | - Disk 1 on, status slowly switching between amber and green: Root |
||
+ | filesystem mounted, system booting. |
||
+ | - Disk 1 on, status green, with fast double amber flashes: System is booted |
||
+ | and running. The frequency of the amber flashes indicates the system's |
||
+ | one minute load average; faster flashes denote higher load. |
||
+ | - Disk 1 on, status quickly flashing between black/green and black/amber. |
||
+ | Single user mode. Again the flash interval denotes load. |
||
+ | - Disk 1 on, status slowly switching beteween amber and red: Shutdown in |
||
+ | progress. |
||
+ | ===tests=== |
||
+ | apt-get install locales |
||
+ | apache2-mpm-prefork - Traditional model for Apache HTTPD 2.1 |
||
+ | apache2-mpm-worker - High speed threaded model for Apache HTTPD 2.1 |
Latest revision as of 21:33, 24 November 2010
http://www.andreabeggi.net/wp-content/53006-nslu2.jpg
Intro
- XScale processor from Intel (ARM) at 266MHz (133MHz before hacking...)
- 32Mb SDRAM
- 8Mb Flash
- 2 USB 2.0 ports
Links
- Description on wikipedia
- OpenSlug
Todo
- Mine came with
- Server Name: LKG63472F
- Version: V2.3RA5
- Connect USB printer?
- Install backuppc -> I tried but slug is really too slow for that :-(
- Connect Tuxdroid dongle
Debian
Installation
To install, follow the howto, here are the big steps:
- Get Debian 4.0r0 firmware from http://www.slug-firmware.net/ and unzip it
- Power the NSLU2 and wait a bit (green light) before plugging it to the network if you've a DHCP, so the NSLU2 will choose itself IP 192.168.1.77, otherwise look to your DHCP server logs to find the IP attribution
- Go to the admin webpage, tab administration, login admin/admin
- Configure ALL network params if you don't have DHCP
- Go to the admin webpage, tab administration, login admin/admin, tab advanced, tab upgrade
- Upload di-nslu2.bin, start upgrade
- Wait for "upgrading ok" (5mins) -> wait for 3 bips (5-10mins)
- This is the last moment to plug an external USB mass-storage if you didn't do so yet
- Login via ssh installer@192.168.1.77 (or another IP got by DHCP...) pwd "install"
- I did it from an xterm but exported term mode is pure console so it's better to login from a real text console otherwise the ncurses menu is a bit broken (but still usable)
- Start installation, manually load the following modules:
- ext3-modules-2.6.18-4-ixp4xx-di
- partman-auto
- partman-ext3
- scsi-core-modules-2.6.18-4-ixp4xx-di
- usb-storage-modules-2.6.18-4-ixp4xx-di
- Whatever system you choose to partition your disk, be sure to have at least 128M of swap, I've set up 512M on my 400G drive.
- In total it took about 100 mins to complete
- If you need a console, start a second ssh connection and choose to obtain a shell
- On tasksel, I chose absolutely nothing, I prefer to take only what I need later
After first reboot
- dpkg --get-selections|wc -l
142
- du -hs /
179M
- dmesg:
Linux version 2.6.18-4-ixp4xx (Debian 2.6.18.dfsg.1-12) (waldi@debian.org) (gcc versi on 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 Tue Mar 27 18:01:56 BST 2007 CPU: XScale-IXP42x Family [690541f1] revision 1 (ARMv5TE), cr=0000397f Machine: Linksys NSLU2 Memory policy: ECC disabled, Data cache writeback On node 0 totalpages: 8192 DMA zone: 8192 pages, LIFO batch:1 CPU0: D VIVT undefined 5 cache CPU0: I cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets CPU0: D cache: 32768 bytes, associativity 32, 32 byte lines, 32 sets Built 1 zonelists. Total pages: 8192 Kernel command line: console=ttyS0,115200 rtc-x1205.probe=0,0x6f noirqdebug IRQ lockup detection disabled PID hash table entries: 256 (order: 8, 1024 bytes) Console: colour dummy device 80x30 Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory: 32MB = 32MB total Memory: 25780KB available (1948K code, 496K data, 92K init)
Calibrating delay loop... 132.71 BogoMIPS (lpj=663552) ...
- hdparm -tT /dev/sda
/dev/sda: Timing cached reads: 86 MB in 2.04 seconds = 42.20 MB/sec Timing buffered disk reads: 28 MB in 3.12 seconds = 8.98 MB/sec
Tweaks
- Ok so our NSLU2 is well underclocked, let's restore its full speed following this howto
Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200)
Much better :-)
/dev/sda: Timing cached reads: 90 MB in 2.00 seconds = 44.98 MB/sec Timing buffered disk reads: 32 MB in 3.03 seconds = 10.56 MB/sec
A bit better but nothing fantastic...
- Setup static network parameters
- apt-get install resolvconf
- edit /etc/network/interfaces
allow-hotplug eth0 iface eth0 inet static address 192.168.1.77 netmask 255.255.255.0 gateway 192.168.1.1 dns-nameservers 192.168.1.2 192.168.1.1
- From /usr/share/doc/nslu2-utils/README.Debian:
- sed -i 's/^FSCKFIX=.*$/FSCKFIX=yes/' /etc/default/rcS
- sed -i 's/^BOOTLOGD_ENABLE=.*$/BOOTLOGD_ENABLE=yes/' /etc/default/bootlogd
- Reorder the booting sequence to get ssh up earlier:
ls -l /etc/rcS.d/ S21resolvconf -> ../init.d/resolvconf S22ifupdown -> ../init.d/ifupdown S23networking -> ../init.d/networking S23ssh -> ../init.d/ssh
- By default the power button restarts the slug, change the call to shutdown in /etc/inittab:
ca:12345:ctrlaltdel:/sbin/shutdown -h now
Devel
Be prepared to do some native compilation...
- apt-get install build-essential
Tuxdroid
Basics
- apt-get install subversion libusb-dev libglib2.0-dev ipython
- mkdir /home/tuxdroid; cd /home/tuxdroid
- svn co http://svn.tuxisalive.com tuxdroid-svn
- cd tuxdroid-svn/daemon/trunk
- make
- mkdir -p /opt/tuxdroid/api
- ln -s /home/tuxdroid/tuxdroid-svn/software /opt/tuxdroid/api/python
- mkdir -p /opt/tuxdroid/bin
- ln -s /home/tuxdroid/tuxdroid-svn/daemon/trunk/tuxdaemon /opt/tuxdroid/bin
- ln -s /opt/tuxdroid/bin/tuxdaemon /usr/local/bin/tuxdaemon
- echo -e "#/bin/bash\npython -i /opt/tuxdroid/api/python/tux.py" > /opt/tuxdroid/bin/tuxsh
- chmod 755 /opt/tuxdroid/bin/tuxsh
- ln -s /opt/tuxdroid/bin/tuxsh /usr/local/bin/tuxsh
Flashing tools
- cd /home/tuxdroid
- cd tuxdroid-svn/firmware/tuxup/trunk/
- make
- ln -s /home/tuxdroid/tuxdroid-svn/firmware/tuxup/trunk/tuxup /opt/tuxdroid/bin
- ln -s /opt/tuxdroid/bin/tuxup /usr/local/bin/tuxup
- wget http://belnet.dl.sourceforge.net/sourceforge/dfu-programmer/dfu-programmer-0.4.0.tar.gz
- tar xzf dfu-programmer-0.4.0.tar.gz
- cd dfu-programmer-0.4.0
- ./configure
- make
- ln -s /home/tuxdroid/dfu-programmer-0.4.0/src/dfu-programmer /usr/local/bin
- apt-get install gcc-avr avr-libc gdb-avr libsvn-dev
- wget http://svnwcrev.tigris.org/files/documents/3444/29110/svnwcrev-0.1.tar.gz
- tar -xzf svnwcrev-0.1.tar.gz
- cd svnwcrev-0.1
- sed 's/apr-0/apr-1.0/' config_mk.template > config.mk
- make
- ln -s /home/tuxdroid/svnwcrev-0.1/svnwcrev /usr/local/bin/
Audio
- apt-get install alsa-utils mpg321
- cat /proc/asound/cards
0 [Droid ]: USB-Audio - Tux Droid Kysoh Tux Droid at usb-0000:00:01.0-1, full speed
- with a more recent firmware you get:
0 [default ]: USB-Audio - TUX RF DONGLE C2ME BELGIUM TUX RF DONGLE at usb-0000:00:01.0-1, full speed
For oss layer:
- modprobe snd_pcm_oss
- modprobe snd_mixer_oss
Status
- compiling tuxdaemon OK
- running tuxdaemon FAIL
- USB part seems ok (displays tux events properly) but not TCP part, seems not to be listening on port
- compiling tuxup OK
- compiling dfu-programmer OK
- compiling svncrev OK
- compiling tuxcore tuxaudio OK
- flashing tuxcore.hex tuxcore.eep tuxaudio.hex tuxaudio.eep OK
- sound PARTLY
- ALSA and OSS-emulation layers are up
- the sound is quite hashed and lot of "alsa underrun" msgs, slightly better results through oss than alsa
- recording at 8000 Hz mono is very poor (played on host)
- playing at 8000 Hz mono is poor (recorded on host)
- madplay -b8 -R8000 ...mp3 is correct
Misc
Boot diagnostics
From /usr/share/doc/nslu2-utils/README.Debian but in case of problems I prefer to have the text here :-)
Some of the led states during boot include: - Cycling down all the leds from top to bottom: The APEX boot loader. - Amber status led: Initramfs is running, mounting root filesystem. - Disk 1 on, status slowly switching between amber and green: Root filesystem mounted, system booting. - Disk 1 on, status green, with fast double amber flashes: System is booted and running. The frequency of the amber flashes indicates the system's one minute load average; faster flashes denote higher load. - Disk 1 on, status quickly flashing between black/green and black/amber. Single user mode. Again the flash interval denotes load. - Disk 1 on, status slowly switching beteween amber and red: Shutdown in progress.
tests
apt-get install locales apache2-mpm-prefork - Traditional model for Apache HTTPD 2.1 apache2-mpm-worker - High speed threaded model for Apache HTTPD 2.1