Archive for the ‘Geeky’ Category

Free as in really really Free

Wednesday, December 3rd, 2008

Earlier today Jai Harrison mentioned an application called vrms, this is a virtual Richard M. Stallman and it’s function is to tell you what packages you have installed that are not completely Free software. It is a command line tool, you can install it with sudo apt-get install vrms, or through Synaptic if you like. After installing just type vrms at a command line and you should get results like this:

alan@webbook:~$ vrms
Non-free packages installed on webbook

fglrx-modaliases          Identifiers supported by the ATI graphics driver
human-icon-theme          Human Icon theme
linux-generic             Complete Generic Linux kernel
linux-restricted-modules- Non-free Linux 2.6.27 modules helper script
linux-restricted-modules- Restricted Linux modules for generic kernels
nvidia-173-modaliases     Modaliases for the NVIDIA binary X.Org driver
nvidia-177-modaliases     Modaliases for the NVIDIA binary X.Org driver
nvidia-71-modaliases      Modaliases for the NVIDIA binary X.Org driver
nvidia-96-modaliases      Modaliases for the NVIDIA binary X.Org driver
tangerine-icon-theme      Tangerine Icon theme

Contrib packages installed on webbook

flashplugin-nonfree       Adobe Flash Player plugin installer
nvidia-common             Find obsolete NVIDIA drivers

10 non-free packages, 0.7% of 1345 installed packages.
2 contrib packages, 0.1% of 1345 installed packages.

so that is a bunch of things for the nvidia and ATI graphics cards which we don’t need, flash which I can live without for a few minutes, plus some icons and some scary looking kernel bits and bobs. including the two packages with truncated names starting linux-restricted-modules-, lets find out what their real names are by looking at the vrms manual

alan@webbook:~$ man vrms

it turns out that there is a –sparse option to vrms which just prints the package names, lets give that a go

alan@webbook:~$ vrms --sparse
fglrx-modaliases
human-icon-theme
linux-generic
linux-restricted-modules-common
linux-restricted-modules-generic
nvidia-173-modaliases
nvidia-177-modaliases
nvidia-71-modaliases
nvidia-96-modaliases
tangerine-icon-theme

flashplugin-nonfree
nvidia-common

OK, so it was linux-restricted-modules-common and linux-restricted-modules-generic. Now lets strip things out using apt-get remove –purge which is the equivalent to selecting “mark for complete removal” against each package in Synaptic, it gets rid of any configuration files that might be left hanging about.

alan@webbook:~$ sudo apt-get remove --purge fglrx-modaliases human-icon-theme linux-generic linux-restricted-modules-common linux-restricted-modules-generic nvidia-173-modaliases nvidia-177-modaliases nvidia-71-modaliases nvidia-96-modaliases tangerine-icon-theme flashplugin-nonfree nvidia-common
[sudo] password for alan:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-2.6.27-7 linux-headers-2.6.27-7-generic binutils-static hsolink
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED
fglrx-modaliases* flashplugin-nonfree* human-icon-theme* human-theme* linux-generic*
linux-restricted-modules-2.6.27-7-generic* linux-restricted-modules-2.6.27-9-generic* linux-restricted-modules-common*
linux-restricted-modules-generic* nvidia-173-modaliases* nvidia-177-modaliases* nvidia-71-modaliases*
nvidia-96-modaliases* nvidia-common* tangerine-icon-theme* ubuntu-artwork* ubuntu-desktop*
0 upgraded, 0 newly installed, 17 to remove and 0 not upgraded.
After this operation, 13.4MB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 150075 files and directories currently installed.)
Removing fglrx-modaliases ...
Removing flashplugin-nonfree ...
Purging configuration files for flashplugin-nonfree ...
Removing ubuntu-desktop ...
Removing ubuntu-artwork ...
Purging configuration files for ubuntu-artwork ...
Removing human-theme ...
Removing human-icon-theme ...
Purging configuration files for human-icon-theme ...
Removing linux-generic ...
Removing linux-restricted-modules-2.6.27-7-generic ...
update-initramfs: Generating /boot/initrd.img-2.6.27-7-generic
Purging configuration files for linux-restricted-modules-2.6.27-7-generic ...
Removing linux-restricted-modules-generic ...
Removing linux-restricted-modules-2.6.27-9-generic ...
update-initramfs: Generating /boot/initrd.img-2.6.27-9-generic
Purging configuration files for linux-restricted-modules-2.6.27-9-generic ...
Removing linux-restricted-modules-common ...
Purging configuration files for linux-restricted-modules-common ...
Removing nvidia-common ...
Purging configuration files for nvidia-common ...
Removing nvidia-173-modaliases ...
Removing nvidia-177-modaliases ...
Removing nvidia-71-modaliases ...
Removing nvidia-96-modaliases ...
Removing tangerine-icon-theme ...
Purging configuration files for tangerine-icon-theme ...

