view · edit · print · history

OpenSlug 2.5

OpenSlug 2.5 is designed to be run from an external hard drive or flash stick. Initially, after the firmware flash, the unit will restart and boot from the JFFS2 partition. Currently, the static IP information in the Linksys system configuration partition is used to setup the DHCP/Static IP configuration, the Domain and the hardware MAC address.

After reflashing to the OpenSlug 2.5 I was not able to SSH in to the slug. The network parameters were set up properly before the box was flashed from Linksys firmware to the OpenSlug (using the Linksys web interface) !!Remember, NSLU2 keeps its network settings even it is reflashed with another firmware !! I was trying to SSH on the home local network where DHCP server is connected as well.

I have found it is necessary to disconnect DHCP server from the network. Then reboot NSLU2 and from an other machine connect to the NSLU2 via SSH. Then run 'turnup init' and change the boot protocol from 'dhcp' to 'static' (see below).

> login as: root
> root@'s password:
> Host name: slug
> Host ID: 00:0F:66:87:CD:E3
> Network boot method: dhcp
> Use 'turnup init' to reset the configuration
> Use 'turnup disk|nfs -i <device> options to initialise a non-flash
> root > Use 'turnup help' for more information
> root@slug:~# turnup init
> .
> .
> .
> Boot protocol (dhcp|static) [static]: static

After that it is possible to connect DHCP server back to the network and reboot NSLU2. Now it is possible to SSH on to the static IP address which you have set at the beginning.

N.B. When OpenSlug boots only portmapper and dropbear are running. Be sure to be familiar with ssh'ing into the box. Test this before loading OpenSlug firmware.

Note: The Disk1 and Disk2 LEDs are not driven when devices are present or removed. Just be aware of this state of affairs.

[beewoolie] BTW, the default root password is opeNSLUg.

Running from hard drive

Note: Only boot to the sda right now. Make sure that's in USB port 1. We will be working out a procedure for proper recognition of multiple drives shortly. Currently, only 1 drive plugged into USB port 1 will be device sda. If one added a drive at a later time to USB port 2, that device would likely turn into sdb. So, stick with sda in USB port 1 for right now.

The example below shows running from sda1 as the root partition. Users with data on sda1 (UNSLUNG users) will want to use sda2 (or sdb2). N.B. You will lose all your UNSLUNG system files and configuration data. Please backup that partition and save it away 'BEFORE' trying to use OpenSlug. Or use a virgin hd. This example assumes the drive is formatted ext3 and clean.

 #Mount the drive on sda1 or sda2
 #Clear it off

 mount -t ext3 /dev/sda1 /media/hdd
 cd / ; find . -print0 -mount | cpio -p -0 -d -m -u /media/hdd
 rm -rf /media/hdd/dev
 find /dev -print0 | cpio -p -0 -d -m -u /media/hdd
 touch /.sda1root
 # vi /media/hdd/etc/fstab and add a swap partition you are using one.
 umount /media/hdd
 shutdown -r now

[beewoolie] You can simplify the transition to the hard drive a little bit. I made the swap creation steps more explicit and I assume you've already partitioned the drive into sda1 for / and sda2 for swap. I found that performing the mkswap with the drive connected to my notebook computer initialized swap in a way that is not compatible with the openslug kernel.

  # mkswap /dev/sda2
  # mount -t ext3 /dev/sda1 /media/hdd
  # rm -rf /media/hdd/dev
  # find / /dev/ -print0 -xdev | cpio -p -mud0 /media/hdd
  # echo /dev/sda2 swap swap defaults 0 0 >> /media/hdd/etc/fstab
  # touch /.sda1root
  # umount /media/hdd
  # reboot

[Takai] After following the steps from beewoolie i also had to run the following commands:

  # turnup disk /dev/sda1
  # reboot

Running from NFS

 Export the root directory from your server
 Change the mount line in the script above to mount your empty root.
 mount /media/net

 Run the script.
 edit /.nfsroot on the slug.

 This was added 2/27/2005.
 Switchbox doesn't handle the nfs connection properly.
 I added some patches to .nfsroot to temporarily fix them.
 Here is the file until fixes are completed.
 Substitute your server information.

 /usr/bin/killall portmap
 /sbin/insmod sunrpc
 /sbin/insmod lockd
 /sbin/insmod nfs
 /sbin/ifconfig eth0 up $ipaddr netmask $netmask

Reboot, and you should be running on an NFS root.

Running from Flash Stick

The turnup script has direct support for this (as of 2.7beta), you just need to do something like this:

  $ fdisk /dev/sdX               # where X is the flash stick device number
    [verify the partitions look like you want, or change them]
    [DOS partitions do not seem to work, even though the scripts apparently run ok and you can mount the 
    file system and view the files.  You seem to have to delete the partition and re-create it as a linux partition 
using fdisk to persuade the system to boot off it.]

  $ mkfs.ext3 /dev/sdXN          # format the flash stick, N is the partition you want to use
  $ turnup memstick -i /dev/sdXN -t ext3  # copy the filesystem and set the bootloader to use it

Note that if you're doing this by hand instead of using the turnup script you'll want to make sure to use the noatime mount option to prevent system from doing a write every time something is read (flash parts can only sustain a fixed amount of writes, ~10k-100k).

view · edit · print · history · Last edited by Takai.
Based on work by TheAnarcat, Paul, G Jones, simson, Zhyla, petr at tpc dot cz, blaster8, tman, cyphaetus, beewoolie, repvik, jstueve, dyoung, g2, glc, and VoodooZ.
Originally by g2.
Page last modified on May 12, 2008, at 09:07 AM