www.linuxuser.co.uk
8 PAGE
SPECIAL
RASPBERRY PI
FOR THE GNU GENERATION
THE MONTHLY MAGAZINE
Build a smart TV
•
Automate your home
Run Android apps
•
Make a car-puter
ALSO INSIDE
»
GNOME 3.6: our verdict
»
Create a network of RasPis
»
What happened to GNU Hurd?
Android
Raspberry Pi
Install
on your
Make GNOME extensions
Add new features and
functionality to GNOME 3
Make GNOME extensions
Add new features and
functionality to GNOME 3
Ultimate office
suite revealed!
The best open source
alternatives to MS Office
$99 Supercomputer
Adapteva’s founder
introduces us to the
of expert
advice
30
+
pages
Full pg.indd 1 29/10/2012 10:01
WorldMags.net
WorldMags.net
Gareth Halfacree
has been breaking, fixing, tinkering and voiding warranties on electrical items for many years, without once receiving a fatal electric shock. This month Gareth brings us the story of the $99 supercomputer (pages 48-51) and reviews the latest release in network-attached storage.Joey Bernard
is a true renaissance man,splitting his time between building furniture, helping researchers with scientifi c computing problems and writing Android apps (when the kids let him have some time). This month Joey serves up two tutorials on server monitoring and Emacs, on pages 30-33 and 38-41.
Kunal Deo
is a veteran open source developerleading multiple open source projects. He is also a KDE dev and has contributed to many projects including KDE-Solaris, Belenix and Openmoko. In this issue Kunal demonstrates how to build GNOME Shell extensions in his step-by-step tutorial on pages 52-55.
Jon Masters
is a Linux kernel hacker who hasbeen working on Linux for almost 17 years, since he fi rst attended university at the age of 13. Jon lives in Massachusetts and works for a large enterprise Linux vendor. As well as running kernelpodcast.org
he keeps us up to date on the Linux kernel with his column on page 12.
Liam Fraser
is the creator of theRaspberryPiTutorials YouTube series and is a Linux server administrator of the Raspberry Pi Foundation. This month Liam shows us how to build a network of Raspberry Pis with centralised storage. You can find his article starting on page 56.
Rob Zwetsloot
studied aerospace engineering at university, using Python to model complex simulations and configuring Linux HTPCs. This issue Rob reminds us why LibreOffice is the greatest office suite in open source (pages 70-74) and shows us how to install Android on the Raspberry Pi in our cover feature.Yo
ur t
ea
m o
f L
in
ux e
xp
er
ts
…
Get in touch with the team:
[email protected]
Welcome
to issue 120 of Linux User & Developer
Welcome to the latest edition of Linux User & Developer,
the UK and America’s favourite high-end open source
and Linux magazine.
The clocks have gone back and Christmas is fast
approaching. While we’ve got some special treats lined up
to mark our fi nal issue of 2012 next month, we’ve worked
particularly hard this issue to ensure you’ve got plenty of
projects to keep you out of trouble as the evenings draw in.
The Raspberry Pi owners among you are in particular luck – we’ve
got an eight-page special looking at how to get Android up and
running, starting on page 22. While there’s still plenty of work to do
to get the drivers working smoothly with 3D and media applications,
Android opens up a whole world of new possibilities for your $35
computer and we can’t wait to see what the community does with it
over the coming months.
If you’re feeling particularly adventurous you could join Joey
Bernard over on page 38 as he uses Emacs to create to-do lists. If
you’ve never dabbled with Emacs before, you’ll probably want to do
some extracurricular homework fi rst – even the keyboard shortcuts
can be demanding to the uninitiated.
Finally a quick mention to Parabella, a Kickstarter project that’s
come to be known as ‘the $99 supercomputer’. Check out our
interview with its creator starting on page 48 – it looks like the
Raspberry Pi might have some serious competition…
Russell Barnes, Editor
Buy online
Get
Linux User
for £4.19
per issue
Page 20
»
Install Android on RasPi
»
Build GNOME extensions
»
Monitor your home server
»
Organise yourself with Emacs
This issue
Visit us online for more news, opinion, tutorials and reviews:
www.
linuxuser.co.uk
Contents
Join us online for more Linux news, opinion and reviews www.
linuxuser.co.uk
www.
linuxuser.co.uk
4
06
News
The biggest stories from the open source world
12
Opinions
The latest from our regular free software columnists
94
Letters
Your views on the magazine and the open source scene
Open
Source
96
Cover disc
Test four of the latest distros:
On your free disc
Ubuntu 12.10, Kubuntu
Xubuntu
Lubuntu
Tutorials
30
Monitor your server with tmux
Remotely check your server in easy steps
34
Create and manage boot scripts
and startup applications
Automate your startup experience
38
Make an open source to-do list
with Emacs
Use Emacs to organise your workfl ow and take control of your time
Developer tutorials
Features
16
Get on board
with Python
Reporting back from PyCon
22
Install Android on
the Raspberry Pi
A world of new possibilities
42
Where’s the Hurd?
We investigate the true kernel of the GNU OS
48
Supercomputing for
the masses
We talk to Andreas Olofsson about Parallella
70
Office suite super-test
Four of the best in open source go head-to-head
86
Q & A
Your problems solved!
F
EA
TU
RE
16
Get on board with Python
Linux User’s Richard Smedley reports back from this year’s PyConUK event. Catch up on all the action and learn why Python’s community is one of the best there is.
52
Build extensions for the GNOME
desktop environment
Exploring GNOME 3’s best new capability
56
Create a network of
Raspberry Pis
Bring several Pis together on a network with centralised storage and more
Reviews
Open up a world of new
apps and projects in
just a few easy steps
22
Install Android on
the Raspberry Pi
62
Samsung Galaxy
Note 10.1
The Note migrates to the tablet form factor in fine style
64
Synology DS213air
Synology’s latest small and home office NAS box66
Archos 101XS
Archos adds keys to its latest tablet
68
GNOME 3.6
GNOME moves further down the path of simplification
70
Office suite group test
Four of the very best open source suites battle it out76
CAINE 3.0
We rate the latest build of this penetration-testing distro
78
Ubuntu 12.10
We score Canonical on Ubuntu’s new (and controversial) features
80
Fractal Design
Defi ne R4
The perfect home server case?
82
GNOME Shell Remix
Ubuntu with GNOME 3 Shell
Subscribe
today!
20
Save at least 30%
on the shop price. US customers can subscribe via page 83
004_LUD_120 PK.indd 4 02/11/2012 17:27
WorldMags.net
WorldMags.net
Get MORE with a
Dedicated Server
from Webfusion
This year’s must have tech included FREE!
Until the end of 2012, purchase any* Dedicated Server from Webfusion and you will be the
proud owner of the technological marvel that is the Raspberry Pi. Our dedicated servers give
you the control and reliability you need for your internet presence.
Core dedicated server features:
• Up to 2x Intel Xeon E5640 2.66GHz CPU’s
• Up to 32GB RAM
• Up to 4 SATA or SAS hard drives
From
£119.
99
per month
CALL SALES NOW on 0808 163 4509 or visit www.webfusion.co.uk/Pi
• Unmetered data transfer
• FREE Plesk 11 control panel included
• Managed and Self-managed options
06
News
|
12
Opinion
|
94
Online
Samsung has announced another entry in its Chromebook partnership with Google, making the move away from x86-based Intel processors with an ARM-based ultra-compact device aimed at buyers on a budget – or, as Google itself would have it, a “computer for everyone.”
Based on Samsung’s existing Chromebook platform – a cut-price family of low-power laptops which use Google’s Chrome OS, based on the open source Chromium Linux cloud-powered operating system – the new Samsung Chromebook replaces the typical lightweight x86 Intel chip with a dual-core Exynos V ARM-based processor, a quad-core version of which can be found in Samsung’s fl agship Galaxy S III Android smartphone.
Running at 1.7GHz, the chip includes a quad-core ARM Mali-T604 graphics processor which handles both the HDMI display connector
www.
linuxuser.co.uk
6 is not p r o v i d e d to the public under an open source licence. Much of the code, however, is: Chrome OS itself is based on the opensource Chromium OS, while the embedded Chrome browser is available as the open source Chromium project.
For consumers, the cut-price Chromebook could well be an entry point into Linux as a day-to-day operating system. For those who know their way around a shell already, the presence of a development mode – accessed by holding Esc, Refresh and Power then pressing Ctrl+D at the boot screen – provides a way to boot from external devices, replace the operating system and turn the Chromebook into a low-cost ARM-based laptop running almost any Linux-ARM-based operating system.
Google, meanwhile, is positioning the Samsung Chromebook as the answer to Windows users’ prayers. “There’s no need to worry about security updates and maintenance is easy; all you need to do is charge the battery,” boasted Google’s Sundar Pichal, senior vice president of the company’s Chrome division at the launch. “It just works.”
Without a Linux kernel at the new machine’s heart, it’s unlikely Pichal would have been able to make such a declaration.
The new Samsung Chromebook is available through Google Play, Currys and PC World, priced at £229.
Entry-level Linux-based laptop takes
aim at the mass market
HARDWARE
Google &
Samsung
launch ARM
Chromebook
■ TheSamsung-manufactured Chromebook uses an Exynos V ARM-based processor and runs the Linux-based Chrome OS and the integrated 11.6-inch 1366x768 display.
Storage is handled by an eMMC 16GB solid-state storage device – helping the Chromebook hit a headline-grabbing sub-10-second boot time – while 2GB of DDR3 memory is included as standard.
A switch to an ARM processor more commonly found inside smartphones provides the Chromebook with impressive battery life, with around six hours easily available during web-connected usage. More importantly, the use of web apps in Chrome OS – which are rendered through an embedded version of Google’s Chrome web browser – avoids any compatibility issues with legacy apps that normally accompany a shift in architecture.
The specifi cations aside, Google’s positioning of the device as a computer for everyone is interesting indeed. As well as selling the system through the Google Play marketplace alongside its Nexus 7 Android tablets, the company has organised high-street placement for the Chromebook in major chains throughout the world – and just in time for Christmas. In other words, a major brand is attempting to put Linux on the laps of millions – and where Google leads, others are likely to follow.
Detractors of the Chromebook project often point out that it’s not a truly open platform: like Android, Google develops Chrome OS privately and often includes code which
006-010_LUD_120 PK.indd 6 02/11/2012 17:34
WorldMags.net
WorldMags.net
The latest in the Linux community
News
OPEN SOURCE
06
News
|
12
Opinion
|
94
Online
Linux
calendar
29 N
ov 2
01
2
Android Magazine –
issue 19
»www.littlegreenrobot.co.uk
Android Magazine, your best and
only print source for everything Android, is coming out today. Check out what’s in store over on page 60.
CloudStack
Collaboration
Conference
»The Venetian, Las Vegas, Nevada
»USA
»http://collab12.cloudstack.org/
The Apache-run conference will have presentations from the developers contributing to the Apache CloudStack project, as well admins who are using CloudStack to build clouds to scale.
30 N
ov - 0
2 D
ec 2
01
2
Users testing the cutting-edge build of Firefox for Android, from the Aurora branch, are now able to access Mozilla’s Firefox Marketplace. Designed as an answer to Google’s Chrome Store, the Firefox Marketplace provides free and paid-for web apps which are designed specifically for the open source Firefox browser.
While users have been able to test the Marketplace on desktop Firefox releases for some time,
the addition of support in the Aurora Firefox for Android build marks the fi rst time it has been available on mobile devices.
Sadly, the service is still closed off from some: Mozilla’s decision to focus exclusively on developing for the ARM architecture means Firefox for Android can’t be installed on devices with Intel’s x86-based Atom processor, like the Motorola Razr i smartphone.
The Aurora build of Firefox is at: www.mozilla.org/mobile/aurora.
Canonical founder Mark Shuttleworth has announced that selected aspects of Ubuntu 13.04, codenamed ‘Raring Ringtail,’ are to be developed in secret so as not to attract criticism from the community.
Going against the open source ethos of transparent development, some new features to be launched with Ubuntu 13.04 will be kept under wraps at Canonical’s HQ until the OS is ready for release – a move which appears to have much to do with community backlash over the switch to the Canonical-developed Unity desktop environment and the numerous glitches and bugs that followed.
Described by Shuttleworth as “a few items with high ‘tada!’ value,” the precise portions of the OS which will be hidden until launch have
not been detailed. Those who are interested can apply for access, however, with Shuttleworth claiming that Canonical is “happy to engage with contributing community members that have established credibility in Ubuntu.”
“The skunkworks approach has its detractors,” Shuttleworth admitted in a statement to the community. “We’ve tried it both ways and, in the end, fi gured out that critics will be critics whether you discuss an idea with them in advance or not. Working on something in a way that lets you refi ne it till it feels ready to go has advantages: you can take time to craft something, you can be judged when you’re ready, you get a lot more punch when you tell your story, and you get your name in lights.”
The secretive projects, which Shuttleworth claims are all “groundbreaking in free software”, cover areas such as web standards, cryptography, and aesthetic and performance improvements, with Canonical keeping each under close guard until launch and inviting only pre-vetted members of the Ubuntu community to help with their development. With Canonical already under the spotlight for what is seen as an increasingly negligent attitude to its community of users and developers, and to the open source community in general, this latest announcement is likely to do little to cool the fl ames gathering against the company.
OPEN SOURCE
Canonical hides Ubuntu 13.04
development from the community
LISA ’12
» Sheraton San Diego Hotel and
Marina, San Diego, California
» USA
»h t tp s: //w w w.us eni x .or g /
conference/lisa12
In addition to the wide variety of topics covered in the LISA ’12 programme, the programme committee has created three specifi c conference themes, or tracks, for those looking to focus on a key subject; these cover the areas of cloud computing, IPv6 and sysadmin skills.
09
-1
4 D
ec 2
01
2
Shuttleworth blames critics for new secretive strategy
■ Marketplace is now available on Android, providing a new route for installing web apps
ANDROID
Mozilla opens Firefox
Marketplace on Android
■ Mark Shuttleworth, seen here on board the
International Space Station, is hiding some parts of Ubuntu 13.04 from the community
INDUSTRY
Your source of Linux news and views
OpenSource
Contact us…
Register and post your comments…
www.linuxuser.co.uk/forum/ Email us directly…[email protected]
Windows 8 harms user freedom
The launch of Windows 8 occurred very recently – Microsoft’s new, one-size-fi ts-all operating system for desktop, tablets, and smartphones. Thanks to the Interface
Formerly Known As Metro, the folks at Redmond plan to claw back their market share in the PC space by fi nally cracking the portable computing market. Or at least, that’s the idea. Microsoft is going through the same motions that Canonical and GNOME have done in recent years, trying to convince people that their interfaces are fi ne for mouse and keyboard even when the results seem to contradict this.
On the day of launch, Jim Zemlin, executive director of the Linux Foundation, wrote a blog on how Windows 8’s hybrid approach is too little too late:
“A lot has changed in the three years since the last major Windows announcement. Netbooks were on the rise. The iPad wouldn’t be introduced for another six months and Nokia still had the lead for most smartphone sales in the world… that is no longer the case. Google’s Android OS only accounted for a 3.9% share of the smartphone market in 2009 (according to Gartner Group); last year that rose to 64% of the smartphone market. In 2011, smartphones for the fi rst time outsold PCs (including tablets). With hundreds of millions of those smartphones running Android, the consumer market is fully accustomed to Linux-based software.”
Zemlin argues that we are living s o m e w h a t in a post-desk top w o r l d , or at least
www.
linuxuser.co.uk
8The recent release of Windows 8 has caused
concern for the leaders of the free software world
it’s basically Windows 7 with new surveillance ‘features’ and even more restrictions on users’ freedom. Whether or not Microsoft wants you to know it, it’s easy to switch to free software instead of choosing a downgrade to your rights as a computer user – for example, your rights to know what the system is doing and to change behaviours you don’t like. We’re here because we want people to know that they don’t have to buy Windows 8 – this is a great time to upgrade to free ‘as in freedom’ software.”
■Libby Reinish says that Windows 8 cuts
down on user freedom well into a transition period, and Linux is
helping to drive this as the base for Android and Chrome OS.
“Microsoft is stuck in the liminal space between the desktop-driven, cost-per-software licence world they dominated and the era we are just now entering: a world driven by open source software and services,” continued Zemlin, pointing out that the price of Microsoft hardware is up to six times more than hardware powered by Linux. He attributes this to companies like Google not having to spend so much on R&D, with the Linux kernel and its estimated $10 billion (£6.2 billion) worth of development readily available, along with FOSS such as WebKit.
The Free Software Foundation agrees with this, and activists set out on the morning of release to New York’s Microsoft store to hand out pamphlets to the people braving the cold to attend the launch event. In it, they warned of the dangers of proprietary software:
“Microsoft has already spent almost 2 billion dollars on slick advertisements to convince people that Windows 8 will revolutionise the way they use computers,” said Libby Reinish, campaigns manager at the FSF. “The fact is,
■The gnu is a symbol
of software freedom
■Jim Zemlin believes that
mobile computing is the future
C C: w w w .fs f.o rg C C: w w w .fs f.o rg 006-010_LUD_120 PK.indd 8 02/11/2012 17:34
WorldMags.net
WorldMags.net
WorldMags.net
The latest in the Linux community
News
OPEN SOURCE
Imagine Publishing’s All About Space magazine is available in print and digital formats right now. Packed full of cosmic
content, All About Space delves into the wonders of space exploration, astronomy and space science every month, providing in-depth knowledge from a team of experts on an amazing array of topics. The magazine is unlike anything else out there and will appeal to seasoned space fans and new explorers alike, with a regular dose of amazing articles, exclusive interviews and jaw-dropping images.
Inside you’ll fi nd some mind-blowing articles and features explaining the amazing universe around us. The latest issue reveals how some of the biggest explosions in the universe, namely
All About Space, the most exciting
space magazine ever, is out now!
PUBLISHING
supernovas, work. There are also excellent articles on tracking hazardous asteroids, the fi rst moonwalk, NASA’s fi rst space station, the groundbreaking Cassini mission and much more. All About Space also makes astronomy accessible to everyone with a host of stargazing articles explaining how to buy a telescope and what to look for in the night sky.
All About Space is available online at the Imagine eShop (www.imagineshop.co.uk) and in all good newsagents and supermarkets right now. You can also download the digital version for iPhone, iPad and Android from www.greatdigitalmagazines.com. Visit the magazine’s website at www.spaceanswers.com to get your online space fi x.
Unsure what to get sysadmins, coders
or FOSS advocates this Christmas? We
might have an idea for you
It’s only a month until Christmas now, and while the more organised folks may have already got gifts for all their family, friends and secret Santas, the rest of us have probably been a bit too busy to even figure out who’s getting gifts. Well, Linux User is here to give
you a helping hand as we’re offering 10% off on all orders from the ImagineShop until 24 December 2012.
This offer is valid on subscriptions to the magazine, back issues of Linux User, bookazines such as the Linux & Open Source Genius Guide Vol. 2, and DVDs from Web Designer. There are further discounts available on all of these that you can fi nd out about on page 75. You should also keep an eye on our Twitter feed – we regularly tweet out links for fantastic subscription deals that you can redeem on the ImagineShop, such as getting the fi rst three magazines in a subscription for £1 each.
So if you’re scrambling for a present to give to a tech friend or colleague, you can sit back and get them some magazines from the comfort of your desk chair, and properly enjoy the holiday season.
In case you missed it, Linux User magazine is available to read on any digital format thanks to the excellent digital editions super-site,
www.greatdigitalmags.com. The site
brings together Linux User’s offerings on Zinio and Newsstand, allowing you to enjoy your favourite mag on your Mac, PC, iPad, Android and a host of other devices. There are some incredible subscription incentives up for grabs too, not just for Linux User but for all Imagine Publishing titles. To find these amazing deals, head over to www.greatdigitalmags.com, where you can find links to back issues, subscriptions and more, across almost every platform. It’s all available in just one place, and there are massive savings to be had!
PUBLISHING
Grab Linux
User digitally at
greatdigitalmags.com
Imagine Publishing’s All About Space
All About Space, the most exciting
space magazine ever, is out now!
supernovas, work. There are also excellent
■ All About Space
shows you how to get stargazing
All About Space
PUBLISHING
Save 10% on all Christmas
orders of Linux User
Your source of Linux news and views
OpenSource
Contact us…
Register and post your comments…
www.linuxuser.co.uk/forum/ Email us directly…[email protected]
www.
linuxuser.co.uk
10
There have been plenty of valid concerns regarding the future of computing with regard to UEFI Secure Boot, mainly with how it will lock out people wanting to install a Linux distribution. The
Linux Foundation has been following the situation and has decided to take action by purchasing a key from Microsoft, and signing its own small pre-bootloader that will be available to all users of open source. The Linux Foundation explained the reasoning behind this move in a blog post:
“The Linux Foundation is committed to giving users freedom of choice on their platforms. Conforming to this stance, we have already published a variety of tools to permit users to take control of their secure boot platforms by replacing the Platform Key and managing (or replacing) the installed Key Exchange Keys… however, as one of the enablers of the Linux
ecosystem, the Foundation recognises that not everyone is willing (or able) to do this, so it was also necessary to fi nd a solution that would enable people to continue to try out Linux and other open source operating systems in spite of the barriers UEFI Secure Boot would place in their way and without requiring that they understand how to take control of their platforms. Therefore, we also formulated a technical plan, which is implemented in this pre-bootloader, to allow distributions to continue functioning in a secure boot environment.”
The source code for the pre-bootloader is available at the moment without the key, and you can get it from the Git repo as Loader.c. The Linux Foundation admits that it will take a little time for the key and signature to be obtained, but it will announce when it receives one.
Foundation takes action to ensure everybody can continue
using open source operating systems
OPEN SOURCE
The Linux Foundation obtains UEFI key
announce when it receives one.
Ubuntu is a free operating system, free as in speech and as in beer, and Canonical is keen to reinforce this Richard Stallman ethos as it announces a new way for users to optionally contribute to Canonical before they download the desktop version of Ubuntu. This comes in
the form of real money donations.
It’s not just a fi xed donation – there are eight categories that people can selectively give money to. This will let Canonical know which parts of Ubuntu people want improved. Categories include Unity, performance optimisation, hardware support, phone and tablet versions, support of different Ubuntu fl avours, and a general tip to Canonical. You don’t have to give to each category, though, and donations start at $1 per category.
Obviously you don’t have to make any contributions if you don’t want to – although
Users can now tell Canonical
what parts of Ubuntu need
work, for a price
Now that Ubuntu 12.10 is out and more people will be downloading the distro, it will be interesting to see what contributions are made, and what they go towards. You can see the page by selecting Ubuntu Desktop (and then a version) at: www.ubuntu.com/download.
■A screen Ubuntu users may have to get used to
■ The Linux Foundation’s goal is to
promote and protect the Linux kernel
■The future
of firmware interfaces is closed
the donation page shows up before you can download the ISO, and has a recommended $2 donation to each category already fi lled in by default. There’s a link at the bottom of the page to skip it entirely and go straight to the download page.
OPEN SOURCE
Donate to Canonical
and steer Ubuntu
006-010_LUD_120 PK.indd 10 02/11/2012 17:54
WorldMags.net
WorldMags.net
0844 335 1211
DOMAINS
|
|
WEB HOSTING
|
eCOMMERCE
|
SERVERS
FULL DNS CONTROL
Complete DNS and Contact Management via our
easy-to-use 1&1 Control Panel
1&1 DOMAIN APP
Check and register domains on-the-go
SUPPORT
24/7 phone and e-mail support
With more than 11 million customer contracts, over £2 billion in
annual turnover, 5000 employees, 18 million registered domains
and 5 high-performance data centres, we are one of the world’s
largest web hosts and a leading domain registrar.
TRUST THE UK’s NO. 1
Included with all 1&1 Domains:
■
Subdomain creation and redirection
■
Masked URL Forwarding
.co.uk
.com
.info
.net
.org
.co
Starting at
£
0
.99
fi rst year*
1&1 DOMAINS
SECURE YOUR DOMAIN AND SAVE!
210x297
www.
linuxuser.co.uk
12
Your source of Linux news and views
OpenSource
Jon Masters summarises the latest goings-on in
the Linux kernel community, including a look at the
features being merged for the upcoming 3.7 release
Jon Masters
THE KERNEL COLUMN
Linus Torvalds announced the release of the 3.6 kernel, saying that while the release did not contain earth-shattering new architectures or fi le systems, it did overall represent “solid progress”. We summarised
some of the new features that landed in Linux 3.6 last issue. With the release of 3.6 came the traditional opening of the merge window for 3.7. This is the period of time during which Linus is willing to pull potentially disruptive patches (changes) into the kernel. This typically lasts for two weeks and is followed by a period of stabilisation, and multiple RC (release candidate) kernels are made available for testing. Linus gave a heads-up that he would be travelling for much of the merge window, but that didn’t seem to pose much of a problem.
Features pulled in during the merge window included a brand new architecture (AArch64, also known as ARMv8 or ‘arm64’ in the kernel community). This is the latest architecture revision from ARM, the company that powers about 90 per cent of all cellphones and has had its designs shipped in billions of processors so far this year alone. ARM has traditionally been an ‘embedded’ architecture. The billions of ARM-powered processors in use worldwide are typically found within gadgets, such as this author’s ‘fi tbit’ personal step counter, or in
washing machines and automotive control and entertainment systems. In this context, there are many different levels of ARM processor, from the more deeply embedded simpler cores without the ability to run a full OS, to higher-end multiprocessor cores running Linux on Android smartphones.
ARM is known for its focus on low energy, as well as the licensed nature of the architecture. ARM doesn’t make processors – it licenses its designs for use by the many others who do make processors. Linux has run on suitable 32-bit ARM-based systems for well over a decade, and in recent years has gained popularity as the foundation upon which most Android devices are built. And over the last few years, organisations such as Linaro have helped to drive the development of Linux support for ARM by bringing together a wider community of companies and ecosystem players involved. Over the past few years, a new opportunity has emerged to take advantage of the low-energy DNA that drives ARM by using these processors in server-class systems.
Servers can be 32-bit based, but many workloads require 64-bit support. That’s where the new AArch64 ARM architecture comes in. It brings many new features to ARM, not least of which is 64-bit addressing. The new support within the Linux kernel, contained within arch/arm64 (renamed after community debate around the original ‘aarch64’ choice of directory) enables the core architecture features but does not yet have support for any real processors. Those will come later. The initial support was merged after several months of review on the Linux Kernel Mailing List by upstream maintainers such as Arnd Bergmann, who is responsible for many of the de facto standards required of new architecture code added to Linux.
Jon Masters
is a Linux kernel hacker who has been working on Linux for almost 17 years, since he fi rst attended university at the age of 13. Jon lives in Cambridge, Massachusetts, and works for a large enterprise Linux vendor. He publishes a daily Linux kernel mailing list summary atkernelpodcast.org
012-013_LUD_120 PK.indd 12 02/11/2012 17:37
WorldMags.net
WorldMags.net
The kernel column – Jon Masters
Opinion
open source
Another feature pulled into Linux 3.7 is support for the ‘supervisor mode access prevention’ on Intel processors. This aims to prevent kernel code from being able to compromise the running system, even if it is exploited by passing bad values in from user space (such as were done by various example ‘NULL’ pointer kernel exploits several years ago). By toggling a special bit in the CPU control registers, the kernel can effectively instruct the hardware to prevent the kernel from accessing user space (regular user process) memory except under explicit control. Therefore various classes of exploit are removed because even though the kernel has the power to disable the protection again, a simple pointer access to user space cannot simultaneously disable the SMAP protection, so exploit code has no straightforward way to use such simple attacks.
One final feature of particular note in 3.7 is the removal of udev from the critical path of loading some system firmware. The kernel’s built-in firmware loader will now always attempt to load firmware files directly from user space (from the file system) without invoking udev. Udev (the user-space device management daemon) typically handles firmware loading, as well as device driver requests, and new hardware device detection, by receiving messages from the kernel over a special netlink socket and reacting according to various customisable rules. Unfortunately, recent changes to udev to restructure its approach to parallelised loading of drivers frustrated Linus into having the kernel handle this itself by default. Udev can still handle firmware loading, but the kernel will first attempt to load files itself, from /lib/firmware.
Alignment faults in 3.6
Linux supports many different architectures, some of which behave quite differently from the x86 Linus originally used way back in 1991. In particular, many modern RISC architectures embrace the notion of simple being better by having limited support for ‘misaligned’ memory accesses. On these architectures (such as ARM), it is not possible to directly perform an operation on a memory location. Instead, the architecture behaves in a ‘load store’ fashion such that all memory locations must be loaded into a register, then manipulated, then the result stored back.
Alignment is a natural property of all data types. A 4-byte integer value, the default on many systems, has a natural alignment on a 4-byte memory boundary. So, for example, attempting to load or store such a value at an odd-numbered memory address would be in clear violation of the natural alignment requirement of this type. Many modern architectures hide such alignment issues by having the hardware perform expensive multi-load operations behind the scenes under such circumstances, while others will generate an alignment fault and insist that the programmer (or the compiler) do the right thing and fix the underlying code. ARM is one such architecture that started life with very strict requirements, and has relaxed more recently.
Modern ARM systems do include (limited) support for unaligned data access. Though they are more expensive (in terms of performance overhead), they are handled behind the scenes. There are some circumstances under which this is not possible due to specific instructions being used. In such cases, the hardware will generate an ‘alignment fault’, which will be handled by the kernel. The kernel typically performs a more expensive version of the intended load or store ‘transparently’, optionally recording a warning about the inefficient waste of processor
“Linus said he would be travelling
for much of the merge window”
resources. During this operation, it may make a call to the kernel’s schedule() algorithm to give another process time to run. Unfortunately, there are some situations wherein the scheduler must not be called. These include certain critical ‘atomic’ parts of the kernel itself. In the case of Linux 3.6, it appeared as if this required was being violated, with warnings of ‘scheduling while atomic’ being emitted.
It ultimately turned out that certain device drivers were exposing a problem in the alignment handler. By accessing misaligned IP header fragments, the driver concerned was triggering an alignment exception within an atomic-critical section of kernel code, which was then resulting in the scheduler being called from within the alignment handler. Although the driver was later fixed to improve performance (by using only aligned data), the problem with the alignment handler itself did require fixing to prevent unwanted system crashes. A patch has been successfully tested and will be merged.
Finally this month, there has been an ongoing discussion around ext4 file system corruption that can occur under very specific circumstances involving a system crash during an update to an ext4 file system running with journal checksums turned on. This is not the default, and it is a rare situation, but all users are advised to update their systems.
n Linus Torvalds: the 3.6 kernel is “solid progress” C C. G FD L. P er m is si on o f M ar tin S tr ei ch er , E di to r-in -C hi ef , L IN U XM AG .c om
WorldMags.net
THE OPEN SOURCE COLUMN
www.
linuxuser.co.uk
14
Your source of Linux news and views
OpenSource
Apple’s latest product launch was
met with disdain from many of its
customers. But why, wonders Simon
Throwing away
an iPad
Simon Brew
is a technology writer and editor, working across the Linux, Windows and Mac OS X platformsThrowing away
Watching the live reactions to an Apple announcement rarely tends to expose you to some of the more considered thoughts on a product launch. Yet the response to Apple’s unveiling on 23 October of a pair of new iPad products was a testament to just how warped the technology business has become.
Appreciating it’s traditional to bash Apple at every opportunity, I fi nd myself admiring the fi rm in some ways. Granted, its closed gate approach to computing is something that continually needs fi ghting, but its marriage of software and hardware remains pretty much unparalleled over the past decade or so.
At Apple’s event in October, though, it sprung a surprise. It had widely been expected that the fi rm would showcase the iPad mini, and that’s exactly what it did. But then it had something else up its sleeve: a fourth generation of the iPad. This was just over half a year after it had launched the third generation of the iPad to similar fanfare. And people were not happy.
To paraphrase what, at one stage, was appearing to be something of a consensus, the feeling seemed to be ‘but I only bought one of those half a year ago, and now they’ve gone and changed’.
So let’s think about that for a second. What Apple has successfully propagated is a feeling among its customers and many in the technology world that you absolutely have to have the latest and greatest. Notwithstanding the fact that the original iPad is still doing the job that it was designed for perfectly well, there appears to be abject horror in places at the thought that people will have to upgrade a product that was only new on the shelves earlier in the year.
■The mini wasn’t the only new iPad launched
The Android
fightback?
But where did this craving come from? What new feature does the fourth-generation iPad possess that the third didn’t, that people can’t possibly live without? Within minutes of the announcement, eBay was no doubt fi lling up with pretty much brand spanking new iPads, as the disposal culture of modern technology continues to take hold.
That in itself is a burgeoning problem. Firms like Apple like to lock us out of upgrading products, and even the likes of HTC is now making phones where you’re not even allowed to change the battery yourself (when did we start to accept this insanity as the norm, I continue to wonder). The ramifi cation of this, longer term, is that more and more people will just throw something away after a year, in order to get the latest model. People will change their phone just because it’s less hassle than sending it off to get a new battery put in. That’s madness, isn’t it?
What Apple’s announcement showed is that you don’t actually need to add that much for people to instantly decide to spend another £500 or so on another piece of technology, just to keep up with the proverbial Joneses. Wouldn’t it be refreshing, though, if a fi rm such as Apple, that has so blazed the trail for persuading people to replace their technology on an annual basis, actually made a stand to say enough is enough. It’ll never happen, but just how long can the world at large support a culture where intricate technologies are so disposable? Looking at the reaction to the aforementioned Apple launch, it’s going to have to do so for a great deal longer, sadly…
In the smartphone sector, Android continues to lead the way over Apple and its iOS-based products. In tablets, its success has been less signifi cant, but might there now be signs that Android-based competitors are making inroads? Certainly products like the Nexus 7 and – to a lesser extent – the Kindle Fire help. But there’s a long way to go to topple Apple and its all-conquering (so far) iPad.
014_LUD_120 PK.indd 14 02/11/2012 17:39
WorldMags.net
WorldMags.net
The free software column
Opinion
open source
the Free soFtware column
as everybody knows by now, the raspberry pi is the perfect geek toy, a credit-card-sized computer that costs very little and comes with its own operating system, raspbian, which is an optimised reworking of Debian Gnu/linux.
The Raspberry Pi can be plugged into a TV and a keyboard, and will do most of the useful things a PC can do. An SD card is used for booting and storage of data. Raspbian defaults to an LXDE desktop, and comes with development tools and most of the basic applications and utilities for working and playing on a computer. The Raspberry Pi is also shockingly cheap – $35.
But the interesting part of the Raspberry Pi is the ambition of its caretakers that it should become an ultra-low-cost tool for introducing schoolchildren to the lost idea that computer programming can be fun, as it was for the kids who grew up with the Sinclair QL, ZX Spectrum or BBC Micro three of four decades ago. The early home computers were cheap and cheerful, but you could get inside and look at the source, take them apart and learn.
Some of the kids who grew up with BBC Basic, Dungeons & Dragons and Pac-Man became the first generation of developers to work on Linux and other free software. Jeremy Allison, for instance, had a Sinclair QL, which was a 32-bit
The Raspberry Pi can be the affordable route
to teaching schoolchildren the lost idea that
computer programming can be fun
raspberry pi for schools
machine, even though it had an 8-bit bus. The source code of the operating system, QDOS, was included, perfectly legally.
“The assembler source, the commented source, you could buy and look at, and take apart and understand,” says Allison. “It was burnt into ROM, but you could modify it – there was a company that had disassembled it for me, legally – and then along came the IBM PC and Microsoft and crushed all the creativity out of it, just ground over it with a tank tread.
“So the kids growing up these days don’t know any of that stuff. They don’t know the basics of how the thing works. They’ve got black boxes that rattle because they’re broken, and they can’t look inside. You can’t learn from that.”
“I want anyone in the world to have the same opportunities that I had when I was growing up”, adds Allison. “The early Eighties was a period of intense creativity in the computer industry in Britain.”
But ICT in schools went backwards in the UK and has been locked in to a costly Microsoft-only world, where children have been educated as users rather than doers. Lock-in and the upgrade cycle have resulted in the same escalating costs that have afflicted other sectors of the IT industry, forcing increased expenditure for smaller and smaller returns.
For most children, ICT in schools has been little more than a training programme for using Windows and Microsoft Office – useful for secretaries and filing clerks, but not helpful for getting to know how the technology works. A common complaint has been that “no ICT course has a programming or a systems module, instead students are taught to be mere consumers of technology, and operators of applications.”
Programming can be fun, and the principles are easy to learn. The Raspberry Pi can be the affordable route to learning this lesson.
richard hillesley
writes about art, music, digital rights, Linux and free software for a variety of publicationsnProgramming can be
fun and easy to learn for schoolchildren, and the ultra-low-cost Raspberry Pi is an ideal tool for teaching
www.
linuxuser.co.uk
16
Despite masterpieces of medieval and 20th Century architecture, and a fascinating industrial heritage, Coventry isn’t everyone’s ideal long weekend getaway. That changed for the last four days of September, when the city hosted PyConUK – the annual gathering of the country’s enthusiastic and growing Python community – for the second time.
Regular readers will know that, while LUD maintains an even-handed approach to open source languages and technologies, we fi nd ourselves reporting a lot of cool Python projects, and it’s increasingly the language of choice for everything from education and banking to research and big data. Many programming languages have a strong community around their use, but Pythonistas seem to have a sense of belonging – as if they’ve somehow, in fi nding Python, come home – that is normally reserved for Lisp programmers, and all without the smugness occasionally seen in the latter group.
This is a confi dent community, and one not without a sense of humour – as you would expect from a language named in honour of the surreal Monty Python show. Music and fun were on offer at PyConUK, alongside some serious hacking, very cool projects and some productive coding in worthy causes. Let’s start with the cool tech.
■Last year’s PyConUK Blitz theme reappeared as the PyCon poster
Get on board with Python
Feature
From medieval Coventry, via the
classroom, to Africa, and even
operetta and the high seas,
PyConUK represents the best of
the Python community
Despite masterpieces of medieval and 20th Century architecture, and a fascinating industrial heritage, Coventry isn’t everyone’s ideal long weekend getaway. That changed for the last four days of September, when the city hosted PyConUK – the annual gathering of the country’s enthusiastic and growing Python community – for the second time.
an even-handed approach to open source languages and technologies, we fi nd ourselves reporting a lot of cool Python everything from education and banking to research and big data. Many programming languages have a strong community around their use, but Pythonistas seem to have a sense of
without the smugness occasionally seen in the latter group. of humour – as you would expect from a language named in were on offer at PyConUK, alongside some serious hacking, very cool projects and some productive coding in worthy causes. Let’s start with the cool tech.
Last year’s PyConUK Blitz theme reappeared as the PyCon poster ■Last year’s PyConUK Blitz theme Last year’s PyConUK Blitz theme
Get on board
with Python
016-019_LUD_120 PK.indd 16 02/11/2012 17:40WorldMags.net
WorldMags.net
WorldMags.net
The PyConUK 2012 conference
Get on board with Python
FEATURE
Slice of Pi
Python is the offi cial programming language of the Raspberry Pi, and Alex Bradbury – the lead Linux software developer at the Raspberry Pi Foundation – gave the story so far, and the challenges ahead. The Raspberry Pi was created as a low-cost educational tool, but hackers have taken it to their heart, even running breweries and data centres with it.
The community has contributed many improvements to the core stack, such as dynamic overclock, and great software like the 3D Penguins Puzzle game. There’s much more to be done and Bradbury was frank about the limitations of the current software while optimistic about future developments, the possibilities of more edu-specifi c software releases and the potential for the Pi in the developing world.
Shoaib Sufi of the Software Sustainability Institute spoke of his mission to promote “better software engineering and management for better research outcomes”. As “software is everywhere,” and all-pervasive in science, Sufi demands “better software [to produce] better research.”
Intelligent approach
‘Big A, little i’ was a well-illustrated talk by games programmer Tendayi Mawushe, pleading the case for more use of AI algorithms by developers. Software provides a better user experience when programs display awareness of their context, and with good use of examples like the familiar farmer/fox/goose/corn puzzle (represented as states and transitions) and moving blocks games, Mawushe demonstrated making a program give answers about its own behaviour by tracing method calls. Various heuristics were examined, giving attendees ideas of how to bring some AI goodness to their own code.
Dealing with a more mundane annoyance, Vladimir Keleshev introduced docopt, to “build beautiful command-line interfaces”. Replacing the current opaque systems with a mere 384 lines of code, docopt works from simple rules to allow the program to take the POSIX standard of usage pattern and turn it into your UI.
As well as the Python reference implementation, docopt has been implemented in Ruby, CoffeeScript/
■Simply pass usage to docopt in this familiar form, and your command-line UI is built
■Stephen Hawkes came up with the Victorian theme of the publicity – which also extended to a Gilbert & Sullivan song
■Coders and teachers learnt from each other in a rewarding education sprint
CC: @tdobson
“We get to introduce free &
open source to a wider
community of children
and older people”
Alex Bradbury, Raspberry Pi Foundation
■Python is the offi cial programming language of the Raspberry Pi
Catch up
Videos of most of the PyConUK 2012 sessions, with synchronised slides, are up on the PyConUK website, thanks to the dedicated fi lming by Birmingham LUG’s Tim Williams:
http://autoview.autotrain.org/course/view.php?id=15
Get involved with creating resources for the next generation of coders at the Python Edu Google Group:
http://goo.gl/BXBLu
www.
linuxuser.co.uk
18
Get on board with Python
Feature
Teaching the teachers
Bringing the education community to the Python community
nFarmer, grain, goose, fox the AI way – represented as states and transitions Making strenuous efforts to reach the teaching
community, the PyCon organisers invited several teachers to attend a special education track at the conference, led by teacher-turned-coder Nicholas Tollervey. It included introductory Python tuition, and coders sprinkled around the class to help the teachers with their questions. Hearing of the locked-down conditions of schools’ IT, fixed on stone-age technology like Internet Explorer 6, was a shocking discovery for many of the programmers.
Groups of programmers worked with teachers in a coding sprint to produce educational material around programming tasks including a text-based game and a maze solver. The event introduced teachers to the “collaboration, debate, openness,
meritocracy, sharing of resources and learning from the examples of others”, as Tollervey put it.
Following the sprint, and a lightning talk by ‘Miss P’ (Carrie Philbin, a Google-certified teacher), there’s now a mailing list for Pythonistas who want to contribute to resources for teaching: http://t.co/M7ViLkcP.
Additionally, there’s an education summit at next March’s PyCon in California – https:// us.pycon.org/2013/events/edusummit/ – and,
according to Philburn, who was a guest at the weekend’s Python Software Foundation meeting: “Happily, it looks like an education portal will become part of the scope for the redesign of the python.org website.”
nTeachers and coders found common cause
in the education sprint
C C: A la n O ’D on oh oe
JavaScript, PHP and Bash, with ports to Lua and a C code generator on their way.
With so many competing talks on the three tracks, we’re grateful to the PyConUK organisers for making many of the talks available as online videos (see ‘Catch up’, page 17).
Those who could only make the weekend missed some informative sessions on the opening Friday, including the TiddlyWeb architecture – originally created as an open source, reference implementation of an HTTP API for server-side storage of TiddlyWiki tiddlers, the revolutionary one-page app giving a reusable nonlinear personal web notebook.
Follow the rabbit
Starting with the Alan Perlis quote, “The best book about programming for the layperson is Alice in Wonderland. But that’s because the best book about anything for the layperson is Alice in Wonderland”, programmer and philosopher David Miller entertained while drawing lessons from the book.
nMiss P: bringing Python into the classroom
Sarah Mount gave an eloquent summary of the problems of parallelism and concurrency in Python, and the case for using Communicating Sequential Processes (CSP). This is an area of many competing philosophies, and it was good to hear a knowledgeable opinion put so clearly.
Plenty of space was given for lightning talks over the two main days, with ‘Lightning Talk Man’ Harald Massa’s Gesamtkunstwerk of anecdotes to fill each gap as speakers changed laptops and PowerBook VGA dongles. In these five-minute sessions, delegates learned about mixing dynamic and static typing; errors and complexity in finding musical temperaments; prescons, an effective presentation console for Python demonstrations; using Python for digital forensics; and easy roll-outs of your own cloud.
Ask the duck
Further highlights included typing to yourself – an IRC for one to log your thoughts with timestamps, and even put them into version control – in a talk that introduced rubber duck debugging (if you can explain the problem to a rubber duck, then you’re on the path to understanding: try it!);
016-019_LUD_120 PK.indd 18 02/11/2012 17:40
WorldMags.net
WorldMags.net
The PyConUK 2012 conference
Get on board with Python
feature
evidence for Development
using Python to deliver effective, evidence-based overseas aid
Much overseas aid is spent inappropriately – at best wasteful, at worst undermining local markets and farmers’ self-sufficiency. Evidence for Development aims to see that aid gets to where it’s really needed, by backing evidence-based decisions with an understanding of local economics “to build capacity in organisations and institutions in Africa”, Celia Petty, the project founder, told Linux user & Developer. “The World
Bank data is problematic”, so the PyConUK
Evidence for Development sprint aimed to extract something meaningful from it.
“We’re using the technology to apply household economy methodology”, Petty told us. This takes a sophisticated view of how people can meet their food energy needs, rather than measuring money income alone. School attendance, lack of access to start-up capital and many other factors are measured to see what help people need to achieving their own economic self-sufficiency.
nDoctor Korovic’s Flying Atomic Squid – Daniel Pope’s Pygame programming demo
along with a Django-based P2P food market from Transition Cambridge, SustainableSouk.com, which encourages good-quality local food by allowing anyone to sell or swap what they produce.
‘Writing Code for Fun and Profit’ presented the joys of the “side project”, in this case luzme.com which offers price comparisons for eBooks. In further pursuit of fun, Nicholas Tollervey and Ben Croston (whose day job is Python-automated brewing!) performed a tuba duet of the Sousa march well-known as the theme tune to Monty Python’s Flying Circus.
The link between musicianship and coding is a well-known one, but the opening Sunday lightning talk of an energetic hip-hop rap, screened Pythonically, was a real surprise. More conventional, but no less delightful, was the PyConUK song – to the G&S tune used in Tom Lehrer’s Elements song, with words (Python keywords in fact) by Tollervey and Stephen Hawkes, who came up with the Victorian theme of this year’s publicity materials.
Quo vadis?
Saturday had ended with the keynote ‘Remaking the PSF: The next ten years of Python’ by the Python Software Foundation’s Van Lindberg, covering the challenges for the language community and the role of the PSF. As Python has become the glue language of the movie-making industry, is replacing Perl in bio-informatics, is beginning to dominate the financial space, and is finally supplanting Java in the educational world, does it really matter that it has lost its cool or “underdog edge”?
Lindberg praised the uniqueness of the Python community, combining “kindness and professionalism”, and outlined where
the community and the PSF could go together, with more local and regional activity. There’s certainly a lot of UK Python activity already, with regional groups formed at PyConUK 2007 still going strong,
The conference organisers have gone out of their way to attract as broad a spectrum of people as possible – from IT teachers who are new to Python (see ‘Teaching the teachers’, page 18) to core developers – with £100 early-bird tickets and a budget hotel price offering astonishing value. Combined with this were beginner and intermediate tutorial days, and sprints that welcomed all levels of ability. There was even a Python track, touring around Coventry’s heritage, for non-coding partners and offspring.
future-facing
Despite all this, and despite the speaker list containing some talented and interesting female programmers, a look around the venue showed more than 90 per cent of attendees were male – a continuing problem in IT generally, but particularly in the free software community. PyConUK, ever ambitious, is addressing this problem at source, with direct outreach to schools to increase the numbers going into programming, both generally and to Python.
The teachers who attended were taken through introductory Python programming, then paired with Python programmers for a development sprint for educational resources. Other education sessions included a session on Turtle, the Python version of Logo, and some surprisingly sophisticated uses – such as Sierpinski triangles and Lissajous figures – with very few lines of code. As well as giving the best introduction to functions that we’ve heard – “We teach the computer a new word” – discussion ranged over taking Turtle into the physical world with Lego Mindstorms, to a planned Arduino/ Raspberry Pi DIY oscilloscope.
John Pinner, Zeth and the rest of the organisational team were a tireless, friendly and helpful presence throughout the event. Having organised UK PyCons since 2007, and a past EuroPython, the organisers are not resting on their laurels – next year an additional event is planned around sprints aboard a ship from Plymouth to Santander and back. If you want to get involved with both a great community and a fantastic language, all we can say is get on board!
“PyConUK seems to
have hit the sweet spot
between technical
tell-how and friendly
community”
Tim GoldenC C: @ nt ol l