so now lets see what vrms thinks of my webbook

alan@webbook:~$ vrms

No non-free or contrib packages installed on webbook!  rms would be proud.

Excellent, and it even boots up still!
Now I am going to spoil it all by putting Flash back on.

It is worth noting that this might not fully meet the standards of the real rms, and there are projects like gNewSense which try a lot harder to get to pure Software Freedom than I can be bothered to do. I had the simple objective of getting to an empty vrms output starting from a standard Intrepid desktop install and it turned out to be easier than I expected.

The USB Recovery in detail

Thursday, November 6th, 2008

So the USB “nuke my webbook” restore process is quite handy but it is always nice to know how things work so here goes. . .

The USB stick is FAT formatted and has the syslinux bootloader on the master boot record, on the filesystem are the following files

ldlinux.sys something to do with the syslinux bootloader

isolinux.bin something to do with the syslinux bootloader

kernel this is the linux kernel that the bootloader starts

initrd.gz this is the initial ram disk, the filesystem that contains all the partimage programs and everything the kernel needs to run

syslinux.cfg the configuration file for the bootloader with some important parameters that get passed through to partimage

there is a folder containing the full backed up image of the webbook

bios this contains backed up bios settings, I am not sure this actually works or does anything useful. In theory it might be possible to reset the boot sequence back to boot from the hard drive.

hda this contains the very first bit of the drive, the master boot record and partition table

hda1.first_sectors this contains the start of partition 1

hda2.first_sectors partition 2 just exists to contain the extended partition

hda5.first_sectors partition 5 is the swap partition, we only need to recover the first sectors with the partition information, the contents don’t matter.

hda1.000 this is the biggie a Gzipped partition image of the contents of partition 1.

Making a restore

To turn the Intrepid USB stick into a backup of whatever is on your webbook you need to edit the syslinux.cfg

DEFAULT rescue
LABEL rescue
KERNEL kernel
APPEND vga=normal devfs=nomount pxe ramdisk_size=33000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0 initrd=initrd.gz root=/dev/ram0 rw noapic lba After_Completion=Shutdown Replace_BIOS=N AUTO=Y Server=/dev/sda1 Directory=/ Image_To_Restore=intrepid1

Edit the APPEND line so it reads:

APPEND vga=normal devfs=nomount pxe ramdisk_size=33000 load_ramdisk=1 init=/linuxrc prompt_ramdisk=0 initrd=initrd.gz root=/dev/ram0 rw noapic lba

and you can delete the folder with the webbook image in it. If you boot from the USB stick you will now be able to go to a root shell or do a backup (or restore) from the partimage menus. There is an extra irritating little detail which took me days to figure out, when you back up an image this way it splits it into two files, the restores then don’t work (most of the time). I do the backup from the menus then delete the hda1.000 and hda1.001 files then go to the shell and run partimage from the command line which lets me back up the partition to a single unsplit file. (I will do some screenshots of that at some stage).

There are pros and cons to this method, it might be better to have a separate /home partition and have an option on startup to leave the home alone. The advantage is that it is a hands off rebuild that anyone can use, including the factory.

