Tuesday, April 23, 2013

Upgraded to Fedora 18 on my Pi and discovered the Fluxbox WM

I've used Fedora 17 on my Pi for some time and it works well although there are some problems.
My experience is detailed in this post and this follow-up.

Well, Fedora 18 has been available for a while now and a RPi version also appeared thereafter, so it's time for an upgrade.
However, rather than a clean install, I first tried upgrading from a terminal.
This is well documented in the Fedora wiki where two methods are suggested.

The recommended method is to use FedUp which is more beginner-friendly.
Unfortunately, although the app is available for use on the Pi, it doesn't work primarily because the methodology invokes the Grub bootloader to complete the upgrade.
However, there's no Grub on the Pi and no workaround seems to be available.

Ok, how about the Yum approach to upgrading Fedora to 17 to 18 which is detailed in the last link.
Unfortunately, this approach also didn't work on my Pi due to many errors.

Nothing for it but a clean install using the compressed image found here.
This went very smoothly and I used Gparted to increase the /root partition to take up all remaining space on my 8GB Sandisk Extreme Pro SDCard.
Note that as the image includes a 512 MB folder called /swap0 which serves as a swap partition, no further partition is needed on the SD Card.

As I had not installed over my Fedora 17 install, I was able to copy all essential stuff (mainly my elaborate Conky setup) from my old Fedora to the upgraded version.

Fedora 18 uses the xfce4 DE as before but the default DM has changed from GDM to LightDM.
However, although it's well-documented, I could not get lightdm to autologin by editing /etc/lightdm/lightdm.conf
Even invoking /etc/pamd/autologin did not work for me on the Pi.

I hate having to enter a password every time I boot into an OS so the lack of autologin in xfce4 forced me to look at the Fluxbox WM which I had recently played with in FreeBSD on my Pi

In summary, Fluxbox is wonderfully light, yet feature-full and ideally suited, I think, to the low resource boxes like the Raspberry Pi.

I could write pages on what I've done but because I'm short of time (traveling again tomorrow), I'm just going to summarize the main points of my experience so far.

i) Absolutely no problem getting Fluxbox to aulolog me in.
The three steps were:

a) to the file ~/.xinitrc add the line

exec startfluxbox
to start the WM at boot.

b) add the line
[[ -z $DISPLAY && XDG_VTNR -eq 1 ]] && exec startx
to ~/.bash_profile to start the X server at boot.

c) follow these excellent ArchLinux instructions to autologin your user at boot.

Actually, although I'm using Fedora 18 (the version I'm using is called Pidora 18), all of the references I've made to get complete autologin to the X desktop came from ArchLinux documentation.

ii) Conky works perfectly on Fluxbox in Pidora 18 with none of the transparency problems I had in xfce4.
The .conkyrc file I use is exactly the same as I had previously used in Fedora 17 on the Pi.
Additionally, there's no loss of transparency of the Conky window when new mail is received.

iii) Setting your Desktop wallpaper is very easy.
Unfortunately, when I wrote this the fluxbox wiki was down which restricted what I could reference.
However, a very lightweight configuration guide is also available here.

I added the following line to the ~/.fluxbox/startup file to get my selected wallpaper to load at boot time.

fbsetbg -f /home/paul/Pictures/fluxbox/fluxbox_wallpapers_by_deviantvicky-d33ory3.jpg


Well, there's still a lot more to report but it'll have to wait as I've run out of time for the moment.
But, I'll complete this post in just over a week's time.












Wednesday, April 17, 2013

Raspberry Pi: No boot after rpi-update

This is my first post in a long time as I was away in Brazil for a few weeks.

Anyway, when I got back I settled down to do some updating on my Pi OSes (of which I have quite a few).
I tried Raspbian first.
The command "sudo apt-get update && sudo apt-get upgrade" went without a hitch as did "sudo rpi-update".
That is until I tried to reboot.
It just didn't boot.
The red power light came on but the three internet lights never even flickered.
The green ACT light, however, was flashing three times, then stopping, then flashing three times and so on.
The RPi troubleshooting guide explains this nicely here.
So, it seems that start.elf was corrupted.

As usual, I'm not the first to have noticed this and a thread in the RPi forums already addressed the problem.
This post from the same thread suggests how to get Raspbian booting again.

OK, so I put my Raspbian SD card into my little, but exceedingly useful EeePC901 netbook (remember those?) and downloaded four files from the rpi-update github page.
These were bootcode.bin, start.elf, fixup.dat and kernel.img.
Then I copied all to /boot on my Raspbian SD card without doing anything further.

Back to the Pi and now the SD card booted.
Great!
Well, not quite, as for reasons I don't understand, my Logitech K260 keyboard and mouse did not work.
Same thing after a reboot.
So, now what?

Actually, the solution was quite simple.
I ssh'ed into my Pi from my MacBook (I autostart Conky in all my Pi OSes and from Conky I could see the IP) and ran "sudo rpi-update" from there.
Now, after a reboot, everything was perfect.


Saturday, March 02, 2013

A fast browser for the Pi

Came across this thread today, although it's a week or so old, dealing with a lightweight webkit and supposedly very fast browser for the Pi.

The Pi is a wonderful machine but, of necessity, it's lacking in resources such as CPU speed and RAM.
For this reason, browsing is at times painfully slow.
And I've tried a lot of browsers including QupZilla, Midori, Luakit, UZBL and many others.

I first tried the downloadable binary in Rasbpian but this just didn't work at all for me.
No idea why not.

Nothing for it but to compile from source.
The home page for this project is here in Google Code from where you can find out how to build from source.

In a fully-updated Raspbian, you run this command

git clone https://code.google.com/p/minimal-web-browser
Next, to avoid compile errors I had to install these two dependencies

libgtk2.0-dev
libwebkitgtk-dev

Thereafter, I was able to cd to minimal-web-browser/web-1.0, run make and sudo make install.
The compile and install were very quick and took less than a minute or two for a full install.

Running the command "web" brings up the browser showing Google in about 1 second.
Impressive.
Unfortunately as I'm traveling tomorrow, I didn't get much chance to really check it out but it certainly looks very promising.

Incidentally, I tried the compile also in Gentoo on my Pi.
Although it compiled there was an error (something to do with sudo install -g dialout).
Nevertheless, the command "web" did open up the browser with Google open.
However, after a few seconds, it seg faulted and disappeared.










Tuesday, February 26, 2013

Free up some space on your Pi SDCard

One of the problems about running an OS on your Pi (Raspberry Pi) is that the OS runs from an SDCard which is probably going to be either 4GB or 8GB.
That's not a lot.
Nevertheless, you can probably get away with as little as 2GB to run a fully-fledged (with full Desktop)  OS on your Pi as long as you take steps to manage the available free space.

