Ubuntu live cd’s, now 33% faster
One of the goals for the Lucid cycle was to investigate why it took so long to boot an Ubuntu live cd session. Why is this important I hear you ask? Well the live cd is usually the first thing a potential new Ubuntu user sees. They get an Ubuntu Desktop (or other flavour) cd from their friend/colleague/random person, insert it into their machine, wait for a while and are then presented with a live session. All well and good but if your running on slower hardware, even a different architecture such as ARM, this initial slowness can be orders of magnitude more than a fast desktop/laptop. For example, the ARM images we shipped for Karmic took over 3 minutes to boot into a live desktop session.
How do you boot a live cd session?
The first thing to do was find out why it was slow. There are a few ways to do this but I chose to first use simple time-stamping methods and afterwards, the much prettier bootchart package.
A bit of background on how the live cd session is booted. There are two broad steps in the process of booting a live cd, the first is setting up the environment ready for the session, and the second, you guessed it, is actually booting into the session. Initial hunches were that the first step, setting up the session, was the major cause of slowness so investigations started there.
Casper
Setting up the session is the responsibility of a project called casper. Casper is a set of scripts that are run on boot to do such things as unpack the initial filesystem, add a dummy user, setup languages and keyboard layouts and so forth. Its mainly written in perl.
The time-stamping stage of investigates confirmed that casper was indeed slower than it should be. I'll skip ahead to the bootchart part of the story as thats much more visually interesting.
Casper before

Above you can see the casper section of the live cd boot process. I've highlighted the bits that immediately stand out. The overall boot was 3 minutes and 15 seconds with casper responsible for around 2 minutes of that.
The highlighted bits seemed to have one thing in common, they all interacted with the debconf database. From the debconf programmers tutorial document:
"debconf is a backend database, with a frontend that talks to it and presents an interface to the user. There can be many different types of frontends, from plain text to a web frontend. The frontend also talks to a special config script in the control section of a debian package, and it can talk to postinst scripts and other scripts as well, all using a special protocol. These scripts tell the frontend what values they need from the database, and the frontend asks the user questions to get those values if they aren't set."
So communicating with the debconf database was slowing the boot. Initiating the call, sending the data and receiving a response, was taking up to 4 seconds at a time and when there are many of these calls, they all soon add up.
After many a head-scratching moment it was decided that the best way to solve this would be to initiate the communication once and keep it open so that when debconf was needed, the overhead in setting it up was removed. The implementation details are all in the code history but the results are much easier to show.
Casper after

With a couple of other tweaks besides the debconf one, the boot is now down to 1 minute 53 seconds and casper takes just under 50 seconds of that. There is more room for improvement, pre-generating a default locale (although which locale that would be is a tough choice), pre-generating fonts and looking into SSL, but for now, this is a big win.
The bootcharts above are for the ARM based iMX51 device made by Freescale which is only just beginning to proliferate onto the market. Intel/AMD based machines show an equivalent speed-up.
Conclusion
So there you have it. The next time you boot into a Lucid live cd session it shouldn't take quite so long, and now you know why.
Ubuntu Platform Sprint

So its that time of year again, a great Ubuntu release was made late last year and the team is frantically trying to make the next release even better. So to facilitate this the Ubuntu platform team got together for a sprint in the most awesome city of Portland, Oregon last week. Whoever designed the city must be commended, its easy to explore, well laid out and you never get the sense that you are lost, much kudo's to them.
Anyway, back to team business. The mobile team managed to get a metric tonne of work done (possibly more) in the 5 short days. To date we now have a new default UNR styled UI, 33% faster-to-boot live-cd images (thats across all images, not just ARM), mature and optimized (can you say Thumb2+NEON) images, the Chrome web browser on ARM, greater integration of testing and many, many, bugs squashed. All this and we are only half-way through the cycle.
ARM hardware is only just proliferating onto the market but when it becomes mainstream, we hope our hard work will make Ubuntu the default operating system. The team is working hard to make Lucid the best ever ARM optimized Linux release and we invite you, if you have hardware, to use, test, and contribute to make Linux the choice for ARM hardware.
2010: What will the year bring?
As is tradition each year I post my new years resolutions, mainly to shame myself into at least attempting them. So hear is this years.
XBMC + Acer Aspire Revo = Awesomeness
Its not often that I get suckered into buying something based solely on the advocacy of a few people on a mailing list but when a said few people, on different lists, all recommended the XBMC + Acer Aspire Revo combination almost simultaneously, I went to investigate.
Now I'm a big media fiend, just ask my wife. We now don't have a garage because I went and converted it into a home cinema room (8 foot screen, HD projector, 500+ films archived, DVD+Blueray+HD-DVD sources ...). I hack on the Entertainer Media Center project (although its a little stale at the moment, effort really appreciated) and I'm a former user of XBMC on the first generation XBOX's from Microsoft and now uPNP of the XBOX 360. So when someone says to me they have a £150 tiny and silent PC, running Linux and decoding HD material, I got a little credit card jumpy.
A couple of days later the Revo arrived. I was a little in two minds on whether this was a good purchase or not. I count at least 23 computers in my house so another was probably not a good idea but none-the-less, I justified it as a replacement for the excellent but slow Viglen MPC-L which, coupled with many USB disks, was a great file server. The first thing I did was install Ubuntu Karmic Koala. Out of the box it worked great (no surprise there
). Install the Nvidia drivers, tweak the screen resolution for my plasma TV, install XBMC and away we go. One tweak every media concerned individual must do on this device is to disable compiz. For some reason, on full screen playback, compiz causes video tearing. It took me a little while to figure this out and I don't mind admitting that I was initially disappointed to see video playback on this machine (when compiz was enabled) but my god did things change.
I enabled my old Windows Media Center remote, added all my video sources to XBMC, tweaked the interface a little and now, all I can say is WOW. The Revo+XBMC combo ranks up there with the best of my purchases. The interface is wonderful; the little things like showing you the actual time a video you are watching is going to end, the UI which puts every set-top-box maker to shame and the shear extensibility of the thing is immense. I won't even mention that this is running Ubuntu, doing my work-related backups, downloading (legal) torrents, running scripts, mail, and a whole host of other services, and drawing a trickle of power.
If your considering replacing a uPNP enabled XBOX (which I did) or PS3, getting rid of your aging server or just wanting a great media experience, I whole-heartedly recommend this combination.


Hi, my name is Jamie Bennett. I'm a technologist, programmer, researcher, tech evangelist, open source monkey, linux user and self confessed gadget freak.
I also work for 