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!





Monday, 26 March 2012

Oh for one kernel that does everything.

I am generally very happy with Centos 6.2 as an OS for the little Lenovo Ideapad. Everything seems to work, I even have a virtual machine to run FC16 running on top of it.

A net-book that is powerful enough to run virtual machines? Yep!

I also tried to make a virtual machine to try to get the Windows 7 that was the native OS originally. I sized everything down a bit but in particular made a 'Compaq diagnostics' type partition to hold the recovery copy of Winows 7 that I had previously used with great success to restore Windows to the machine after the first foray with Fedora Core 16. In the case of the 'bare metal' restore there was the magic reset button on the machine to press. I guessed that making the special partition bootable in the virtual machine would have the same effect. I tried but just got a frozen screen with not even the hint that anything was going on.

The licence that came with Windows 7 indicated that running under a virtual machine was permitted but without any practical path being apparent to remove its role as the primary OS. Oh well, looks like the only thing I will every be able to do with the copy of Windows I have paid for is to restore it to the PC when I finally come to sell it. I would hope by that time however most people will have come to realise how much better a PC is when running Linux so the need to restore a by then out of date Windows OS should not even arise.

The only gripe that I have with CentOS 6.2 is that it steadfastly refuses to work with my 3G modem stick. I have a MF112 stick from Three that works flawlessly with every version of Mint and Ubuntu I have tried and even an old Fedora 14.  The modem is seen but the connection collapses with a -110 error. Very annoying.

As a little experiment I put a Fedora Core 16 kernel onto the system as an extra boot option. It works (mostly) - in that the 3G modem works (which proves that all the NetworkManager/ModemManager userland side is good in CentOS) but the dratted Wifi does not. There are also some issues with sleep mode not working and SELinux wanting to scan the whole filesystem upon ny return to CentOS  just in case the alien kernel had been up to anything naughty! These issues may be resolveable by going further down the 'Frankenstien' route than just having alien kernel images and modules but I did not really want to end up with an unmaintainable mess!

In spite of the rough edges being able to take a kernel from a newer distribution and being able to demonstrate that particular behaviours are only to do with the kernel version - 3G working, Wifi not, means that the bugs can be reported to their respective kernel maintainers.

In both directions the bugs are annoying. As I mentioned my 3G modem works just fine in Fedora 14 which is a couple of years old now. The support code for it should have made it into CentOS 6.2 surely?

The particular WiFi hardware that the Ideapad uses not working with the latest Fedora and Ubuntu releases is even more worrying as it represents a regression failure. That is to say a feature that was working suddenly breaks just because a new release of software has come out. Regression errors make us look bad. Unless the hardware concerned is truly archaic there really is no excuse for hardware to work in one kernel release and break in the next.

Wednesday, 14 March 2012

More on the Ideapad

Ok, the saga of the Lenovo Ideapad, part 2.

I have had this rather nifty netbook for nearly a month now. I know that because the AV software is starting to bitch about the free trial running out.

Stopping the bitching is going to cost me £40 a year! That is a large proportion of what this little computer cost, and for fixing things that should not have been a problem in the first place. I will pass on that I think. It means I will not be able to ever connect Windows to the Internet again but that is a small loss. There is nothing I do on-line that Linux cannot do for me already.

You may recall that after my first experience in putting Linux on the system I admitted defeat and restored Windows again? This was just because I could not get Linux to see the WiFi. An annoying bug in that the driver seemed to be loaded but adamant that the interface was disabled.

Partly because I wanted to see if the wifi was still working I reinstalled the Windows by putting the special hidden service partition back on and pressing the special 'recovery' reset switch the Ideapad is equipped with. This rebuilt the rest of the partitions and returned the computer to the same state it first arrived in. A handy trick that if I ever want to sell the machine on to someone who cannot be convinced that Linux is a better choice.

At first the WiFi refused to work for Windows too! Then I discovered that there are two distinct ways to disable the WiFi, a slider switch which I did know about and a Fn key combo which I did not. Once I had used this keyboard combination the WiFi started working in Windows much to my relief.