Here's how I freed up quite a lot of space in some OSes I use on my Pi.

Raspbian
Delete the files syslog, kern.log and messages from /var/log/ and I retrieved 1.8GB of space.
I chose these simply because running the command (from /var/log/)

sudo du -csBM * | sort -rn | head -11
showed these three to be by far the largest log files.

Most people don't need, and never use, these logs but they consume a lot of space.
After deletion, they will be recreated next time you boot and start storing data about the computer's performance.
So, it's probably a good idea to remove these files from time to time.

Arch Linux
In Arch I got back 600 MB when I deleted all files from /var/cache/pacman/pkg/
These package files are stored simply to allow possible downgrading of installed packages.
Read about it here in the Additional Commands section (search for /var/cache/pacman/pkg)

Gentoo
Deleting everything in /var/tmp/portage/ freed up 600 MB of space.
Deleting everything in /usr/portage/distfiles/ gave me back a whopping 1.2 GB

Fedora
In Fedora, removing everything in the yum cache (/var/cache/yum) gave me 200MB of free space.
In addition, however, make sure you know how your swap is set up in Fedora.
I had created a 500 MB swap partition.
But, it seems Fedora prefers to set up a special Swap file in the root partition (which was designated as /swap0 and of 512MB size).
In /etc/fstab, only /swap0 was being mounted and not the swap partition that I had created myself independently of the config tool.
So, I revised fstab to mount /dev/mmcblk0p3 as swap and subsequently deleted /swap0.
Another 500 MB saved.




Tuesday, February 19, 2013

RPi boots when usb device plugged in

I came across this interesting post today which shows a Pi (powered but shutdown) will boot when a wifi dongle is plugged in.

Really?
Will it work for me?

I first tried it on my "old" (delivered in May 2012) Model B with 256 MB of RAM and it just didn't work no matter what usb device I plugged in (I tried three wifi dongles, 2 different usb keys, a SDCard reader, a powered usb hub and the usb plug from my X-Mini speaker).
No sign of any green light from any of these.

A bit disheartened at this stage but I still tried my new Model B (512 MB RAM) and this time it worked........with nearly everything.

The Pi booted without a murmur of complaint when I plugged in each of the following:

Wifi dongle MicroNet N150
Wifi dongle Belkin F5D7050 with zd1211 chipset
Wifi dongle Linksys AE1200
Usb from X-Mini speaker
Belkin powered usb hub
PNY 1GB usb key

However, it didn't boot when I plugged in 

Dreamgear SDCard reader
Any of a range of HP and Kingston usb keys.

Interesting certainly, but not sure if I'm ever going to find a use for this finding.
It's just so easy to flick the power switch on and off.



Saturday, February 16, 2013

Fedora + xfce + RPi + Conky

Yes, a captivating title if, perhaps, a little mysterious.
What am I talking about?

Well, I been using the Raspberry Pi for almost a year now and although it's very limited in terms of hardware power, it's an awful lot of fun trying to get acceptable performance out of this tiny, and very cheap, box.
The immense success of this little machine is testimony to the inventiveness of the computer hobbyist community.

I've played with a number of OSes on the RPi and these include Fedora 17 RC2.
It works well although it's not quite as smooth and polished as is Raspbian.
I've already posted about the problems I had getting Conky to "play nice" in Fedora/xfce.
Actually, whatever problems I had with Conky are almost certainly the fault of the xfce DE rather than Fedora itself.

When I posted before, the main problem with Conky in this environment was launching Conky always made the desktop icons invisible. In addition, with certain .conkyrc configurations the Conky colors were very different from what I had intended.
As I use a color-coded Conky to alert me to unusual activity in my OS, this is a serious defect.

Well, I've made some, but not complete, progress in this area.
Here are the results of my latest investigations in summary form:

i) As usual it is always critical for Conky to have the compositor enabled.
(Applications Menu -- Window Manager Tweaks -- Compositor Tab -- Check 'Enable display compositing'

With no other 'own window' options in .conkyrc than the following:

own_window                        yes
own_window_type               override
own_window_transparent   yes

conky displays in a black window as shown in the screenshot with all of the desktop icons fully visible.

But, by doing no more than restarting the window manager (xfwm4) by means of the shell command

killall xfwm4

the conky background becomes gloriously transparent as the next screenshot afirms.
Unfortunately, for reasons I cannot as yet explains, when the Gmail portion of the conky display shows a change in status (a change in number of new emails including when it reverts to '0' after opening new mail) the background turns black yet again.
Of course, issuing the above 'killall xfwm4' command brings back the transparency although this can be a bit of a pain if you get a lot of emails.
You can ease the problem to a small extent by making a keyboard shortcut (see section vi) for the above command.

ii) If the own_window options are changed to


own_window                 yes
own_window_type        normal
own_window_hints       undecorated,below,sticky,skip_taskbar,skip_pager

the conky window shows as 'partially' transparent, and once again without losing the icons.
See the third screenshot opposite.

The degree of transparency of the 'normal' window can be varied by moving the Inactive Windows Opacity slider which is found in Applications Menus -- Window Manager Tweaks -- Compositor Tab

Unfortunately, by reducing the opacity of the window, you also reduce the opacity (and therefore the visibility) of the font too.

Nevertheless, this option not only keeps the desktop icons but also is unaffected by incoming email.

So, as yet a 'perfect' solution is not available but it's not at all too bad.
My personal preference is for the own_window_type override option despite the annoyance of having to refresh the WM on receipt of emails.

Friday, February 08, 2013

Display web page data in Conky

A friend, who writes a small blog, asked me for some help taking the page view data from StatCounter for his blog and displaying it in Conky.

I haven't seen much on this topic other than this CrunchBang post.

Anyway, I decided to try my own approach and this is what's described here.
It's fairly tricky and involved so pay attention, please.

1. Get the data into a Conky-readable format (basically a text-file).

