Setting up Astlinux on a Soekris Net5501

Soekris net5501

The Soekris net5501 is a low power, compact computer with four ethernet ports that uses a CompactFlash card for program and data storage. With no fans, hard disk or other moving parts it should provide a reliable Asterisk platform. This page details the steps needed to perform a fresh install AstLinux on the net5501.

Installing the image on a CompactFlash module

Release downloads are available on SourceForge. I am using the astlinux-0.6.2-net5501.img.gz file for this install.

The image, when copied to a CompactFlash module will result in a 128 MB FAT16 filesystem in the first partition. When I tried this on an 8 GB CompactFlash I found that it would not boot. Apparently the old 4 GB limit still holds sway if you are using this type of filesystem. So I traded cards with my wife’s camera to get 1 GB CompactFlash card. So if you have to buy a CompactFlash card keep in mind that bigger is not always better.

I used a VMware machine running CentOS 5.2 Linux to write the CompactFlash image using a USB storage “card reader”. With my setup the CompactFlash shows up as /dev/sdb. If you are working with a Linux machine it will probably be something similar. If you are working with a Windows box see the page on installing Runnix for methods of copying the image file to the CompactFlash card. The following commands are used (user input in bold):

        [user@localhost ~]$ su
        Password:
        [root@localhost user]# gunzip -c astlinux-0.6.2-net5501.img.gz | dd of=/dev/sdb bs=16k
        8190+0 records in
        8190+0 records out
        134184960 bytes (134 MB) copied, 14.8829 seconds, 9.0 MB/s
        [root@localhost user]# exit
        exit
        [user@localhost ~]$
            

Soekris Console

We will need to access the console to complete our install and on the Soekris net5501 this means being able to attach a terminal to the serial port. The Soekris net5501 has a DB-9 male connector and is wired as a computer (DTE) with a baud rate of 19200. Assuming that you are using another computer running a terminal emulator, you need to connect two computers together. For that a "null modem" is required. In addition you may end up needing to use a gender adaptor. If you are not old enough to have the various DB-9 gender changers and null modem pieces in your tool box, you can still buy them at Radio Shack.

Setting up UnionFS

Setting up the UnionFS is explained on its own page but to make this a linear process I am including it here too.

With your serial connection setup and the CompactFlash memory installed, power up the Soekris net5501. When the system finishes booting, we will:

  1. Log in as root.
  2. Make a new partition out of the remaining space on the CompactFlash.
  3. Then setup UnionFS for access to all storage.

Again, user input is in bold. First, verify the location of the CompactFlash storage:

        pbx ~ # fdisk -l

        Disk /dev/hda: 1025 MB, 1025998848 bytes
        16 heads, 63 sectors/track, 1988 cylinders
        Units = cylinders of 1008 * 512 = 516096 bytes

           Device Boot      Start         End      Blocks  Id System
        /dev/hda1   *           1         260      131008+  6 FAT16
        pbx ~ #
            

Then use that information to access the storage and create the new partition then reboot the box. Commands will be:

  1. n New partition
  2. p Primary partition
  3. 2 Partition number
  4. Accept default starting cylinder
  5. Accept default ending cylinder
  6. w Write results to disk
        This is pbx (Linux i586 2.6.20.21-astlinux) 17:46:36
        pbx login: root
        Password:
        pbx ~ # fdisk /dev/hda

        The number of cylinders for this disk is set to 1988.
        There is nothing wrong with that, but this is larger than 1024,
        and could in certain setups cause problems with:
        1) software that runs at boot time (e.g., old versions of LILO)
        2) booting and partitioning software from other OSs
           (e.g., DOS FDISK, OS/2 FDISK)

        Command (m for help): n
        Command action
           e   extended
           p   primary partition (1-4)
        p
        Partition number (1-4): 2
        First cylinder (261-1988, default 261):
        Using default value 261
        Last cylinder or +size or +sizeM or +sizeK (261-1988, default 1988):
        Using default value 1988

        Command (m for help): w
        The partition table has been altered!

        Calling ioctl() to re-read partition table
        fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resourc
        e busy
        pbx ~ # reboot
            

Finally, setup the UnionFS and again reboot the box:

        This is pbx (Linux i586 2.6.20.21-astlinux) 17:46:36
        pbx login: root
        Password:
        pbx ~ # genunion /dev/hda2
        This script will automatically create a read/write
        filesystem to store your AstLinux configuration.
        THIS SCRIPT WILL DESTROY EVERYTHING ON /dev/hda2

        ARE YOU SURE YOU WANT TO CONTINUE?

        Please type yes to continue
        Are you sure? : yes
        Creating filesystem...
        Filesystem Created.

        On new systems you can optionally use unionfs instead of they key disk.

        To create the appropriate file structure, type yes.

        If you have an existing key disk and want to migrate your key disk
        settings to this new unionfs partition, execute movekd /dev/hda2 after
        this script exits.

        To create a new key disk structure on your new unionfs partition,
        type yes followed by the Enter key.  Press any other key to exit.

        If you are new to Astlinux, you will want to say yes.
        Are you sure? : yes
        Copying files to /dev/hda2
        Please reboot now or run movekd to migrate an existing key disk to your unionfs partition
        pbx ~ # reboot
            

Your new Soekris net5501/AstLinux box should be ready to use. If you have a ZeroConf (Apple Bonjour) aware browser and your Soekris E0 (eth0) port plugged into your network, then the box will show up as “AstLinux PBX” at “http://pbx.local./”. Or you can log into the console again and determine the IP address by using:

        pbx ~ # ip addr list
        1: lo: <LOOPBACK,UP,10000> mtu 16436 qdisc noqueue
            link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
            inet 127.0.0.1/8 scope host lo
        2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
            link/ether 00:00:24:cb:20:f0 brd ff:ff:ff:ff:ff:ff
            inet 10.7.52.159/24 brd 10.7.52.255 scope global eth0
        3: eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
            link/ether 00:00:24:cb:20:f1 brd ff:ff:ff:ff:ff:ff
        4: eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
            link/ether 00:00:24:cb:20:f2 brd ff:ff:ff:ff:ff:ff
        5: eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
            link/ether 00:00:24:cb:20:f3 brd ff:ff:ff:ff:ff:ff
            

In either case pulling up the page with HTTP will get you an empty directory listing, so use HTTPS to get to the web administration page.