This left me in the position where Windows once again had taken over the whole disk with no room for Linux. With 300GB of space this is just crazy. My previous netbook worked just fine with 16GB internal disk and a 16GB SD card so 300GB is a big step up and plenty of room to keep a small Windows partition for the occasional 'only works on Windows' job. I found that Windows now comes with a tool for partition editing so I used this to shrink the big windows partition down to just 40GB. This is where the weirdness started. The old DOS compatible partition table was laid out with a small Windows boot partition as sda1, then the big Windows partition as sda2 then an extended area as sda3, then the special hidden partition as sda4. As the area of the disk for extended partitions was only in the area of disk covered by sda3 it was not clear to me how the new freed space would be treated. Windows seems happy that it now has an extra partition but using the tool has left me in a position where Linux no longer accepts that the disk has a valid MSDOS (i.e. primary) partition table!

Booting Linux from a USB key and using the gparted tool gives more information. Some of the partitions are seen but backup copies of the table are not in the places they should be etc. Windows itself seems to work normally but using the provided repartitioning tool seems to leave the disk in a mess when it comes to introducing new resident OSes. I wonder if this is deliberate or just incompetent? Just a warning about using the Windows own tools to do resizing, you could end up with something of no use to anything but Windows!

As the main partition table is not there anymore I am not even sure that the recover to factory settings option will work without re-creating the original partition table by hand.

The WiFi support in Fedora Core 16 is a bit of a mystery still. When booting from the DVD the wireless is recognised and in use for fetching updates during the install. Changing to a console and using the lsmod command confirms the particular driver modules in use:

ath9k
mac80211
ath9k_common
ath9k_hw
cfg80211
rfkill

The odd thing is that when the installed OS is booted the WiFi stack no longer works - we are back to the 'WiFi is disabled' gripe.

I then tried a different tack. What I really need is something as close as possible to RHEL that I can carry round with me. So I tried the Centos 6.2 live DVD - it saw the WiFi first time.

By this time my months free trial of AV had just about run out so it was time to say goodbye to Windows forever and do a complete re-install. With the whole disk given over to Centos with 4GB of memory as standard it will be possible to run virtual machines to get Windows to run later I hope. Centos also has the advantage in that it stays with the Gnome 2 user interface for now. Gnome 3 may look very pretty for this tablet age but I prefer a bit of simplicity.

Centos has a big advantage in that it is binary compatible with Red Hat Enterprise Linux. All the packages are built from the same Open Source source-code that Red Hat uses. This means that although you will be a little behind the 'bleeding edge' of what is new and funky in Linux you will at least have skills that directly transfer into the workplace.

Will I miss Windows? Not at all, it turned out that the ONLY thing I was using on a regular basis was the Google Chrome browser, which is also available, and looks and works virtually the same, on Linux. Why put up with all the downsides of Windows just to be a platform underlying a browser.

Monday, 27 February 2012

Occupy Southend - getting much publicity but the message just is not getting through.

Occupy Southend are getting badly misrepresented by the media (should we have been surprised?). Labels like 'anti-captialist' (sounds a bit worrying - like they are all SWP malcontents) and 'opposing social injustice' - a bit bland, it would be hard to find someone to disagree with that as being a noble aim but as social injustice has always been with us the natural reaction of most people is why is it worth disrupting everyone with it right now?

However the very first item on the Occupy LSX Initial Statement:

The current system is unsustainable. It is undemocratic and unjust. We need alternatives; this is where we work towards them.

Occupy Southend has adopted the same statement terms with a few local variations. The fact that it starts with "The current system is unsustainable" is what groups like Transition Towns have been warning about for years. Serious problems caused by us trying to live an exponentially increasing lifestyle on a finite planet are no longer some problem for our grandchildren to solve by waving some magic wand of 'science', it is a doom we are ACCELERATING towards even though it is already in sight. 


This is a global emergency, we only have a very few years, maybe just months, to turn things around now. I am not just talking about global warming, although that will add its own problems to the mix. 

Is it that our leaders do not want widespread panic? Understandable but maybe a bit of genuine panic is what we need just now!

I do not have the solutions, as anyone with half a brain knows that there is no magic bullet for this. Turning round a global economy to be sustainable is going to take a massive effort of will and of self control.


I must admit though that it is driving me crazy that I can at least see the road we have to go down to find any chance of survival.

1. Get world leaders to come clean to their people that living on a finite world that is near running on empty for some resources is a genuine predicament.

2. Get a 'wartime spirit' of co-operation to find solutions to this, but WITHOUT finding someone to go to War against (like Iran) - we all live on this earth together, we are all in this together. A resource consuming war is what will seal our doom in double quick time!