A LibreOffice or OpenOffice spreadsheet has a Link to External Data command which can be used for this purpose.
Open a new spreadsheet file, place cursor on cell A1 (of course, it can be anywhere, but let's assume you want it to look tidy) and open Insert > Link to External Data.

Now, in the External Data dialog that opens, place the url of your webpage in the url box (well, where else would you put it?)
In the same dialog, check the 'Update every' box in the bottom right corner and select how often you want to update it (I chose the default 60 seconds).
I found this particular dialog just a little temperamental. So, you have to place the mouse cursor at the end of the url in the url box and hit Return.
Then wait for the Import Options dialog to open. I selected the default Automatic option and hit Return again.
Now, the External Data dialog should reappear with entries in the 'Available tables/ranges' box.
In my case, as I want the information displayed in the tables, I selected 'HTML_tables'.
Hit OK and the information you want should show up in the spreadsheet.

Save this file with an appropriate name in the .ods format (mine was called stat.ods and I saved it to my ~ directory).

Now, Conky cannot read the .ods file.
So, we save the same file as a .csv file (comma-separated-values)
File > Save As > File Type > .csv

2. Create script to generate .csv file at selected frequencies to display current blog hit count

For this script, I made extensive use of the xdotool function which is very powerful with an enormous 'vocabulary'.
Essentially, it allows a script to mimic a series of keystrokes (and mouse movements too but I haven't used these).

Here's the bash script I made to update the .csv file I needed every two minutes (you can choose whatever you want):

#!/bin/bash 
##Open the file stat.ods in LibreOffice
          localc --minimized /home/paul/stat.ods "$@" &
## The 'sleep' commands are to ensure the keystrokes have enough time to  
## activate before the next command is called 
sleep 3
## Because the file, when it opens, asks if you want to update the live links 
## (links to webpage). You need to hit Return three times for this 
xdotool key Return Return Return 
sleep 3
## The following series of keystrokes save the .ods file as a .csv file of the same name 
## and in the same directory 
xdotool key alt+f 
sleep 2 
xdotool key alt+a 
sleep 2 
xdotool key Right 
sleep 2 
xdotool type ".csv" 
sleep 2 
xdotool key Return 
sleep 5 
xdotool key alt+s alt+y 
sleep 2 
xdotool key Return 
sleep 2
## Start an endless loop to periodically save the stat.ods file as stat.csv 
## Remember that stat.ods updates from the webpage because of the External Data Link 
while true; do
## For the scripted keystrokes to enter ONLY the stat.csv file, you need to 'steal' focus 
## from whatever other window you might have open at the time. 
## First, we need to identify what window is currently focussed so we can refocus it 
## when the updated stat.csv has been saved 
window_id=$(xdotool getwindowfocus)
## Now focus the stat.csv window to receive the keystrokes 
xdotool search --name stat.csv windowactivate 

## Open the File and Save it 
xdotool key alt+f ctrl+s 
xdotool key Escape 
sleep 0.25
## Return focus to the window from which it was stolen at the start of this loop 
xdotool windowactivate $window_id
## Shade the stat.csv spreadsheet to 'get it out of the way' until needed again
wmctrl -r "stat.csv" -b toggle,shaded
## Repeat this loop every 120 seconds 
sleep 120
         ## go back to the start of the 'while' loop 
done

Save the script I called mine losave (an abbreviation for LibreOffice Save) and make it executable. Although not entirely necessary, I also copied my losave file to /usr/bin/ so it can be used from anywhere.
Now, assuming you have LibreOffice Calc installed, launching losave (either from a terminal or by typing Alt-F2 and entering losave in the box) should open stat.ods in LibreOffice Calc, activate the link to your selected webpage and save the file as stat.csv at whatever frequency you have selected.


3. Create similar script to display location of last hit

Not surprisingly, what's needed here is almost exactly the same as in the previous script.
The major difference is that a different .ods file is required.
StaCounter displays hit location in the Recent Pageload Activity page available for each blog in your account.
I called this spreadsheet loc.ods (loc=Location).
The script is shown below without any explanatory notes as there is no significant difference from the earlier script.


#!/bin/bashlocalc --minimized /home/paul/loc.ods "$@" & 
sleep 2 
xdotool key Return Return Return 
sleep 2 
xdotool key alt+f 
sleep 2 
xdotool key alt+a 
sleep 2 
xdotool key Right 
sleep 2 
xdotool type ".csv" 
sleep 5 
xdotool key Return 
sleep 5 
xdotool key alt+s alt+y 
sleep 2 
xdotool key Return 
sleep 5 
while true; do 
window_id=$(xdotool getwindowfocus) 
xdotool search --name loc.csv windowactivate
xdotool key alt+f ctrl+s 
xdotool key Escape 
sleep 0.25 
xdotool windowactivate $window_id 
wmctrl -r "loc.csv" -b toggle,shaded 
sleep 115 
done

4. Now, we should have two periodically updated .csv files in our home directory (or wherever you placed them).

Here's some examples of what they look like:

stat.csv

,Today?,Yesterday?,This Month?,Total?,Settings, 
MyBlog1,0,0,0,0,Config,                       
MyBlog2,68,106,652,85371,Config,                       
MyBlog3,0,3,5,1689,Config,                       
MyBlog4,0,0,20,15849,Config,                       
MyBlog5,0,0,0,282,Config,                       
5 projects,68,109,677,103191,,,,,,,,,Real-Time Visitor Stats,,Project Settings,,, 
,User & Public Access,,Email Reports,,,

Here, information for a number of blogs is included, most of which are not active.
The only one of interest is MyBlog2.

loc.csv looks like this in part (I've taken out details of what pages were viewed).


,,,WinXP,,"Arizona,",,,,1920x1080,,United States,  
,,,Win7,,"Washington,",,,,1600x1200,,United States,  
,,,MacOSX,,"Para,",,,,1440x900,,Brazil,  
,,,WinXP,,"Andhra Pradesh,",,,,1024x768,,India,  
,,,Linux,,"Pais Vasco,",,,,1440x900,,Spain,

OK, so everything we need is available in these two files but it's mixed up with an awful lot of other stuff.
So, the challenge facing Conky is to pare out what we don't need and print what we do.


5. Sifting the useful information from the .csv files for display in Conky

We're now trying to convert the jumble in the above .csv files into what appears in this partial screenshot of Conky (running in Arch Linux).








The first and second lines above are simply text inputs.
The third line is of primary interest and displays hits so far today, the total for yesterday, the total for the month so far and, finally, the total for all time.

The algorithm used in Conky is this:

$alignr ${exec cat /home/paul/stat.csv | grep MyBlog2 | awk -F\, '{print $2}'}       ${exec cat /home/paul/stat.csv | grep MyBlog2 | awk -F\, '{print $3}'}      ${exec cat /home/paul/stat.csv | grep MyBlog2 | awk -F\, '{print $4}'}     ${exec cat /home/paul/stat.csv | grep MyBlog2 | awk -F\, '{print $5}'}
This is fairly straightforward (at least, in comparison with the next one (:-).
Basically, each section of the algorithm opens out the stat.csv file and selects only the line containing the blog information of interest (MyBlog2).
The 'awk' command breaks up the line into fields while designating the ',' as the field delimiter.
Subsequently, it prints out the second, third, fourth and fifth fields as the hits appropriate to the various categories.

Great, but how do we separate out from loc.csv the location from where came the last hit.

Here's the algorithm:

Last Hit From: $alignr ${exec cat /home/paul/loc.csv | cut -d "," -f 6,7 | sed 's/"Korea, Republic of"/Korea, Republic of/' | awk '!/"/' |sed 's/\,//g' | sed -n 2p}
Possibly the best way to explain what each section of the algorithm does, is to present how the original loc.csv file changes as it goes through each stage of the algorithm:
First, I'll point out that the country names for each location were "almost" invariably without quotes while all other location data (city, state or whatever) were always within quotes.
The one exception to this rule that I've found so far is South Korea (or Republic of Korea). For some strange reason, Statcounter displays 'Korea, Republic of' within quotes.
This explains the rather strange third section of the algorithm which does no more than substitute the name 'Korea, Republic of' within quotes to one without quotes.
Without this, all hits from South Korea would have shown up as blank spaces.

OK, so here's what we start with:


,,,Win8,,"Champagne-Ardenne,",,,,1600x900,,France, ,,,WinVista,,United Kingdom,,,,1280x1024,,, ,,,Linux,,United Kingdom,,,,1280x800,,, ,,,Linux,,"Texas,",,,,1024x600,,United States,
,,,Win8,,"Mazowieckie,",,,,1920x1080,,Poland,
,,,MacOSX,,"Stockholms Lan,",,,,1440x900,,Sweden,
Once again, I've taken out anything that might be construed as private.

Now, after application of the algorithm section 'cut -d "," -f 6,7', we get this:
Location,Host Name/Web Page/Referring Link
"Vendeuvre-sur-barse,"
"Champagne-Ardenne,"
France,
"Luton,"
United Kingdom,
,
"Wolverhampton,"
United Kingdom,
,
"Dallas,"
"Texas,"
United States,
"Warsaw,"
"Mazowieckie,"
Poland,
"Upplands-v�sby,"
"Stockholms Lan,"
Now, it's starting to look more handleable.
Let's see what the next algorithm section does (leaving out the Korea one as this only applies in rare circumstances).
So after cut -d "," -f 6,7 | sed 's/"Korea, Republic of"/Korea, Republic of/' | awk '!/"/' 
we get:

 Location,Host Name/Web Page/Referring LinkFrance,United Kingdom,,United Kingdom,,United States,Poland,Sweden,
So, now we have, other than the heading, just countries and commas. Getting closer.
Let's see what's next.
cat /home/paul/loc.csv | cut -d "," -f 6,7 | sed 's/"Korea, Republic of"/Korea, Republic of/' | awk '!/"/' |sed 's/\,//g' 

gives us

LocationHost Name/Web Page/Referring LinkFranceUnited Kingdom
United Kingdom
United StatesPolandSweden
Looking better as all of those commas have gone.
Now all we need to do is to pick out the last hit location which is in the second line.

Here's what the whole algorithm (cat /home/paul/loc.csv | cut -d "," -f 6,7 | sed 's/"Korea, Republic of"/Korea, Republic of/' | awk '!/"/' |sed 's/\,//g' | sed -n 2p)  gives us:

France
And that's it.
Any questions?











Tuesday, February 05, 2013

RPi Gentoo update doesn't update PATH

I posted recently on how I updated Gentoo  on the Pi.
I later wrote about some problems that resulted from, or during, the update here and here.

Today, I tried, for the first time since the update, to launch QupZilla (which up to now is the only browser --other than Lynx-- that works for me in Gentoo on the Pi).
However, it wouldn't launch.
From a terminal it gave me a error saying that libstdc++.so.6 was not available.

However, it was actually available in /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.6.3
So, why is it not being seen?
Let's check the PATH.
Yeah, that's it, the path still refers to gcc-4.5.4 and not to gcc-4.6.3.
So the PATH did not update during the overall update?

Let's fix that by going to /etc/env.d and checking each of the files.
Read all about this in the wiki.
Well, the only files in this directory that contain contributions to PATH are 00basic, 04gcc-armv6j-hardfloat-linux-gnueabi and 04rasberrypi-userland and none of these contains any reference to gcc-4.5.4 but 04gcc-armv6j-hardfloat-linux-gnueabi refers only to gcc-4.6.3.

So, lets update the PATH.
This just requires running the command

# env-update && source /etc/profile
To check that everything's fine, just run
$ echo $PATH
OK, that's perfect. All references to gcc-4.5.4 are gone and replaced by gcc-4.6.3

Now let's try launching QupZilla again.
What?
The exact same error regarding libstdc++.so.6 not being available.
But it is available and the PATH points right to it.
What's going on?
A little googling brought me to this thread which (last post) suggests it's a bug that should have been fixed some time ago but seems to be still there on the RPi version of Gentoo, at least.

Well, the thread above suggests a fix which I tried by
$ cd /usr/lib/# ln -s /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.6.3/libstdc++.so.6 .

(don't overlook the '.' at the end of the soft-link command as this links libstdc++.so.6 to the current directory which is /usr/lib/)

And now ........ yes, QupZilla launches with no errors.





FreeBSD on the Pi

I've used FreeBSD for quite some time but can't say that I ever came anywhere close to mastering it.
Nevertheless, I'm interested in testing as many OSes as possible on the Pi (well, at least the more serious ones. I've left out Puppy Linux, Open9 and RiscOS)

Of course, just like Gentoo, FreeBSD by-and-large compiles everything from source, although a partial package-manager is available.
Because the CPU is so miserably small and slow, your Pi is going to spend a lot of time unavailable while it wheezes and puffs its way to another install.

Burning the SDcard

Nevertheless, a FreeBSD image is available ready to be dd'ed onto an SDCard.
I even splashed out on a SanDisk Extreme Pro 8GB card in an effort to remove anything that might slow down performance.

Burning the image to the SDCard went without any problems as did the subsequent boot.

Next, I used portsnap to make ports collection available and then created a user (adduser).
Again, no problems.

Increasing partition size

The install results in two partitions (in Linux-speak) just as with all other RPi OSes. One for the /boot and the other for everything else.
However, the larger partition occupied only about 3.5GB of the more than 7GB available to it.
OK, so it's just a matter of increasing the size of the partition.
Where's the problem?
Well, in FreeBSD it's nowhere near as easy to fiddle around with partitions (or slices as they're called in FreeBSD) as it is in Linux.

While GParted can "see" ufs (the FreeBSD default filesystem) partitions, it cannot really do anything with them.
I spent quite some time playing around with this problem without getting anywhere.
This post from one of the FreeBSD community's main cognoscenti is interesting and basically concedes that there's simply no straightforward way of changing the partition size.

However, I then came across this very recent blog post which seemed to solve everything as it deals with increasing a FreeBSD partition on a SDCard for use in a RPi.
Can't really get much closer than that.
And it works, although you need patience and perseverance.
However, there was one rather awkward problem, the modified SDCard just wouldn't boot.
And I tried it twice.
However, as you can see from the comments to the above post, the post author doesn't seem to have had this problem.

OK, so I dd'ed the image again to my SDcard and checked that it truly booted before trying to increase the partition size.
And it booted without problem.
Now, however, before messing around with gpart, I used this great howto to dump my FreeBSD slice to a usb key (formatted to FAT32) as a bz2 compressed file.

Back to gpart and increased the partition size to take up practically all space on the card.
Now, I used the above howto to restore the dump back to the enlarged partition. This went very smoothly.
Incidentally, although I'm not sure it was necessary, I made a tar.gz of the /boot partition to the same usb-key. After increasing the size of the main partition, I replaced everything back to the /boot from the tar.gz file.

And now the boot. Yes, it boots perfectly without any problems.
Although the gpart blog post suggests it's necessary, I didn't have to use the growfs function once the Pi had booted.
When I ran

df -h
it showed that my partition was close to 7GB in size so everything looked good.

Setting up a Desktop Environment

Now, I need to install a DE (Desktop Environment).
First I need X11.
However, this is where the good news ends.
Although I tried both x11/xorg and x11-servers/xorg-server, neither compiled.
The first failed because of a gobject-introspection error.
I have the impression that the second failed because there's no Clang (cc) compiler in the kernel.
I did indeed try to install clang from ports (although I had to download both the clang and llvm sources from the Fedora repo).
However, even then the compile failed so I just gave up as it seems the main problem is that a lot of this stuff just isn't available for the moment for arm-architecture.

For the moment, FreeBSD on the Pi is pretty half-baked but at least it's a start.


Thursday, January 31, 2013

Yet another Gentoo update pitfall on my Pi

In general, Gentoo works well on my 512 MB RAM Raspberry Pi, other than the extremely slow rate of new software compilation.

Lately, however, I've noticed that doing a full world update can also lead to unbootability.
Here's an earlier post on Gentoo updating.

Three days ago, I started another full update (which went on for about 24 hours).
At the end, a number of suggestions are made including using

emerge --depclean
to take out orphaned packages.
However, after I ran this command, everything more or less died.
There was no internet connection, I could no longer use simple bash commands such as ls or sudo.
My Conky display was completely messed up.
Many times, this error showed up
sh: error while loading shared libraries: libgcc_s.so.1: cannot open shared object file: No such file or directory
However, I basically could not do anything in a terminal due to this error which always showed up even for the simplest commands.
As a last resort, I tried a reboot but the very same message appeared multiple times before the boot just stopped.

So over to Google which brought up this forum thread on the very same subject:
It seems upgrading the gcc compiler leads to problems with libgcc_s.so.1 without which many things break.

Now it's worth noting the following in the relevant pages of the Gentoo wiki,


After this you can run emerge --depclean to remove the orphaned dependencies. When this is done, you need to rebuild the applications that were dynamically linked to the now-removed software titles but don't require them anymore.All this is handled with the following three commands:
# emerge --update --deep --newuse world
# emerge --depclean
# revdep-rebuild

However, because everything died (well, almost everything) after I ran emerge --depclean, I was unable to rebuild dynamic links to removed software with revdep-rebuild.

Back to the forum thread where the preferred solution seems to the that suggested in XavierMiller's post.
But, I can't boot not even to a TTy, so how do I apply the suggested commands?

Wait, there's a post at the bottom of the thread (jgerasmus) that refers to Gentoo on a Pi and to chroot into the Pi OS.

But, I cannot see how this is possible.
To chroot into another OS requires having the same architecture (arm) and I don't have any other arm machines (apart from another RPi).
However, I can place the Gentoo SDCard into the card reader of my (x86) EeePC901, then in Ubuntu on the EeePC901, mount both partitions on the SDcard, open a terminal and, as root, issue the following commands:


# cd /media/abcdefghijkl/# ln /usr/lib/gcc/armv6j-hardfloat-linux-gnueabi/4.6.3/libgcc_s.so.1 /usr/lib/

(Note that in  XavierMiller's post, a 'fictitious' lib directory is placed between the directory /4.6.3 and the file libgcc_s.so.1 which does not exist)

Next, I unmounted the card, replaced it in the Pi and booted.
Now everything was fine.

I then proceeded to issue the further commands in XavierMiller's post which were:
# gcc-config -l 4.6.3# rm /lib/libgcc_s.so.1 # ldconfig 
and everything was back to normal but with an updated compiler (gcc).







Monday, January 28, 2013

Potential errors in aliases

Aliases are very useful for frequently used commands.
If you use Linux and don't know what aliases are, you really should find out.
Here's a very simple tutorial.

Here's one I use in Raspbian on my RPi:

alias update="sudo apt-get update && sudo apt-get dist-upgrade && sudo rpi-update"
Having put this in my ~/.bashrc file (and rebooted), now instead of having to type
 sudo apt-get update && sudo apt-get dist-upgrade && sudo rpi-update
to get a full update (including firmware) of my Raspbian, I just have to type one word
update 

Recently, I was running out of space on the 4GB SDCard I use for my RPi wifi radio, so I created two aliases that would help me locate the largest files and directories on my card.
They were:

alias ducks="du -cs * | sort -rn | head -11" 
alias bigfiles="find . -type f -printf \"%s %p\n\" | sort -nr | head -10"
Now as my RPi radio runs headless, I have to ssh into it to do anything.
Under these conditions, neither of these two aliases worked.
What was wrong?

First, to get aliases to work over ssh you must tell your client computer (or tablet) where to find the aliases.
So, in the server, add the following to ~/.bashrc
source $HOME/.bashrc
assuming your aliases are in ~/.bashrc
(note that the last post in the above link is in error -- there's no equal sign in what's added to ~/.bashrc
You could also issue this command, before running the ssh command)

It's also recommended to add this line to ~/.bashrc

shopt -s expand_aliases
but this was unnecessary in my case.

Now, one alias worked (ducks), but the second one still didn't.
Well, that's strange.

Let's look at that second alias again
alias bigfiles="find . -type f -printf "%s %p\n" | sort -nr | head -10"
OK, I see the problem. We have the string "%s %p\n" in quotes embedded in the alias which is delimited with quotes.
So, the alias doesn't know where it is supposed to end.
Read more about the use of characters in aliases that may have special meanings here.
To remove this ambiguity, just prefix the offending characters with a backslash.
So, this version of the alias works fine:
 alias bigfiles="find . -type f -printf \"%s %p\n\" | sort -nr | head -10"









Saturday, January 26, 2013

BogoMIPS rating changed on RPi kernel?

BogoMIPS is unpromisingly described as "an unscientific measurement of CPU speed".
It's easily readable from the file /proc/cpuinfo and I've used it in the Conky display that I use in all of the OSes that I've played with on my Pi (Rasbian, Debian, Arch, Fedora, Gentoo).

Up until a couple of weeks ago, the value reported by BogoMIPS was extremely close to the cpu_freq value I had chosen for my /boot/config.txt.
In every single case, day after day, the BogoMIPS number was 99.5% of the selected cpu_freq.
So, if that's unscientific, it's still an awful lot closer to the assumed reality than many supposedly scientific measurements.

Note that in the link I provided that the "rating" for the RPi CPU is stated as being 1.0 meaning that the true CPU speed is equal to the BogoMIPS measure which is what I was seeing.

That is until the rpi-update (firmware update) I did on 9/01/2013.
Thereafter, the BogoMIPS rating seemed to change from 1.0 to 0.67
I saw this in all of my OSes and it's continued through 3-4 subsequent rpi-updates.

Strangely, it's not been mentioned or seemingly known about in the Raspberry community.
I've seen the phenomenon mentioned in only two recent threads in the RPi forum (here and here) without any explanation given or concern expressed.

I posted to the forum myself a few days ago, but once again nobody either corroborated  or explained my observation.

Admittedly, the observed change is a matter of very little consequence unless you use BogoMIPS to tell you what your cpu speed is.


Thursday, January 24, 2013

LastFm plays on my headless RPi wifi radio

At the outset, I'll point out that there will be no staggeringly huge breakthrough announced here.
Getting LastFm to play on a Raspberry Pi is really no big deal.
It's readily available as a binary in the Raspbian repos and in Gentoo on the RPi you can emerge lastfmplayer to provide the same thing.

OK, so why the post?
The problem with a headless RPi, is that no X-server is running and LastFm will only run on an X-server.
So, you need to ssh into your headless RPi and configure it for X11 forwarding.
This requires opening /etc/ssh/sshd_conf in a text editor and ensuring the line

X11Forwarding Yes
is uncommented.
Actually, these days it seems to be uncommented (or enabled) by default in all distros that I've looked at  on the RPi (Raspbian and Gentoo).

Now, on the client computer, issue the command
ssh -X [username]@[ipaddress of headless RPi]
Assuming LastFm has been installed on the headless radio and you have a valid subscription to Last.Fm, you can issue a command of the type
lastfm lastfm://artist/beatles
and a Last.Fm window should open in your client computer and start playing your preferred artist from your wifi radio.

Now, as I've already mentioned, you can ssh into, and control, your radio from your iPad.
Previously, I had used SSH Terminal for iPad which works fine to play the radio.
However, as LastFm only runs in X11, SSH terminal cannot handle it.
But, the iSSH console for iPad has an X capability and can readily play LastFm from your headless radio.
However, while the SSH Terminal cost less than €1, the iSSH cost €9 which would buy you about 4 months subscription to Last.Fm (if you pay in US$ rather than €).

The X Server configurations I used in iSSH are:

Only Tunneled Connections         OFF 
Use X Server                                 ON 
Use DWM                                     ON 
X11 Screen                                   1280x800
and this works fine for connection to the headless RPi.
When you connect and issue a command to launch Last.Fm, a small window pops up telling you that the X Client (the iPad) is connected and asks if you want to display the X Server (your RPi).
Of course, you will tap Yes and shortly you'll see the Last.Fm window opening just as it did in the client computer above.

Now, I've done quite a bit of automation to facilitate using Last.Fm on the RPi.
So, in my radio menu, I have a menu item called last_fm.
Choosing this will open another menu (opened, as with all menus on my radio, with Hai's script) which contain my preferred artists.
Each of these "artists" is actually an executable script of this type
#!/bin/bash 
killall -9 lastfm 
sudo /etc/init.d/mpd stop 
lastfm lastfm://artist/[whoever you want to hear?]
If this is chosen, LastFm will open in iSSH (after you choose to display the X Server) and play "whoever you want to hear".

I've also included one menu entry called blank which just opens an empty Last.Fm window, position the cursor in the appropriate window and sits ready for you to type in whatever you want.
This script is as follows:

#!/bin/bash 
sudo /etc/init.d/mpd stop 
killall -9 lastfm 
lastfm "$@" & 
sleep 1 
xdotool key Tab Tab 
exit
















Wednesday, January 23, 2013

Improvements to my RPi radio

Some weeks ago I posted about how I set up my older (256 MB RAM) Raspberry Pi as a wifi radio.
It continues to work extremely well but now I've enhanced it with two very useful upgrades.

I now have 29 preset channels, one of which is LastFm.
Of course, I can put as many channels as I want on my RPi and there's essentially no restriction as long as the channel I want is actually available on the internet.

I almost always control the radio with my iPad (which is actually a generation one iPad).
One thing I didn't like about my initial setup was that I couldn't see what songs were being played (when I had selected a music channel).
Well, that's actually very easy to rectify as just running the command mpc outputs quite a lot of useful information on what channel is playing and information regarding the music being played (for most, but certainly not all, channels).

To output the channel and song information on my iPad (or whatever other device I'm using to access my headless RPi wifi radio), I added these lines to the script to start the channel (this example is for the station Soft Classic Rock):


while true; do   ## sets up a never-ending while loop
echo                      ## prints a blank line
mpc | grep Soft | cut -c1-17  ## selects ONLY line with word 'Soft', prints first 17 chars.
mpc |  grep volume   ## prints ONLY the line containing the word 'volume'
echo   ## another blank line
for i in {1..5}    ## sets up a for loop which iterates 5 times
do                     ## part of the for loop asking for action to be taken
mpc | grep Soft |  cut -c20-  ## Select the 'Soft' line, print everything but first 20 chars.
sleep 30       ## wait for 30 seconds before iterating again
done             ## end of for loop
done              ## end of while loop
The mpc command on its own provides this information while the channel is active:

Soft Classic Rock: Moody Blues - Nights In White Satin
[playing] #1/1   1:23/0:00 (0%)
volume: 50%   repeat: off   random: off   single: off   consume: off
but after mangling it through the addition to the script shown above it comes out like this:
 volume: 50%   repeat: off   random: off   single: off   consume: off
Moody Blues - Nights In White Satin 
Moody Blues - Nights In White Satin 
Moody Blues - Nights In White Satin 
Moody Blues - Nights In White Satin 
Moody Blues - Nights In White Satin
Soft Classic Rock 
volume: 50%   repeat: off   random: off   single: off   consume: off
and this goes on forever, changing when the played song changes, so it's always easy to see what channel and what song is playing as well as some technical stuff such as the volume setting.
Incidentally, this latter is easy changed with a command such as
$ mpc volume 70
which will increase the volume from 50% to 70%.


As I mentioned in my previous post, a central part of setting up my radio menu (on whatever device I use to connect to the headless wifi RPi -- usually my iPad) was the great script posted here.

Strangely, however, I found that the order of the menu items produced was quite variable, which is a little disconcerting if you have a lot of menu items as you'll need to spend sometime finding the channel you want.
I still don't understand why they don't come out in alphabetical order.

Nevertheless, to organize my radio menu, I went about it like this:

1. Select some categories that cover all of your channels such as Blues, Pop, Sport, News.

2. Create directories in the ~/radio folder corresponding to each of the selected categories.

3. Modify the menu script to reflect the new arrangement.
The only required change is in the line starting with 'fileList' where the maxdepth is changed from 1 to 2 to reflect the fact that the channels are now listed two levels down from the ~/radio/ directory.

Here's what my menu now looks like:


#!/bin/bash
# Displays a list of files in current directory and prompt for which 
# file to edit 
cd /home/pi/radio/ 
# Set the prompt for the select command 
#echo -e '\E[1;34m '  
PS3="Type a number or 'q' to quit: " 
#echo -e '\E[0m ' 
# Create a list of files to display 
#echo -e '\E[1;33m ' 
fileList=$(find . -maxdepth 2 -type f | sort -k1) 
#echo -e '\E[0m ' 
# Show a menu and ask for input. If the user entered a valid choice, 
# then invoke the editor on that file 
select fileName in $fileList; do    
if [ -n "$fileName" ]; then        
${fileName}    
fi    
break 
done
When I run the menu command (which I've shortened to mn), here's what I see:

 1) ./Blues/bu4blues                         16) ./News_Talk/BBC_Radio4  
2) ./Blues/Lemonos_Blues               17) ./News_Talk/BBC_Radio4_Extra  
3) ./Blues/Super_Blues                   18) ./News_Talk/BBC_Radio4_LW  
4) ./Classical/BBC_Radio3            19) ./News_Talk/BBC_World_Service  
5) ./Classical/BBC_Radio6            20) ./News_Talk/RTE_Radio1  
6) ./Classical/lyricfm                     21) ./Pop/Absolute_Classic_Rock  
7) ./Commands                            22) ./Pop/Absolute_Radio  
8) ./Irish/Raidio_na_Gaeltachta    23) ./Pop/BBC_Radio1  
9) ./MPB/MPB10                        24) ./Pop/last_fm 
10) ./MPB/Radio_Mix_Brasil        25) ./Pop/Radio_Caroline 
11) ./MPB/Radio_MPB_Brasil      26) ./Pop/RTE_Radio2 
12) ./MPB/Radio_Qualidade_Brasil 27) ./Pop/Soft_Classic_Rock 
13) ./NewAge/Eternity                  28) ./Pop/Virgin_Radio 
14) ./NewAge/New_Age               29) ./Sports/BBC_Radio5_Live 
15) ./News_Talk/BBC_Radio2      30) ./Sports/BBC_Radio5_Live_Extra 
Type a number or 'q' to quit: 
Now, that's what I call organized. Impossible to get lost here.

