Debian Squeeze on a Soekris Box
(The Easy Way!)

The Easy Option: Use My Pre-made Debian Squeeze Image

I know some people won't want to use another person's OS image, but this is a stock Debian Squeeze Net Install.  The differences are elaborated at the end of this file.

If you have a Soekris box and don't want to mess with serial cables and connections, and would rather just plug it into the network, then be able to ssh to it and complete the setup that way, then this is perfect for you.  While this is designed to work with putting the OS on a compact flash (CF) card, it should work with a hard drive, too.  The only issue is that you may not have an easy way to hook your hard drive up to another computer to format and put an image on it.

You can download a zip file here that contains:
  1. The Debian SqueezeOS image in a .tgz file
  2. A Perl script, squeeze-on-soekris, that can help you format a CF card, copy the OS files to that card and it will make the needed configuration changes for the new drive.  (Both GRUB and /etc/fstab now use UUIDs a lot to specify drives, so those must be changed with each new drive.)
  3. The passwords for the one user (soekris) and root.  (I didn't want to post these on the web directly.)
  4. The script sysfind that will help you locate the Soekris box on your LAN when it's first set up and you don't know it's IP address.
  5. A copy of this file

If you want to use this, then do this:

  1. Download from here.
  2. Unpack archive into a directory.  (For reference, we'll call that directory /SonS/.)
  3. From the command line, su to root and cd to /SonS/.
  4. Make sure your CF card is in a card reader and you know which device the card is (as in /dev/sdb, /dev/sdc, or any other).  Also, you will need to know (if you're formatting the CF card), how big (in megabytes), you want the system partition to be.
  5. Run the program with "./squeeze-on-soekris" and answer the questions.
  6. Remove the CF card (it's been unmountd when squeeze-on-soekris finished with it), and put it in the Soekris box.
  7. Boot the Soekris box and wait until it's had time to get up and running (probably 30 seconds or so)
  8. Run /SonS/bin/sysfind and it'll tell you the IP address of the system you just installed (it will ask you for the host name).
  9. You can now ssh in, using the username soekris, to this system.  (Remember, the passwords are in the accompanying file Squeeze-On-Soekris-passwords.  They are not listed here so they will not end up on the web -- just in case.)  You can now set up your system and modify it to your needs.

While you can use command line arguments to squeeze-on-soekris (use "--help" to see them), it's easier to just run it and let it walk you through the process and ask you for the information it needs.

This program is not a partion program or file management or formatting program.  It's designed to do one thing: Create a Debian Squeeze image on a CF card that can be put in a Soekris box and booted so you can complete the setup by ssh, without having to work with the serial cable or PXE Linux.

It creates one partition on the CF card in the size you specify and uses the leftover space as a swap partition.  If you want to use more partitions on the CF card (or hard drive), you can partition and format them ahead of time.  In that case, when squeeze-on-soekris is run, it'll ask you which partition the OS image is to go on and won't do any partitioning or formatting.

This program is in Perl and easily modified if you want to make changes along the way, such as keping it from modifying some of the files it alters after the OS image is copied on the CF card.  (You can also mount the newly created OS image partition and edit files as you desire.)

Once you get it working, you can log in with SSH using the included passwords.  Remember, CHANGE YOUR PASSWORDS, both for root and for the user soekris.  It's probably better to delete that user all together and replace it with your own user.  I left that account in because I disabled root login for SSH for security.  I also suggest running dpkg-reconfigure openssh-server after booting that first time so your rsa keys for ssh are unique.  If you use the program "firstboot" in /root after you've installed the image on your Soekris box, that will take care of reconfiguring ssh, exim4, and GRUB.

This install of Debian Squeeze is a base install without anything extra (other than resolvconf and xinetd), but it's enough that it can make things easier for you by letting you install the image and get going with your Soekris box without having to both with serial cables.

System Locater

There is one last point: Once you've installed this, and you want to use ssh to connect to your Soekris box, you're left with one question: What's the IP of my new system?  I've installed xinetd and added one service, syslocate, to the box.  It'll respond to the proper query by sending back the IP address of the Soekris box.

Here's how it works: Run sysfinder on your workstation.  It asks for the hostname of the system you're looking for.  Enter the host name you gave your Soekris box.  The returned reply will be the IP address of that system.  You may have to run sysfinder as root.  I've heard on some systems you need root permissions to do a UDP broadcast, which is required to find the new system.  If it takes longer than 5 seconds or so to get a response, or you get what looks like gibberish, then there are communication issues or you're using the wrong hostname.

Once the system is set up, it's quite possible you may want to remove the System Locater.  That takes 3 changes: 1) Remove the file /etc/xinetd.d/syslocater.  2) In /etc/services, remove the two lines referring to port 7071.  3) Remove the file /opt/bin/syslocater.
UUID Issues

A note on UUIDs: Debian (and Ubuntu, from what I saw a few years ago) uses UUIDs to specify drives now.  That's in both /etc/fstab and in config files for GRUB.  That's fine, for most cases, but here we are moving the OS image from one drive to another, so the UUIDs have to be replace or drives need to be referenced by device, such as /dev/sda1.  These images are booting perfectly for me with the changes I've made, but it's still possible some UUID issues might show up along the way.

Differences Between this and a Minimal Net Install of Squeeze

These differences are in the original image, contained in the tarball, and can be undone by uninstalling the related packages:

  1. The resolvconf package has been added, to make sure /etc/resolv.conf will keep up with whatever network it is put on.
  2. The xinetd package has been added, to allow for the syslocate program to work to make it easy to find this computer on your LAN when the Debian image is first installed.

These changes are made by the squeeze-on-soekris script.  Some can be bypassed by command line options.  (Of course all can be bypassed by editing the script source code.)  Several of these involve UUIDs.  With the trend toward specifying devices by UUID, it means more changes have to be made to move an OS image from one device to another.

  1. Root login in ssh is disabled for security (in case someone forgets it later and wants to blame me).
  2. /etc/defaults/grub has been modified to specify the root drive by device and not UUID.  (Just put the has mark back in the line that addresses this and it'll be back to what it was.)  The console speed has also been set to the default (for Soekris) speed of 19200.
  3. The original /etc/fstab is modified to specify /dev/sda1 as the boot and main mount and /dev/sda2 as a swap drive.  If you are using more partitions, once the OS image is created on the CF card, you will have to modify this file.  (Remember, when editing, you are editing /<yourmountpoint>/etc/fstab, NOT your system's /etc/fstab!)
  4. My syslocate program (/opt/bin/syslocate) has been copied over and /etc/services has had one line added on to the end to specify port 7071 as providing the syslocate service.  /etc/xinetd.d/syslocate has been added to define the service for xinetd.  This will allow you to use the sysfind program (included in the archive) to find the IP address of this system so you can log in with ssh after it is booted.

Download Here
The full tarball for this is here.


Click here for Hal's blog.