Friday, 20 April 2012

Finding a use for my Dreamplug

About a year ago I bought a natty little ARM based system the Dreamplug from NewIT. You can still get them in fact so this is not a story about crusty old technology at all.

A contract and other projects came along and the Dreamplug sadly gathered dust on the shelf for many months.

What reminded me of my purchase was all the mania about the Raspberry Pi which is a very similar and even cheaper computer to the Dreamplug. Several of my friends in the Chelmer Linux & Android Users Group have the Raspberry Pi on order so I feel it would be useful for me to get familiar with ARM based Linux again.

As I am resting between jobs at the moment I thought I may as well pass the time trying to do something specific and useful with the Dreamplug.

I am on Virgin Internet here and although I am pleased with the service most of the time the router I was provided with has an annoying habit of locking up and needing to be reset every week or so. I got them to replace it and the new one has the same vice so maybe the problem lies deeper? As the router is not something I am allowed to poke around in side my options beyond 'turning it off and on again' were a bit limited.

The Dreamplug has two Gigabit Ethernet ports and with the Ubuntu OS that comes with it also supports operation as a wireless AP and bluetooth too. As my Internet is only a 30mbit service it seemed wasteful to use one of the Gigabit ports for that so I have decided to use a USB to ethernet adaptor that I happened to have lying about - a MosChip MCS7830 for the external connection. This frees the two gigabit ports up for connecting the living room PC (as that is where the TV company cable modem has to be situated) and the wiring going to the office.

I spent a few years in the past working for Smoothwall so I am after something that is similar to their Smoothwall Express product, which as yet is only available for Intel technology PCs, not ARM.

What Smoothwall Express provides is a firewall that runs on an old PC that provides the following extra features:
  • Simple IPSEC VPN
  • Traffic shaping
  • Dhcp server for local network
  • Web proxy
  • lot of other stuff
  • All with a web UI.
I ran a real Smoothwall in the past on an old Celeron based PC. However with electricity costs going up every year it would be cool for something that uses a tiny fraction of that power to be made to do the same job.

Going the whole way to an ARM based Smoothwall would be a big undertaking but I can at least do some of the preparatory work to allow such a thing to be made on a Dreamplug, or perhaps even more interesting, on a Raspberry Pi.

The Raspberry Pi is very cheap, but use as a firewall would require it to use two ethernet interfaces so would need a USB to ethernet adaptor. The ethernet onboard is already apparently provided via the USB bus so adding a second one would not be that hard. I do not yet have any Pi hardware so I am going to concentrate on getting this working on the Dreamplug first.

Please treat these blog posts as a work in progress, not as a finished 'howto', a lot of it is just me thinking out loud about what is needed to get from Point A to Point B.

Day 1

As the Ubuntu that comes in the Dreamplug is rather old (a customised version of 9.10 Jaunty Jackalope) My fist step in this was to take advantage of the Debian Squeeze SD card images that are available for download from the NewIT website. Although I had an 8GB SD card I found that when uncompressed the 8GB SD card image was too big. I followed the advice of others and used the 4GB image instead. This seemed to work just fine and I created another partition for /home on the rest of the card. At the moment you cant seem to just boot ARM systems from a CD and build from there. The collection of assumed hardware that makes up a PC just cannot be assumed. The Linux cannot be 'installed' as such on the target system, it has to 'pre exist' The way to do this is take a compressed image and using another bigger Linux system extract it onto the SD card. The end result of this is a ready to go SD card with partition table in place and everything in a default primordial state.

The root password for the standard NewIT Debian images is nosoup4u, so the first thing to do is change it to something else! There is no security problem with me relaying the default password to you at this stage is that the standard image does not even have sshd installed (so you cannot log into it over the network anyway). After changing the root password then you can update the what now will be rather old packages and then install sshd.

The basic command line tools will have to be used to do this:

apt-get update - to update the repository data.
apt-cache search sshd - to tell us what the packages related to ssh would be called.

apt-get install openssh-server - to install it.

Reboot the system and observe the dhcp granted IP address as your Dreamplug comes back up and you will be able to start connecting over the network rather than via the jtag serial console.

The next thing I did was apt-get install synaptic - to get the more familiar GUI tool for package selection.

This brings in a lot of other dependencies so in one operation brings the very skeleton initial disk image up to a much more complete spec. I also added samba and the tomcat web server (something I want to learn about and an ARM system should be fine with running Java - just look at all those Android phones!) at this stage. Disk use still only  under 1G so plenty of free space on the 8G SD card.

One big disadvantage of SD cards is that their write speed is still quite slow. Installing a large number of packages can take a LOT longer than on a bigger disk based system. Be patient and go get a drink or two! The Dreamplug has an Esata port though! Once I have the basics working I have a 2TB Esata disk to add as some NAS disk storage. However making sure the basic system all works in the confines of an SD card is good discipline, even though it can sometimes be slow.

After installing this first tranche of packages I did a reboot to confirm that the system still comes up cleanly. A good tip is that at regular checkpoints e.g. a day of working on it, it is a good idea to take a compressed disk image checkpoint of the SD card from your ARM system in a bigger machine. Writing SD cards takes a while, but reading one to back it up should be nice and quick and redoing an image of where you had got to yesterday is a lot better than retracing all the steps!

The set of goals tomorrow (or whenever I get the time to play with this) are as follows:

  1. The USB to ethernet adapter I had is seen by lsusb but NOT automatically recognised as an ethernet port - I need to find out how to bridge this gap.
  2. The WiFi that works under the Jaunty Jackalope image does not seem to be detected by default in the Debian image. This needs to be sorted if I want to use my wireless devices on the Internet anymore.
  3. Get a Smoothwall build environment set up and look into turning it into a cross compiler for ARM - so that the full suite of tools can be built for ARM not Intel. This will probably take much more than a day!
  4. Learn a lot about Debian as it exists without all the flashy Ubuntu GUI!





No comments:

Post a Comment