OK, this post is already too long.
I'll another on how I got LastFm to play on my RPi wifi radio.









Tuesday, January 22, 2013

Gentoo on RPi -- errors compiling Mesa update

In the version of Gentoo installed from here, the installed version of mesa is 8.0.4.
This has now been superseded by mesa-9.0.1 

However, when I tried to emerge mesa, the install stopped (after about three hours on my little RPi even though I had the CPU overclocked to 850 MHz) after three hours with this error:



In file included from /usr/include/xorg/xf86Crtc.h:26:0,                 from xorg_tracker.h:42,                 from xorg_exa.h:4,                 from xorg_composite.h:4,                 from xorg_composite.c:1:/usr/include/xorg/edid.h:619:6: warning: declaration does not declare anythingIn file included from /usr/include/xorg/exa.h:39:0,                 from xorg_tracker.h:43,                 from xorg_exa.h:4,                 from xorg_composite.h:4,                 from xorg_composite.c:1:/usr/include/xorg/fb.h:95:2: error: #error "GLYPHPADBYTES must be 4"
I had simultaneously updated mesa in Gentoo on my (x86) Desktop without any problem whatsoever.
So, perhaps the armv6j architecture of the RPi was the source of the problem.

I posted my problem to the Gentoo forum and got the fix I wanted. 