I reject your reality and substitute my own

Sunday, November 2nd, 2008

I have been playing with the ARToolkit which is a really amazing piece of software. It allows a real-time video stream from a camera to be mixed with virtual stuff. Here is me holding two bits of paper with special markers on them. The cube and sphere are being added to the image in software and I can wave the markers about and the objects stay ‘attached’ to them. It is quite spooky.

This is running on Ubuntu, but not a webbook just yet. With OpenVRML it should be possible to attach all sorts of objects to the markers.

Some updates and an update

Wednesday, October 29th, 2008

We took the webbooks and some other Elonex laptops, the ONEt and ONE to the Linux Expo Live event in Olympia last week. I should be getting some photos soon, better than the one from my phone at the Woking event. It was not the busiest show but that was OK because we could have a nice long chat with all sorts of interesting people. I had the pleasure of hosting the speaking sessions on the Friday afternoon and Alan Lord hosted the Saturday sessions. All my speakers were great, but a particular highlight was the talk from David Axmark, one of the co-founders of MySQL telling us the story of MySQL and why he left SUN (in short: he doesn’t like working big companies). Lots of people were interested in the webbook but the star attraction for the geek audience was the ONEt with it’s MIPS architecture processor. The software on the ONEt is all very pretty, but not at all how I would have arranged it. With a Debian based system and the apt/dpkg package manager the ONEt could become a really great little computer.

Coming up soon (tomorrow actually) is the Ubuntu 8.10 Intrepid launch party, this will be at Waxy O’Connors in the Dargle bar tomorrow evening, please feel free to join us there.

The other update is a software update to the Wader mobile broadband client. This was released a couple of days ago, if you start the mobile broadband client and go to help-about it should be version 2.3, if it isn’t then do an update and reboot (it should work without the reboot, but just in case . . .). The update adds a cancel button to allow you to interupt it during a connection and also includes a fix mostly for Orange where some SIM cards can take a long time to initialise, this version waits more patiently for the SIM card and network to get it’s act together.

Update:

The party was great, very well attended and my head hurts now.

Ibex update

Tuesday, October 14th, 2008

Ubuntu Intrepid Ibex is the next version of the operating system on the webbook, it should be released at the end of this month and I have been testing it out. Right now it would not be a good idea to upgrade. The screen goes black and fixing it is an interesting challenge. The external VGA port works fine so you can plug in a monitor, but getting the LCD panel up and running required me to compile the latest OpenChrome drivers and make a little change to one of the source files. I am still talking to the OpenChrome folk about improving the fix, but right now, don’t be in a hurry to upgrade!

webbooks in Woking

Friday, October 10th, 2008

Yesterday was the Woking Means Business trade show, we had a stand there so we could show local businesses how they could save money by using Free and Open Source software. Here is a (bad) photo of our computer laden stand. (Alan Bell on the right, Alan Lord is on the left)

on the stand from left to right is a Novatec laptop (they are one of the few suppliers who will sell you a computer without operating system), an Elonex webbook, an OLPC XO laptop, the pink Elonex ONE and on the shelf is a monitor attached to another Novatec laptop and a little Elonex ONEt. All running Free and Open Source software.

We had internet access on all the computers, thanks to another webbook hidden in the cupboard below. The other webbook had an Orange 3G dongle plugged in and was connected to a standard wireless ADSL router (not plugged in to ADSL of course). With a bit of messing about with the settings we got the webbook to act as a NAT router and internet gateway for all the others. We were connected for about 8 hours doing all sorts of things, demonstrating updates and installation of software and using our web based vtiger CRM system. It worked flawlessly and is a really great setup for anyone who wants internet access for a bunch of computers.