3. Recognise that vested interests that stand in the way of this - within the '1%' need to be stripped of their power. We cannot have the salvation of the human race conducted as a 'for profit' activity. It is too urgent for all the attendant bickering.

I for one think the survival of the human race justifies slightly inconveniencing a few churchgoers!


Don't fancy this road? Ok, the most likely alternative is a series of ever more desperate wars as the increasing population fights to survive. As blowing stuff up and then building more of it at great expense will divert resources away from e.g. massive scale solar power deployment it spells DOOM for almost all of us.

Not interested in these? Want things to stay as they are, come on don't fool yourself you know things are just not going to go back to the way they were 10 years ago. Self delusion is very dangerous.

Friday, 17 February 2012

Anon Flags For Sale

After the great reception the Anonymous flags that I imported from the states had at the recent Stop the War and Stop ACTA demonstrations I have decided to make it easier for other people in the UK and EU to get hold of these by setting up as a reseller.

I was very pleased to find that the anonflag.com and anonflag.co.uk domain names were available so they are now in service letting people buy the flags that will look so good at your protest.

Current flags are available in Hand waving size 15" by 12", Standard (5ft by 3ft) and Huge (8ft by 5ft). They come without poles (as these are easier to find locally then get through the post!).

My Love/Hate relationship with a Lenovo Ideapad S205

This was a bit of an impulse buy. I was out shopping and noticed in
Dixons, beside the usual netbooks with their crippled Windows 7
'Starter' edition and deliberately crippling measly 1GB of memory was
this slightly larger machine physically but with a much better spec.
AMD Vision APU, 4GB memory instead of just 1 and a 320GB disk.
Promised battery life was over 5 hours. All this for only an extra £30
over the netbook price thanks to a 'Huge' sale discount.

I have been after another netbook for a while as I lent my trusty Dell
Inspiron 910 to my daughter. I wanted something with the processing
power and disk storage to let me do Livestreaming as has been
popularised by the Occupy movement. My big laptop with a barley 3
hours battery life at best would have been a bit bulky for this.

I got the Ideapad just a couple of days before the 11th Feb Stop ACTA
so there was no time to replace Windows with Linux for that. With the
help of the Occupy LSX tech team I managed to get livestreaming set up
under Windows. By the time it was working however I realised that
running an external USB camera and a 3G dongle also soaks up battery
life! I was down to 45mins of power before the march had even started!

I thought I had a solution to this in that I had noticed in the local
Maplins to St. Pauls that they have a rather natty 12v lead battery
and 200w mains inverter package for under £50. About the size and
shape as a yellow plastic lunch box but MUCH heavier!

The power pack seemed to have some charge in it so I loaded it into my backpack and started off the march from St. Pauls to Trafalgar Square with operational (and watched) livestream feed.

The problem was that the initial charge in the power pack was not that great so by the time I reached the square the power had drained. I then found from the instructions that a full initial charge is about 26 hours.

It will come in handy for next time. There are lighter and higher capacity solutions for just powering phones and netbooks for extended periods. The key Livestreamers in the states use them, but the disadvantage is that they are very expensive. The simple lead acid battery can power your laptop for another 3 hours or so which should be enough. If you are a glutton for weight carrying it is possible to attach a bigger external battery to the inverter too.

Although it was a novelty to use Windows (this is my first Win7 machine) I did not want it to be the ONLY OS on there.

320GB disk! I thought there would be plenty of space to put several choices of Linux distro on there. However when I booted Linux from a USB disk to do some initial compatibility testing I found that the partition table had been laid out with NO spare space!

sda1 is win boot partition 200M 29M used NTFS
sda2 is win main partition 22G used 233G free NTFS
sda3 is an extended partition containing sda5
sda5 is LENOVO 29G 1.3G used 28G free NTFS
sda4 is LENOVO_PART 15G 8.3G used 6.4G free NTFS - looks like recovery
copy of Windows OS, compressed.

85% wasted space on boot partition
95% wasted space on a whole partition just used for Lenovo specific
drivers and other gunk.

The sda4 partition is a special recovery one. If a special recessed button on the Ideapad keyboard is pressed this is the means by which a trashed copy of Windows can be rebuilt.

Looks like Windows was doing the equivalent of stretching out all over the couch to stop someone else sitting down.

As I was already running Linux from a nice big USB disk my first task was to save compressed images of these partitions so that I could reset things if things did not go to plan.