As is seen from the thread, the fix involved opening /usr/include/xorg/servermd.h in a text editor (I used leafpad as root) and change

#ifdef __arm32__ 
#define IMAGE_BYTE_ORDER        LSBFirst 
 

#define BITMAP_BIT_ORDER        LSBFirst 

#define GLYPHPADBYTES           4 
#endif                          /* __arm32__ */ 
to 


 #define IMAGE_BYTE_ORDER        LSBFirst 

#define BITMAP_BIT_ORDER        LSBFirst 

#define GLYPHPADBYTES           4 
In other words, just take out the #ifdef and #endif lines.
Now, the compile went perfectly.

As I indicated in the thread, I don't fully understand why this very small change made all the difference.
It really does seem like a bug in the armv6j incarnation of Gentoo.

All thanks to limn for coming up with this.



Friday, January 18, 2013

Gentoo: ndiswrapper wifi connection and setting DNS servers

Gentoo works well on my old Dell E520 (1.86 GHz C2D CPU, 3GB RAM).
In particular, the fact that the emerge package manager compiles everything before install, doesn't create such a massive time problem as it does on my RPi.

Here, I want to outline how I used ndiswrapper to activate my Linksys AE1200 wifi dongle in Gentoo.
Actually, quite a number of guides are available for this end but it seems some recommend unnecessary changes.
So, here I'll give the minimum required (on my system, at least). Every one of these steps is essential.

