NSLU2-Linux
view · edit · print · history

OpenWrt Kamikaze supports the NSLU2. See the KnownProblems page for known problems with the Kamikaze 7.07 release.

You can either build kamikaze or download the kamikaze-7.07 image from http://www.slug-firmware.net. Installation is the same in both cases.

From the HomePage, "The OpenWrt Kamikaze 7.09 release of firmware is in beta testing. A binary firmware download can be found at http://www.slug-firmware.net. Please report beta testing results to the nslu2-linux mailing list."

To build, follow the OpenWrt BuildInstructions for the Intel XScale IXP4xx [2.6] target system (you can use the "Image configuration" section to set up your initial network configuration), and then flash the openwrt-nslu2-2.6-squashfs.bin 8MB image in the normal way. You can also use the "make openwrt-image" target in the Master Makefile.

After installation, OpenWrt will take a few minutes to initialize the JFFS2 partition. It took about five minutes for me. You should wait at least ten minutes before rebooting. It will have an IP address of 192.168.1.77 to which you need to telnet to get access for the first time.

There is some good documentation at http://nbd.name/openwrt.html. See also the OpenWrt wiki entry for the NSLU2 at OpenWrt wiki, which contains more information.

Here is the BootLog (Kamikaze 7.06).

For assistance, look in the #nslu2-linux (for nslu2-specific installation problems, be aware there will be very few openwrt users in this channel) or #openwrt (for general OpenWrt questions - this is where all the openwrt users hang out) IRC channels on Freenode.

A tip flashing the Kamikaze 7.09 binary firmware:

  • DHCP is enabled by default, (this was learned after what appeared several failed attempts to first connect to the NSLU2 at IP address of 192.168.1.77 which had been set using the stock Linksys firmware)

Other notes and references for Openwrt/NSLU2 Kamikaze 7.09:

Some user tips!

  • By default, the slug uses 192.168.1.77 as the IP address, but you can change that in the network configuration when building. (true for pre-7.09 releases only?)
  • By default, both telnet and ssh are installed, but only telnet is enabled. To enable ssh and disable telnet (a very good choice, security-wise), telnet to the slug and then use the 'passwd' command to change your root password. The rest seems to be automatic.
  • To change the banner that displays when you log in, edit /etc/banner
  • ipkg.sh is not in the webif/web directory so you have to login to a terminal to update/install packages.
  • Binary: Mounting is a little off standard, kernel will mount sda1 as ext2 to /mnt/usbdrive. Other partitions can be mounted by creating /etc/fstab and a script (http://www.pug.org/index.php/OpenWRT - Automount for example) that executes it - but does a "sleep 5" (or so) before, so usb wil be available. I consider this pretty dirty, so replace with a better way, if known.

Adding Optware packages to OpenWrt

Optware packages use their own ipkg-opt packaging system that is independent of firmware. This also means that when upgrading OpenWrt theb Optware package list is not erased as it is stored in the /opt partition where also all Optware packages are installed.

For USB disk preparation one must first prepare disk partitions with

ipkg update
ipkg install e2fsprogs cfdisk fdisk swap-utils

Partitioning disk into /opt swap and /home partition can be done with cfdisk /dev/sda or fdisk /dev/sda. Allocate at least 2GB for /opt and 512MB for swap (AdamB - 512MB seems excessive, I stuck to the unslung size of 120MB).

Prepare partitions:

root@OpenWrt:/# mkswap /dev/sda2
root@OpenWrt:/# mke2fs -j /dev/sda1
root@OpenWrt:/# swapon /dev/sda2
root@OpenWrt:/# mke2fs -j /dev/sda1

Mount partitions:

root@OpenWrt:/# mkdir /opt
root@OpenWrt:/# mount /dev/sda1 /opt/

To ensure partitions are remounted after a reboot you need to add the mount and swapon commands to a startup script, I recommend /etc/init.d/custom-user-startup until new kamikaze builds (after 7.09) supporting /etc/config/fstab are released

For initial installation of Optware package we need to install ipkg-opt package using /usr/bin/ipkg. This can be done by adding

 src optware http://ipkg.nslu2-linux.org/feeds/optware/openwrt-ixp4xx/cross/unstable

to /etc/ipkg.conf using vi editor. Then we proceed with ipkg update and ipkg install ipkg-opt. This will install required /opt/bin/ipkg-opt. I recommend removing the Optware package feed from /etc/ipkg.conf and add the same line to /opt/etc/ipkg.conf.

Some Optware packages rely on libraries that are optional OpenWRT packages. Because these come from different repositories they can't easily be configured as dependencies. Either install the OpenWRT packages libssp, libpthread and libstdc++ now or be ready to install them if something breaks.

Optware also has a few other assumptions that aren't met by OpenWRT, it assumes that users called mail and lp exist in the password file so make sure you create them before installing email or printer spooler software. Another assumption is that /etc/services contains a sensible list of ports - I copied the file from another machine.

It is recommended that default search path is extended to /opt/bin:/opt/bin:$PATH in /etc/profile before issuing /opt/etc/ipkg-opt update and installing additional Optware packages. Depending upon how you use the slug you may prefer to include /opt/bin either before or after the default path. If you install packages like coreutils which replace commands provided by OpenWRT with better ones then you probably want /opt/bin first, otherwise it is probably best if it is last. If you put it first you will need to give the full path if you need to use the openWRT version of ipkg /etc/profile line should look like

 export PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin

or

 export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin

If you install any packages that include startup scripts then you'll discover that OpenWRT doesn't call them. To fix this you need to create /etc/init.d/optware that looks like

#!/bin/sh /etc/rc.common

START=80

start() {
        echo "Starting Optware."
        [ -x /opt/etc/rc.optware ] && /opt/etc/rc.optware start
        }

stop() {
        echo "Shutting down Optware."
        [ -x /opt/etc/rc.optware ] && /opt/etc/rc.optware stop
       }

and then a file /opt/etc/rc.optware that contains

#!/bin/sh

# Start all init scripts in /opt/etc/init.d
# executing them in numerical order.
#
if [ x$1 == xstop ] ; then
        progs="/opt/etc/init.d/K??*"
        rc=stop
else
        progs="/opt/etc/init.d/S??*"
        rc=start
fi

for i in $progs ;do

        # Ignore dangling symlinks (if any).
        [ ! -f "$i" ] && continue

        echo starting $i
        case "$i" in
           *.sh)
                # Source shell script for speed.
                (
                        trap - INT QUIT TSTP
                        set $rc
                        . $i
                )
                ;;
           *)
                # No sh extension, so fork subprocess.
                $i $rc
                ;;
        esac
done

and then as for other OpenWRT services you enable it with /etc/init.d/optware enable

HowTo's for OpenWRT

view · edit · print · history · Last edited by BrianZhou.
Based on work by BrianZhou, AdamBaker, axm, fcarolo, krim, aidtwo, rwhitby, Mr Street, oleo, Ruiqiang Huang, attila, drone, unverbraucht, and xitrium.
Originally by rwhitby.
Page last modified on July 20, 2008, at 08:14 PM