I used dd piped to gzip for each one with 4k block size onto usb  external disk. This took quite a while but left me reasonably confident that I could get thing back again if my experiments with Linux caused data loss.

The next thing I tried was a Fedora Core 16 install. I attempted to shrink the main windows partition but doing this gave a runtime error, not good. What was worse was that booting Windows again pronounced the installation unfixable. If I had not taken those initial backups I would have been one unhappy bunny at this point!

As there was nothing left to loose I did a whole disk install if FC16. This worked well, much nicer than Windows but with a couple of issues. I could not get the WiFi  working! This was a bit of a shock for a  Lenovo product as I am used to the Thinkpad range generally being rock solid, no hassles, performers with Linux. The Ideapad Wifi is one of those 'it nearly works' issues for which there is more than one solution offered on the web. I tried them all but never actually got a
working connection. The other thing not working at all is the SD card slot. For this I could not even find any solutions! This is a great  shame as on my previous two netbooks I have been used to the luxury of being able to install the OS to SD cards and thus return to the care-free time of the floppy disk by being able to swap between whole personalities just by swapping out a small piece of plastic!

The issues were bugging me so much I decided to use my backups and return the machine to the servitude of running Windows. For some reason a direct byte for byte recopying of the boot and main partitions did not give me a bootable system. I can only imagine I had missed some small but vital bit of copy protection. Luckily the restored recovery partition worked as the handbook said it did.

Pressing the special button with a pen enabled me to get back to the state of the system as delivered.

Hardly ideal, because of being bogged down with Anti Virus vigilance  needs, but I then tried the Windows version of the VirtualBox VM system that is standard on Ubuntu. It is an easy download for Windows and I soon had a virtual box version of FC16 running under Windows 7. There were a couple of problems though. Firstly I was stuck with a 1024x768 sized screen and secondly the video performance was dire. The FC16 virtual machine could not even play Youtube videos without staggering. I have the same VirtualBox software running on my Linux desktop and client systems there have no problem playing Youtube movies.

At the moment I am concluding that this is all due to the runtime weight of having to run Anti Virus.

I do need to keep some Windows capability for occasional use but I still need to find a way of shrinking the main partition reliably. The default scheme Lenovo has chosen for this machine is very wasteful.

I called this a love/hate relationship.

On the plus side I think the machine is good value for £280. It is light with a great keyboard and reasonable battery life.

On the minus side Lenovo REALLY SHOULD make sure that all their range work properly with Linux, otherwise they are throwing away all the years of good name of years of the IBM then Lenovo Thinkpad.

This was an impulse buy on the strength of the brand name. I have learned to always do research into a particular machine I am buying.

Every PC buyer should insist 100% on proper Linux compatibility. Otherwise you are just getting an appliance, not a true general purpose computer.


The usb external disk with PC LinuxOS on it that I used to do the backups seems to boot faster than Win7 too! So installing Linuxes to usb and running them there is always an option, just not as tidy. Just a shame about that SD card not being standard. A 32GB SD card for main OS work and the big disk spun up only for playing media etc would be ideal.

Wednesday, 8 February 2012

The bigger battle - the war on general computation.

I think ACTA is just a small part of something bigger. The Internet was developed not as a money making exercise by a mega corporation, but by lots of academics and small companies who saw the value in easy instant communication and sharing of knowledge. The general purpose computer is at the heart of this and over the life of the Internet has gone from something that cost as much as a house, to being affordable by just about everyone.

The thing about a computer as opposed to a toaster or a games console is that you the owner can decide what it does. This power is under threat. Microsoft wants the next generation of computers and tablets to run Windows 8 to be designed to make it impossible to run anything else (all in the name of security of course)! This makes your computer just a different sort of 'XBox' and you are only allowed to run what the corporate masters approve on it, unless you commit a criminal act and crack it of course.

This is another thing that the public needs to rise up and say NO WAY to.

Keep your right to a general purpose computer where you can run the software, including the most fundamental level, the Operating System. There are many different variants of Linux that you can choose, all have been developed by people like you who care about freedom. Find one that suits you and move off Windows now. Find a local Linux User Group and join it. Join FLOSSUK - the organisation that promotes Free, Libre and Open Source Software at the national level. http://www.flossuk.org/

Here is a video by Cory Doctorow that explains the attack on general purpose computing in more detail.





The fight is not over even if we send ACTA packing.