1. First you need to install ndiswrapper.
Unfortunately, the current stable version 1.57 doesn't emerge without error (struct kernel_stat has no member named 'cpustat').
However, a solution is described in this Ubuntu thread (see post #10).

This involves
i) downloading ndiswrapper-1.58rc1 from here
ii) untar it with

tar -zxvf ndiswrapper-1.58rc1.tar.gz
iii) cd to ndiswrapper-1.58rc1
iv) make
v) sudo make install

2. Download the XP driver for the AE1200 from the Linkysys/Cisco site.

3. Unzip the driver components with
unzip AE1200xp.zip
4. cd to where the components are (probably ~/Downloads/xp/) and issue the command
ndiswrapper -i bcmwlhigh5.inf
5. You need wpa_supplicant but it seems to be already available in the kernel so it doesn't need to be emerged.
You do, however, need to create the file /etc/wpa_supplicant/wpa_supplicant.conf
with the following content (a lot of useful info is available on wifi setup in this forum thread)

ctrl_interface=/var/run/wpa_supplicant
         ctrl_interface_group=wheel      ##You are in the 'wheel' group, aren't you?

        ap_scan-1

       network={     ssid="your network ssid"     ##You must use the quotes

       scan_ssid=1     

       proto=WPA2     

      key_mgmt=WPA-PSK     

     psk="you network password"   ##Again, the quotes must be used

     }

 6. Now, you ask your wireless connection to start at boot by