To get it working there are a couple of magical incantations required on the webbook, specifically,
sudo sysctl -w net.ipv4.ip_forward=1
to allow it to forward packets from the wireless interface to the mobile broadband interface, and then
sudo iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o hso0 -j MASQUERADE
to set up a firewall rule to do network address translation (NAT) for the 192.168.0.0 subnet (the local network) with the external interface being called hso0 (if you have the Orange dongle the network card is called hso0, if it is 3 or T Mobile then substitute hso0 for ppp0). Finally on all the other computers we had to set their default route to point to the IP address of the webbook with the dongle and also edit their /etc/resolv.conf dns settings to point to the Orange DNS servers, if I had set the webbook up as a DHCP server this could all have been automatic.

Booting the webbook from USB or SD cards

Friday, October 10th, 2008

There is a trick in the BIOS to booting from USB or SD cards, it is a bit counter-intuitive, but it can be done.

Plug in the USB/SD card and power up the webbook,  press del straight away to enter the BIOS.

On the Boot tab don’t go into the tempting looking Boot Device Priority section, go to the Hard Disk Drives bit.

Swap the order so that the USB device is the 1st drive and the SATA drive is the 2nd drive.

F10 to save and exit

now it will boot from the USB.

When you are done, remove the USB and power down.

If you switch on and try to boot now it won’t do it, you will get a scary sounding error message saying Base-code ROM ID structure was not found., reboot and select proper Boot device.

Don’t Panic!

Power down and up and go back into the BIOS and back to the Hard Disk Drives bit. For some reason the 1st drive is listed as disabled, change that to enable the SATA drive and then you will be able to boot from it again.

That error message was because it was attempting to do a network boot, but the network boot ROM was turned off. If you want to boot from the network you have to go back into the Boot section of the bios and enable the PXE Configuration Execute bit. If you don’t know what PXE and TFTP are then you don’t need to worry too much about this!

Keystroke guide to a factory reinstall

Friday, October 10th, 2008

Some people have been asking about the exact factory configuration of the webbook, so here it is, keystroke by keystroke guide to building a webbook.

Insert the Ubuntu 8.04 or 8.04.1 Alternate CD into a USB CDROM drive

return (to select English)

F4, down cursor, return (to select OEM mode)

return (to select English)

up, return to select United Kingdom

right, return to not detect the keyboard

return, return to select UK keyboard

down to select eth1 the wired network card

return to cancel the search

return to continue

down return to not configure the network at this time

change the host name to webbook (not sure this was always done for every batch – some probably  have ubuntu as the hostname)

select guided-use entire disk

return to do the partitioning

left return to write the partion to disk

oem return, oem return to set the password of the oem user

make a cup of coffee.

return, to finish the installation

return to select UTC

return to reboot

remove CDrom

let the system boot up.

Ctrl+Alt+F1 to get to a console

oem, oem to log in

wget http://webbookblog.com/buildscript.sh

chmod +x buildscript.sh

sudo ./buildscript.sh

oem (the password for the oem user)

y to download a load of updates

y to install the ppa stuff without verification

agree to the SUN Java license

now it goes through another bunch of updates

oem-config-prepare

halt

Now it should restart with the first user wizard. The only difference is that Virtual Box is not installed, this is because there seems to be a problem right now with the version of the VirtualBox kernel module so it won’t install without errors. After doing the above procedure I ran <code>apt-get clean</code> to save some space used partimage to take a compressed image of the drive, this just about fits on a 1GB USB wristvault which should end up being the recovery media which you will be able to get from Elonex. We could do recovery media for different operating systems too, so you plug in the USB key and boot from it to reimage the drive as OpenSuse/Fedora/Debian/Gentoo etc. Would you be interested in that?

Compiz Beta – part 3

Wednesday, September 17th, 2008

OK, so with luck you now have the via drivers installed. You can do a few funky things already, for example go to System-Preferences-Screen Resolution and change it to 1024×768. This will compress the display onto the 1024×600 screen which allows some of the overly tall dialog boxes to fit (like the Evolution setup wizard for example). If you plug in an external monitor or projector the display should fill the screen nicely. In fact if you are into that kind of thing you can go to the synaptic package manager and install the openoffice.org-ogltrans package and get a bunch of fancy 3d transitions in the Impress application. I will have a go at posting some screenshots of that later.