# cd /etc/init.d          
          # ln -s net.lo net.wlano              ## assuming your wifi interface is wlan0
          # rc-update add net.wlan0 default

7. Now reboot and your wifi should connect.


Now, it's time to get your system to use the DNS servers you want.
There are, in general, a number of ways to do this.

1. Prepend your preferred DNS servers to the file /etc/dhcp3/dhcleint.conf
I've used this in both Ubuntu and Fedora but it's not available in Gentoo.

2. Manually edit /etc/resolv.conf and make it immutable to prevent it being overwritten at boot.
I used this in Gentoo on my Raspberry Pi and it works perfectly.

3. As well as /etc/resolv.conf, Gentoo also offers two further files which can be used to assign servers to /etc/resolv.conf.
These are /etc/resolv.conf.head and /etc/resolv.conf.tail.
You can put as many servers (in the form of lines of the type "nameserver 8.8.4.4") in either file.
Those in the ....head file end up as the highest priority servers, while those placed in the ...tail file are at the other extreme.
I use this in Gentoo on my Desktop and it, too, works without problems.

4. Change your routers DNS servers.





Monday, January 14, 2013

Updating Gentoo on the Raspberry Pi

I have Gentoo with a 3.6.11+ kernel running very well on my 512 MB RAM RPi.
I've already posted quite a few times about my progress in getting Gentoo up and running here, another here, yet another here and here too.