Lets move on to enabling Compiz. To do this we are going to have to tell Compiz that the VIA driver actually is plenty good enough to use. Go to Applications-Accessories-Terminal and lets try to start Compiz just to see what happens.

so that didn’t go so well. Press ctrl+c to get back to a command prompt. So it has no whitelisted driver and is refusing to start. Fortunately I know where it stores it’s whitelist :-) The compiz command is just a script file that starts off some other things and this script contains the whitelist of approved graphics drivers, so lets go edit it

sudo nano /usr/bin/compiz

now go and find the line that starts with WHITELIST, add via to the end of the list inside the quotes as shown below:


now save and close with

Ctrl+X
y
return

now lets try starting compiz again (starting from the 4th line in the screenshot below)

lots of screen flicker then it seems to have started. Don’t worry too much about the error message on the last line. You should now see a few fancy fades and effects happening. Try switching desktops and they will slide across. Open and close a few windows. Nice isn’t it! Compiz will start automatically when you log on now that you have whitelisted the via driver.

There are lots and lots of effects to turn on, for that you need the CompizConfig Settings Manager, which I will talk about in part 4

Please let me know if the instructions work!

Compiz Beta – Part 2

Wednesday, September 17th, 2008

This only works on Hardy Heron 8.04 kernel version 2.26.19 if you have upgraded beyond that, i.e. if your webbook is currently up-to-date then the download on this page will not do anything useful and you will need to restore the backup of your xorg.conf to get it working again.

So now you know how to unbreak your webbook graphics, lets have a go at installing and using the via drivers.
First download this file Elonex Via Drivers.
This contains the binary drivers patched for the webbook and compiled against kernel 2.26.19 which is the current kernel at the time of writing this. When the next kernel upgrade happens there is a reasonable chance you will boot to a black screen. If that happens go to the recovery console and copy back your xorg.conf for the openchrome drivers.
So having downloaded the file start up a terminal window. I am assuming that you downloaded the file to the desktop (the default place if you just clicked on the link in Firefox), if you put it somewhere else then you may have to adjust the commands accordingly.

cd Desktop
ls
tar -zxvf elonexviadrivers.tar.gz
cd ElonexViaDrivers
sudo ./vinstall

so step by step
cd Desktop changes the current directory to the Desktop directory where you downloaded the file
ls lists the content of the current directory, it will show you everything on your desktop. I put this in just to confirm you are in the right place and to help you forget the dir dos command:-)
tar -zxvf elonexviadrivers.tar.gz
this one is a bit more complex the zxvf bit is 4 commands or flags we are passing to the tar program. z means uncompress the file using gzip (that is the .gz part of the filename). x means extract the files from the archive. v means verbose, so it will tell you what it is doing as it extracts them. f means the next parameter is the filename to work on.
cd ElonexViaDrivers
the extracted archive created a new folder on your desktop, we now change directory into that folder
sudo ./vinstall
sudo means run the next command as the super user. The single . means “the current directory” just as .. means the parent directory. cd . does nothing cd .. goes up a directory. ./vinstall means run the vinstall script that is located in the current directory. Now if you are familiar with the workings of other popular operating systems you may be a bit puzzled by this, why can’t you just type vinstall because you are in the right directory? Well this is a security feature, the current directory is not on the search path for applications to execute, you have to be explicit. Imagine if there was a script called “ls” in a directory, you go into that directory and use ls to list the contents but instead of doing that you just ran a script that does who knows what!
You can have a look at the contents of the vinstall script if you like. Just type
gedit vinstall
and the editor will open up so you can see what it does. It is always good practice to have a look at scripts before you run them. It is a great way to learn, and you can check that it is doing what you expect it to do.
So now you should have the via drivers installed, if you restart you will find the login window a bit stretched (not quite sure how to fix that yet) and you can log on to your desktop. Some things might be a bit smoother, but nothing dramatic is visible. For that we need Part 3 – Enabling Compiz, which I will crack on with right now . . .

Please shout if the instructions don’t work, there might be some typos in there