In general it runs well but, as Gentoo compiles everything before it installs it, just like FreeBSD, installs are very, very slow because of the small CPU (even though I have mine overclocked to 850 MHz) and the low RAM (even with the "upgraded" 512 MB).
In an attempt to mitigate these negative influences, I'm using 1 GB of swap space on an 8 GB SDHC Class 4 card.
Perhaps I'd get some better performance had I used the same SanDisk Extreme Pro Class 10 8GB card that I use for Raspbian Wheezy but I didn't have a spare one (they're not cheap. I paid €23 for mine which is 60% of what I paid for my RPi).

I also have Gentoo installed on my Desktop with 3GB of RAM and a 1.86 GHz C2D processor. Installs and updates run about 10 times faster on the Desktop.

Today I'm going to write about an educational adventure I had when attempting to upgrade Gentoo on my RPi.

The first step is to run

sudo emerge --sync
which makes sure the repos are up-to-date.
This runs quickly, even on the RPi, in less than 5 minutes.

Next, I issued this command
sudo emerge --update --ask world
However, this gave me an error during the dependency calculation.
* Error: The above package list contains packages which cannot be * installed at the same time on the same system. 
(sys-apps/net-tools-1.60_p20120127084908::gentoo, ebuild scheduled for merge) pulled in by sys-apps/net-tools required by @system 
(sys-apps/openrc-0.9.8.4::gentoo, installed) pulled in by sys-apps/openrc required by (dev-db/mysql-init-scripts-2.0_pre1-r2::gentoo, ebuild scheduled for merge) sys-apps/openrc required by (sys-apps/baselayout-2.1-r1::gentoo, installed) 
where both sys-apps/net-tools and sys-apps/baselayout-2.1-r1 therefore sys-apps/openrc are required by the system. 
Now, in my frantic googling to resolve this problem, I first came across this very similar problem and a seemingly easy solution which just unmerged one of the conflicting packages.
So, I unmerged openrc-0.9.8.4 even though I knew this package is essential in the boot.
My intention was to update my OS, then re-install openrc.

However, as luck would have it, during the update my overclocked Gentoo froze.
So, a reboot was needed. Oh boy, now what?
Actually, I should mention that the SDCard did actually reboot fully to the Desktop even without openrc.
However, there was no network connection, neither mouse nor keyboard worked and Conky didn't open.

Not for the first time, I was very grateful for the existence of the Gentoo tinderbox site from where I downloaded
/default-linux/arm/armv6j-hardfloat-linux-gnueabi/stable/sys-apps/openrc-0.11.8.tbz2
and moved it to a usb-key.
Next, I placed the Gentoo SDCard into the card-reader of my trusty EeePC901 and made a few changes to ~/.bash_profile (comment out the startx line) and /etc/inittab : uncomment the line

c1:12345:respawn:/sbin/agetty 38400 tty1 linux
and comment out the following line
c1:12345:respawn:/bin/login -f "your user" tty1 >/dev/tty1 >/dev/tty1 2<&1
(although in retrospect, this was probably unnecessary).
Now, I booted to a TTy, logged in as my user, plugged in the usb-key and copied the openrc----tbz2 file to my home directory.
Next, I moved this file to / (as root) and expanded it with this command
sudo tar xfpj openrc..........tbz2
as explained here.
After, this I was able to boot fully to my Desktop with network, mouse and keyboard all working perfectly.
All of this indicates that what I should have done, rather than deleting the older version of openrc was to emerge openrc to its updated version before trying to update world.

Now, to update everything, instead of issuing the command
sudo emerge --update --ask world
following what I learned in this mailing-list thread, I used this command
sudo emerge -Duv --ask world 
However, a further error resulted as shown here:
 * Error: The above package list contains packages which cannot be * installed at the same time on the same system.
  (sys-fs/udev-171-r9::gentoo, installed) pulled in by    sys-fs/udev required by (www-client/google-chrome-24.0.1312.14_beta167497::gentoo, installed)
  (sys-fs/eudev-0::gentoo, ebuild scheduled for merge) pulled in by    ~sys-fs/eudev-0[gudev,hwdb,introspection,keymap] required by (virtual/udev-171::gentoo, ebuild scheduled for merge)
The solution to this problem was simply to emerge udev using
sudo emerge -v1 udev
and now the command
 sudo emerge -Duv --ask world
ran without any problems whatsoever.

So, would I recommend Gentoo as the OS of choice for the RPi?
Well, it's a very interesting and solid OS which presents multitudinous opportunities to develop a more complete understanding of what's going on 'under the hood' in Linux.

It's big drawback if the time required in installing new software and updating.
For example, the update described above took 5 hours on my Desktop but needed 53 hours, that's more than 2 days, on the overclocked RPi.
Of course, the Tinderbox site provides a huge number of pre-compiled binaries ready for direct installation in Gentoo.
So, this can be used to, at least, partly overcome this drawback.
Of course, choosing this route, will remove many of the learning opportunities I referred to above.