uClibc 0.9.32 released, with NPTL support

A little bit more than one year after 0.9.31, the uClibc project has recently released a new version of the famous C library, uClibc 0.9.32. For the record, uClibc is an alternative standard C library for embedded Linux systems, which features a smaller size than the usual glibc or eglibc, a high-level of configurability and support for non-MMU architectures. uClibc usage is mandatory on non-MMU architectures running a Linux kernel since the traditional glibc or eglibc do not support non-MMU architectures. On architectures with MMU, uClibc may also be interesting for its reduced size, and has been used in a large number of systems over the last years.

The 0.9.32 release brings one major new feature : the support of the Native Posix Threads Library for the most common architectures (ARM, MIPS, PowerPC, x86, x86_64, SuperH and SuperH 64). NPTL is a different way of implementing the pthread userspace API than the one previously used in Linux, called LinuxThreads. The kernel mechanisms needed to implement NPTL have been added in 2.6 and support in glibc has been added a long time ago. uClibc was lagging behind in this area, and the new release fills this gap. This feature does not bring any visible API change, but completely changes the internal implementation of the threading mechanism, with better performance and a behavior that is more similar to the one we have on glibc based hosts. For more details about the differences about NPTL and LinuxThreads, one can check Ulrich Drepper and Ingo Molnar’s paper on this topic: NPTL Design paper.

Another new feature of the 0.9.32 release is support for the C6x architecture, which is a DSP architecture from Texas Instruments, capable of running a Linux kernel (see http://linux-c6x.org). Having upstream support in uClibc allows this architecture to benefit from a nice standard C library.

Buildroot 2011.05 released

Buildroot logoAs expected with the time-based releases, Buildroot 2011.05 has been released just a few days ago. We have already published many blog posts about Buildroot, but to summarize for our new readers, Buildroot is a tool that automates and simplifies the process of building an embedded Linux system. You define your system configuration and components in a menuconfig/xconfig interface similar to the one the kernel uses, then hit make, wait a bit, and you have your embedded Linux system ready to run on your device. At Bootlin, we appreciate the simplicity of Buildroot, and many of our customers also appreciate it for the same reason. Of course, we also contribute significantly to Buildroot and we have started a commercial support offering on Buildroot.

The 2011.05 release

The 2011.05 release cycle was a little bit more quiet than usual, so the number of new features or major changes is not as large as it was for past releases. Amongst the interesting things:

  • Until now, Buildroot was only capable of building systems using a static /dev, in which device files are statically listed in a device table and created at system build time. The 2011.05 has added a configuration option to select how the /dev directory on the target should be handled. It can be handled in four different ways:
    • with a static /dev, just as before
    • with just devtmpfs. It allows to have a dynamic /dev without any other userspace components, which is really nice.
    • with devtmpfs and mdev. In addition to having a dynamic /dev, it allows allows to execute arbitrary scripts when device are added/removed and to customize the owner, group and permissions for the device files.
    • with devtmpfs and udev. This is the full solution, as used in desktop distributions.
  • There has been an internal infrastructure change on support for external toolchains, and this change will make those toolchains slightly easier to use. In Buildroot terminology, an external toolchain is a toolchain that hasn’t been built by Buildroot, but which Buildroot uses to compile code for the target platform. It allows to re-use existing toolchains such as the CodeSourcery toolchains, or toolchains generated externally with Crosstool-NG. To support those toolchains, we rely on the sysroot mechanism that the GCC compiler provides since the 4.x era. This mechanism allows Buildroot to make a complete copy of the C library binaries, C library headers and kernel headers into a staging directory, and then tell the toolchain utility (compiler, linker, etc.) to use this new directory as their sysroot. This means that a --sysroot option needs to be passed at every invocation of those tools. As this was not very convenient, especially to use the Buildroot toolchain as a SDK to build applications not packaged in Buildroot, the 2011.05 has added wrappers for the toolchain tools, which makes this completely transparent. So one can now just use $(O)/host/usr/bin/arm-linux-gcc as usual, and it will do the right thing.
  • A few new packages have been added: bonnie++ (a block device benchmark), can-utils (userspace utilities for the famous industrial CAN bus), gdisk (a sort of fdisk program, but for the new GPT partition table format), htop (a nice top alternative to watch the activity of processes), input-event-daemon (a simple daemon that executes arbitrary command in reaction to input events), libexif (a library to read the contents of EXIF tags in pictures), libraw (a library to decode pictures in various RAW formats), libv4l (the library to interact with Video4Linux devices), ngircd (an IRC server).
  • Many packages have been upgraded: the Gtk stack, the U-Boot and Barebox bootloaders and the internal toolchain components (gcc and uClibc), with experimental gcc 4.6 support.

Buildroot in the Linux Journal

Linux Journal 206 CoverThe Linux Journal has published an issue, numbered 206, dedicated to Embedded Linux. This issue has several articles around Embedded Linux related topics:

  • Hexapod, a Linux powered robot
  • Debugging Embedded Linux platforms with Python and GDB
  • Breaking free the Gumstix DSP
  • Speech I/O for Embedded Applications
  • CyanogenMod 7.0, Gingerbread in the house
  • Tiny Core Linux
  • Roll your own Embedded Linux System with Buildroot, written by Alexander Sirotkin, which gives a good introduction to what Buildroot is and how to use it.

It is great to see articles about Buildroot in a such widely read magazine, and it should definitely help increasing the awareness about this build system.

Linux Journal 206 Table of ContentsLinux Journal 206 Buildroot

Buildroot used by Fabrice Bellard in jslinux

In May, the famous developer Fabrice Bellard (known as the initial author of ffmpeg, qemu, but also for his records for the computation of pi) has released an impressive new project: an x86 emulator completely written in Javascript, which runs in a Web browser. This emulator is sufficiently capable and powerful to boot a Linux system. And the good news is that the Linux system that Fabrice Bellard is using for the demonstration was generated with Buildroot, as Bellard says in his technical notes about the project.

Embedded Linux training: switch to the IGEPv2 board

Since early 2009, our training sessions have been using the USB-A9263 board from Calao Systems as the hardware platform for the practical labs. However, this AT91-based platform was getting older, and we therefore started the process of switching our training sessions to a new hardware platform, the IGEPv2 board from ISEE.

IGEPv2 board
IGEPv2 board

The IGEPv2 platform is very similar to the popular BeagleBoard and BeagleBoard-XM platforms, and has the following technical characteristics :

  • TI DM3730, which is the latest OMAP3 processor from Texas Instruments, clocked at 1 Ghz, and including a DSP for signal processing, an IVA block for audio/video decoding and the PowerVR SGX for 3D/OpenGL. This processor offers far more possibilities than the AT91 one, especially for multimedia applications.
  • 512 MB of RAM and 512 MB of OneNAND flash.
  • Integrated Ethernet connector, Wifi and Bluetooth connectivity.
  • One USB OTG port and one USB host port.
  • A microSD connector.
  • A DVI-D connector (HDMI), stereo input and ouput
  • RS232 connector
  • Multiple expansion ports to access LCD, camera, I2C, SPI, JTAG, etc. signals

Compared to the BeagleBoard-XM, this board has the following advantages:

  • it has a OneNAND Flash device, which allows us to demonstrate and practice the usage of MTD and Linux flash-specific filesystems such as JFFS2 and UBIFS in our training sessions. Even though block-based storage such as SD and eMMC is more and more popular in consumer-electronic devices, usage of raw NAND flash is still very common in industrial applications, and we therefore wanted to keep presenting those devices and their usage in embedded Linux
  • ISEE, the company manufacturing the IGEPv2, is located in Spain, which makes it easier for us to regularly order boards from them, since we are also located in Europe
  • the board provides Bluetooth and Wifi connectivity, which is nice

We have already given two sessions of our Embedded Linux system development training with the IGEPv2, and all our future sessions of this training will use this hardware platform, so the participants will benefit from a more modern platform, with far more capabilities than our previous AT91-based training hardware. This is also the board we are now giving to the participants to our public training sessions, so those participants come back home with a very nice and powerful platform which allows countless experiments around embedded Linux. Note that we also intend to port our Embedded Linux kernel and driver development training session to the IGEPv2 platform in the near future.

Embedded Linux boot time reduction presentation for GENIVI

GENIVI LogoI was invited to speak at the GENIVI All Members Meeting that took place on May 3-6 in Dublin, Ireland. This was a very interesting opportunity to meet new people in the In Vehicle Infotainment (IVI) industry and community.

In addition to the friendly social event at the Guiness Brewery, there was also a very interesting technical showcase of products and software using the GENIVI stack. I could observe that Freescale and ARM chips in general dominate this market. I also wore my Linaro shirt and had interesting discussions with several people about partnership opportunities between GENIVI and Linaro.

I gave a presentation about reducing boot time in embedded Linux systems. The slides are available in PDF and ODF formats, and as usual, are released with a Creative Commons Attribution – Share Alike 3.0 license. Here is the description of the talk:

Cheap Linux boot time reduction techniques

By Michael Opdenacker, Bootlin

More and more feature rich Linux devices are put in the hands of consumers, and the average consumer shouldn’t even notice that they run Linux. To make the OS invisible, the system should boot in a flash.

Multiple boot time reduction techniques are now available, and can be used at the end of a development project, without incurring redesign costs. This presentation will guide embedded Linux system developers through the most effective ones. For each technique, we will detail how to use it and will report the exact savings achieved on a real embedded board.

Author’s biography

Michael Opdenacker is the founder of Bootlin (https://bootlin.com), a company offering development, consulting and training services to embedded Linux system developers worldwide. He is always looking for innovative techniques to share with customers and with the community.

Michael is also the Community Manager for Linaro (http://linaro.org), a not-for-profit engineering organization working on software foundations for Linux on ARM, to reduce fragmentation between ARM chip vendors, increase product performance and reduce time to market. Linaro currently employs more than 100 of the most active developers in the ARM and embedded Linux community.

I was pleased to have a good number of participants, and to get many questions during and after the talk.

Though GENIVI is about Free and Open Source Software, it is unfortunately not very open to the community yet. You have to become a member to access its specifications, wiki and other technical resources. While collecting membership fees makes sense to operate such an organization, and is acceptable for system makers, it makes it difficult for embedded Linux community developers to get involved. I hope that GENIVI will become more open to the wider embedded Linux community in the future.

Videos of Android Builders Summit 2011

Android LogoJust after the Embedded Linux Conference 2011, the first edition of the Android Builders Conference took place in San Francisco, on April 13th and April 14th 2011. This is the first, and to date, probably the first, conference entirely dedicated to Android low-level components and on how Android systems are built and modified. The number of resources, documentation and conferences on Android application development is already huge, but the amount of system-level information about Android is still relatively limited. This conference comes to fill in this gap, allowing engineers working on Android-based systems to share their experience. With a single track of talks for the first half-day, and two tracks for the second full day, it was a very nice first edition, and the co-location with the Embedded Linux Conference was well-appreciated. Interestingly enough, no talks were given by Google engineers, despite the fact that they are the primary designers and developers of the Android system.

Just as we did for the Embedded Linux Conference a few days ago, we are also publishing below the videos of all talks given during this Android Builders Summit. Of all the presentations, the ones we found the most interesting are certainly:

  • Karim Yaghmour’s talk about « Android Internals » and «Porting Android to new hardware»
  • Aleksander “Sasa” Gargenta’s talk «A walk through the Android stack». Unfortunately, the speaker had way too much contents for the one hour slot, but the content presented was very, very interesting.
  • Mark Brown’s talk «Linux audio for smartphones»

Mike WosterVideo capture
Linux Foundation
Android Builders Summit Introduction
Video (2 minutes):
full HD (31M), 450×800 (11M)

Christy WyattVideo capture
Motorola
Motorola: innovation rising
Video (36 minutes):
full HD (454M), 450×800 (142M)

Mark CharleboisVideo capture
Qualcomm Innovation Center
From the alliance to the evolution: the history and future of Android innovation
Video (26 minutes):
full HD (332M), 450×800 (103M)

Greg BurnsVideo capture
QuIC
AllJoyn and the new era of peer-to-peer-technology
Video (55 minutes):
full HD (680M), 450×800 (209M)

Mark BrownVideo capture
Wolfson Micro
Linux audio for smartphones
Slides
Video (46 minutes):
full HD (560M), 450×800 (173M)

Karim YaghmourVideo capture
Opersys
Android Internals
Slides
Video (58 minutes):
full HD (793M), 450×800 (245M)

Mark GrossVideo capture
Intel
Device provisioning anad over the air updates for Android-2011
Slides
Video (48 minutes):
full HD (847M), 450×800 (214M)

Peter VescusoVideo capture
Black Duck Software
Managing Android and the complexity inside
Video (35 minutes):
full HD (375M), 450×800 (121M)

Hansung ChunVideo capture
ETRI
I/O performance improvement, using ext2 in Android-2011
Slides
Video (44 minutes):
full HD (915M), 450×800 (210M)

Magnus BäckVideo capture
Sony Ericsson
Using the Debian package manager to assemble Android-based phone software systems
Video (45 minutes):
full HD (357M), 450×800 (134M)

Tim BirdVideo capture
Sony Network Entertainment
Trying to improve Android boot time with readahead
Slides
Video (38 minutes):
full HD (833M), 450×800 (194M)

Bruce BeareVideo capture
Intel
Living with Gerrit
Slides
Video (42 minutes):
full HD (404M), 450×800 (137M)

Karim YaghmourVideo capture
Opersys
Porting Android to new hardware
Slides
Video (43 minutes):
full HD (822M), 450×800 (209M)

Marko GargentaVideo capture
Marakana
Beyond the phone
Slides
Video (44 minutes):
full HD (682M), 450×800 (193M)

Neil TrevettVideo capture
NVIDIA
Open API standards as a foundation for Android innovation
Video (42 minutes):
full HD (523M), 450×800 (173M)

Vitaly Wool, presented by Mark GrossVideo capture
Sony Ericsson
WiFi and Android: powersave saga
Video (31 minutes):
full HD (544M), 450×800 (136M)

Aleksander “Sasa” GargentaVideo capture
Marakana
A walk through the Android stack
Video (60 minutes):
full HD (689M), 450×800 (234M)

Armijn HemelVideo capture
gpl-violations.org
Licensing pitfalls in Android and how to avoid them
Video (44 minutes):
full HD (662M), 450×800 (183M)

Tim BirdVideo capture
Sony Network Entertainment
Android System Programming Tips and Tricks
Slides
Video (42 minutes):
full HD (459M), 450×800 (153M)

Creative commonsIn agreement with the speakers, these videos are released under the terms of the Creative Commons Attribution-ShareAlike 3.0 license.

ELC 2011 videos

The Embedded Linux Conference 2011 took place between April, 11th and April, 13th in its now usual place, the Kabuki hotel in San Francisco, California. It was the first edition organized since the merge of the CE Linux Forum into the Linux Foundation. During three days, three parallel tracks of talks and BoFs about technical topics around embedded Linux : kernel support, power management, build systems, file systems, real-time, and more.

As usual, part of the Bootlin team was at this Embedded Linux Conference, in order to keep up with the latest developments from the embedded Linux community. Gregory Clement (left on the picture), Maxime Ripard (right on the picture) and myself (center on the picture) were present, and we recorded all talks of the conference. And just a little bit more than one month later, we are ready to announce that all videos are now available online, in 1080p high-definition, and in a lower 450p resolution, encoded with the new VP8 codec.

Bootlin at ELC 2011
Bootlin at ELC 2011. From left to right: Gregory Clement, Thomas Petazzoni and Maxime Ripard.

Amongst all the conferences below, each of us have selected the three ones we thought were the most interesting ones (note that the top three for each us is necessarily composed of distinct talks, as none of us have seen the same talks since we had to record talks from three different sessions in parallel) :

  • For Gregory Clement, the top three is: Yoshiya Hirase talk about Faster Resume For More Energy Savings on MeeGo, Arnd Bergmann talk about Optimizations For Cheap Flash Media (which follows Arnd article on the same topic in LWN) and a set of three related talks about the video infrastructure in the Linux kernel, that Gregory recommends to watch in this order: Media Controller Framework (MCF) For OMAP2+ Display Subsystem (Sumit Semwal), Video4linux: Progress, New videobuf2 Framework and the Future (Hans Verkuil) and Bringing up HDMI Display for OMAP4 Panda Board – Design, Challenges and Lessons Learned (Mythri pk).
  • For Maxime Ripard, the top three is: John Stultz talk about Android for servers, Mike Anderson talks about ARM NEON and GPU programming, Wolfram Sang talk about Helping the process
  • For myself, the top three is: Jesse Barker talks about the ARM Graphics ecosystem which gives a nice overview of the state of this topic, Hai Shalom talk about PCD (which is an original and interesting replacement for init), Dave Stewart talk about The Yocto Project and its Application Development Toolkit (because it gives details on how Yocto is supposed to be used for application development, a topic I’m interested in as a Buildroot developer)

It is also worth noting that this Embedded Linux Conference was co-located with the first edition of the Android Builders Summit, for which we will soon publish videos as well. The next embedded Linux conference will take place in Europe, in Prague from October 26th to 28th, co-located with the first edition of LinuxCon Europe and just after the Kernel Summit. Prague will really be full of Linux developers during this end of October, it’s time to book this week on your agenda as well !

Creative commonsIn agreement with the speakers, these videos are released under the terms of the Creative Commons Attribution-ShareAlike 3.0 license.

Finally, the list of all videos of Embedded Linux Conference 2011, along with their corresponding slides :

Tim BirdVideo capture
Sony Network Entertainment
Welcome Keynote
Video (10 minutes):
full HD (131M), 450×800 (43M)

Dirk Hohndel, Richard PurdieVideo capture
Intel, Linux Foundation
The Yocto Project
Video (35 minutes):
full HD (458M), 450×800 (140M)

Keshava MunegowdaVideo capture
Texas Instruments
Power Fail Safe FAT File Systems
Slides
Video (48 minutes):
full HD (693M), 450×800 (203M)

Frank RowandVideo capture
Sony
Identifying embedded real-time issues: I-cache and locks
Slides
Video (46 minutes):
full HD (471M), 450×800 (147M)

Bruno Cardoso LopesVideo capture
University of Campinas
LLVM, Clang and Embedded Linux Systems
Slides
Video (50 minutes):
full HD (593M), 450×800 (164M)

Steven RostedtVideo capture
RedHat
Kernel Shark Tutorial
Video (49 minutes):
full HD (743M), 450×800 (215M)

Kang DongwookVideo capture
ETRI
Snapshoot Booting on Embedded Linux
Slides
Video (33 minutes):
full HD (284M), 450×800 (95M)

Khem RajVideo capture
State of OpenEmbedded Internal Toolchain and SDKs
Slides
Video (41 minutes):
full HD (289M), 450×800 (119M)

David RuslingVideo capture
Linaro
Linaro: a year of change
Slides
Video (50 minutes):
full HD (529M), 450×800 (173M)

Hai ShalomVideo capture
Atheros
Control, recover and debug your embedded product with PCD
Slides
Video (50 minutes):
full HD (470M), 450×800 (160M)

Gene SallyVideo capture
Zigbee Networking and Linux
Video (53 minutes):
full HD (262M), 450×800 (139M)

Xi WangVideo capture
Broadcom
Solving real-time scheduling problems with RT_PREEMPT and deadline-based scheduler
Slides
Video (43 minutes):
full HD (422M), 450×800 (141M)

Mike AndersonVideo capture
The PTR Group
ARM Neon instruction set and why you should care
Slides
Video (53 minutes):
full HD (527M), 450×800 (169M)

Darren HartVideo capture
Intel
Yocto Project: Practical Kernel Development Tutorial
Video (52 minutes):
full HD (551M), 450×800 (196M)

Arnd BergmannVideo capture
IBM
Optimizations for cheap flash media
Slides
Video (49 minutes):
full HD (482M), 450×800 (160M)

Wolfram SangVideo capture
Pengutronix
Developer’s diary: helping the process
Slides
Video (39 minutes):
full HD (315M), 450×800 (112M)

Rajesh LalVideo capture
Nokia
Fun with QML and Javascript
Slides
Video (39 minutes):
full HD (250M), 450×800 (108M)

Thomas GleixnerVideo capture
Linutronix
RT-Preempt: what’s the state and why there is no roadmap
Slides
Video (46 minutes):
full HD (447M), 450×800 (149M)

Jason KridnerVideo capture
Texas Instruments
High-level web interface to low-level I/O on the BeagleBoard
Slides
Video (36 minutes):
full HD (370M), 450×800 (115M)

Arnd BergmannVideo capture
IBM
Becoming part of the Linux kernel community
Slides
Video (34 minutes):
full HD (376M), 450×800 (126M)

Paul MundtVideo capture
Renesas
Working with hardIRQs: life beyond static IRQ assignments
Slides
Video (36 minutes):
full HD (330M), 450×800 (113M)

Amit KucheriaVideo capture
Linaro
Powerdebugging inside Linaro
Slides
Video (46 minutes):
full HD (309M), 450×800 (136M)

Mike AndersonVideo capture
The PTR Group
High-performance computing using GPUs
Slides
Video (57 minutes):
full HD (615M), 450×800 (185M)

Paul LarsonVideo capture
Canonical
Linaro automated validation on ARM
Video (51 minutes):
full HD (581M), 450×800 (184M)

Dave StewartVideo capture
Intel
The Yocto project and its application development toolkit (ADT) – The answer to effective embedded application development
Video (42 minutes):
full HD (362M), 450×800 (139M)

Damian Hobson Garcia, Katusya Matsubara, Takanari Hayama, Hisao MunakataVideo capture
Igel
Integrating a Hardware Video Codec into Android Stagefright using OpenMAX IL
Slides
Video (55 minutes):
full HD (564M), 450×800 (177M)

Koen KooiVideo capture
Texas Instruments
Integrating OpenEmbedded and Yocto
Slides
Video (52 minutes):
full HD (465M), 450×800 (159M)

Mark GrossVideo capture
Intel
How to power tune a device running on a Linux kernel for better suspend battery life
Slides
Video (49 minutes):
full HD (273M), 450×800 (129M)

Remi LorriauxVideo capture
Adeneo Embedded
Real-time audio on embedded devices
Slides
Video (44 minutes):
full HD (437M), 450×800 (138M)

Magnus DammVideo capture
Runtime PM: upstream I/O device power management
Slides
Video (53 minutes):
full HD (486M), 450×800 (164M)

Jesse BarkerVideo capture
Linaro
Linux graphics meets the ARM ecosystem
Slides
Video (50 minutes):
full HD (329M), 450×800 (147M)

David AndersVideo capture
Texas Instruments
Board bringup: open-source hardware and software tools
Slides
Video (38 minutes):
full HD (376M), 450×800 (118M)

John WilliamsVideo capture
PetaLogix
Dynamic co-simulation of FPGA-based systems on chip
Slides
Video (57 minutes):
full HD (567M), 450×800 (198M)

Summit SemwalVideo capture
Texas Instruments
Media Controller Framework (MCF) for OMAP2+ display subsystem
Slides
Video (49 minutes):
full HD (518M), 450×800 (155M)

John StultzVideo capture
IBM
Android for servers?
Slides
Video (37 minutes):
full HD (425M), 450×800 (137M)

Anand GadiyarVideo capture
Texas Instruments
Tools and techniques for debugging embedded systems
Slides
Video (30 minutes):
full HD (139M), 450×800 (81M)

Hans VerkuilVideo capture
Cisco
Video4linux: progress, new videobuf2 framework and the future
Slides
Video (56 minutes):
full HD (534M), 450×800 (171M)

Yoshiya HiraseVideo capture
Nokia
Faster resume for more energy saving on MeeGo
Slides
Video (58 minutes):
full HD (727M), 450×800 (218M)

Jake EdgeVideo capture
Linux Weekly News
What embedded Linux developers should know about IPv6
Slides
Video (46 minutes):
full HD (266M), 450×800 (122M)

Grégoire GentilVideo capture
Always Innovating
Hot multi-OS switch: how to run Ubuntu, ChromiumOS, Android at the same time on an embedded device
Video (61 minutes):
full HD (515M), 450×800 (174M)

Xi WangVideo capture
Broadcom
Controlling memory footpring at all layers: Linux kernel, applications, libraries and toolchain
Slides
Video (38 minutes):
full HD (511M), 450×800 (152M)

Tom Zanussi, Saul WoldVideo capture
Building custom embedded images with Yocto
Slides
Video (49 minutes):
full HD (500M), 450×800 (173M)

Philip BalisterVideo capture
Open SDR
A high performance interface between the OMAP3 and a FPGA
Slides
Video (51 minutes):
full HD (347M), 450×800 (149M)

Jean PihetVideo capture
NewOldBits.com
The evolution of tracing and profiling for power management and accelerators
Slides
Video (40 minutes):
full HD (428M), 450×800 (133M)

Elizabeth FlanaganVideo capture
Intel
Delivering predictability: the Yocto project autobuilder, automated sanity testing, license collection and build statistics tracking
Slides
Video (48 minutes):
full HD (241M), 450×800 (133M)

Mythri pkVideo capture
Texas Instruments
Bringing up HDMI display for OMAP4 Panda board: design, challenges and lessons learned
Slides
Video (40 minutes):
full HD (363M), 450×800 (122M)

Khem RajVideo capture
Debug/develop uClibc with QEMU
Slides
Video (35 minutes):
full HD (226M), 450×800 (98M)

Gunter Ravi SankarVideo capture
Samsung
What are and how to find a program’s unused DSOs
Slides
Video (49 minutes):
full HD (453M), 450×800 (143M)

Videos from the FOSDEM 2011 Embedded track

As every year, FOSDEM, the largest community-driven open source conference in Europe, took place early February in Brussels. And again, Bootlin was around with its HD camcorder, to record the conferences of interest for embedded developers. They are now available for download!

FOSDEM banner

Creative commonsIn agreement with the speakers, these videos are released under the terms of the Creative Commons Attribution-ShareAlike 3.0 license.

Here are the videos that we have (unfortunately, the FOSDEM team doesn’t collect and publish the slides from the speakers) :

Creating and flashing UBI / UBIFS images

Flash super heroEmbedded-oriented filesystems are a scattered world. Flash-optimized filesystems are less so. JFFS2 has been widely used but has several performance issues (mount time, especially, though CONFIG_SUMMARY and sumtool fixes that since 2.6.15). LogFS doesn’t seem to be actively maintained. The most active and promising flash filesystem is UBIFS. It runs on top of UBI (“Unsorted Block Images”), an abstraction layer for MTD devices.

Why flash-oriented filesystems ?

MTDs (Memory Technology Devices) are very different from block devices: instead of a sequence of writable sectors, they contain an array of writable pages, organized in so-called “erase blocks”.

To write on a page that already has data on it, you first have to erase this data. However, it is only possible to erase whole eraseblocks. Only then, you can write your new data (including what you didn’t change). Erasing causes the memory cells to wear out. At some point, they won’t be usable anymore and have to be skipped.

Because it is memory-based, random access is theoretically as fast as sequential access. So, you don’t need to keep the fragments of your files together. It makes it possible to do wear-leveling and thus, “increase” the lifetime of the chip.

A simple way of doing wear-leveling is to keep track of the number of times a block has been erased and use the block that has been the least erased when updating data.

All these constraints make it hard to write a flash filesystem.

UBI intends to deal with all MTD-specific operations while still presenting random-access volumes to the the upper-layer. The first – and as for now, only – implementation using UBI is UBIFS. UBI is a “volume manager” and maps physical erase blocks (PEB) to logical erase blocks (LEB). The LEBs are smaller than the PEBs because of meta-data and headers.

How to use UBI on my board ?

There are mainly 2 ways to do that:

  • On a booted Linux system, approximately the same way you would create a partition on your desktop’s hard drive ;
  • From the bootloader, by flashing a previously prepared UBI image ;

Whatever solution you choose, you need to know the sizes of:

  • the eraseblocks (PEB) ;
  • the pages (or “minimum input/output size”) ;
  • the subpages (it may be the same as the min i/o size) ;

From these details, you can deduce another one: the size of logical erase blocks. It is the size of the PEB minus a data offset which is:

(int((Subpage_size + Page_size) / Page_size))  * Page_size

(subpage+page truncated to page size). This formula makes some assumption but should be correct if the subpage size is more than 8B and the page size more than 64B (see the source for more information). The best way to be sure of this size is to use mtdinfo on linux on the board. mtdinfo is part of the ubi-utils (part of mtd-utils). It’s probably available in your build system.

In both cases, you will also need a UBIFS image. In the way of JFFS2, mkfs.ubifs comes in mtd-utils (thus, you also need them on your desktop. Warning: mtd-utils in Ubuntu 10.10 are reported to be buggy ; if you use this distribution, recompile them from their git tree). Here is an example of how you can invoke it:

# mkfs.ubifs -r </path/to/your/rootfs/tree> -m <min io size>
  -e <LEB size> -c <Eraseblocks count>
  -o </path/to/output/ubifs.img>

Solution A – On a booted Linux system

I think it’s the best method to understand how UBI is structured.

You first need to enable UBI and UBIFS in the kernel and install the mtd-utils package (for Debian and Ubuntu) on your box. You may also compile mtd-utils from its sources.

Once you have your UBIFS image at hand, let’s sing the UBI song:

# ubiformat /dev/mtdX
# ubiattach -p /dev/mtdX
# ubimkvol /dev/ubi0 -N volume_name -s 64MiB
# ubiupdatevol /dev/ubi0_0 /path/to/ubifs.img
# mount -t ubifs ubi0:volume_name /mount/point

Let’s examine each command. ubiformat erases an MTD partition but keeps its erase counters ((‘X’ is the number of the partition you want to use). ubiattach creates a UBI device from the MTD partition. This UBI device is then referred to by UBI as ubi0 (if it is the first device). ubimkvol creates a volume on a UBI device ; this volume is referred to as ubi0_0 (if it is the first volume on the device). ubiupdatevol puts an image on an empty volume. (use ubiupdatevol -t /dev/ubi0_0 to empty a volume). At last, the well-known mount can be invoked using <device>:<volume>

Solution B – Prepare a UBI image ready to be flashed

It is more common to directly flash filesystem images directly from the bootloader. It is made possible by ubinize to prepare a UBI device image containing one or more volumes.

ubinize reads a configuration file (in the very simple INI format) describing the volumes and their configuration. Here is an example of a device with two volumes ; one, named rootfs is read-only (static), the other one, data is read-write (dynamic) ; the autoresize flag makes UBI resize to volume to use the whole unused space at initialization. The name of the sections is totally arbitrary.

[rootfs_volume]
mode=ubi
image=rootfs.ubifs
vol_id=1
vol_type=static
vol_name=rootfs
vol_alignment=1

[rwdata_volume]
mode=ubi
image=data.ubifs
vol_id=2
vol_type=dynamic
vol_name=data
vol_alignment=1
vol_flags=autoresize

Next is the generation of the UBI image. The ubinize utility will need the Physical Erase Block size (PEB) (option -p) and the minimum I/O size (-m):

# ubinize -vv -o <output image> -m <min io size>
  -p <PEB size>KiB <configuration file>

Your image is ready. You may now want to boot on the rootfs UBIFS partition. Keep on reading, then.

Use a UBIFS partition as root partition

Some options need to be passed to the kernel to boot on a ubi volume and on a UBIFS partition:

ubi.mtd=<mtd partition number>
root=<ubi device>:<volume>
rootfstype=ubifs

For instance, with the previous examples and assuming the UBI device has been created/flashed on /dev/mtd1:

ubi.mtd=1 root=ubi0:rootfs rootfstype=ubifs

Conclusion

Creating and using a UBIFS filesystem is not as easy as with JFFS2 but UBI/UBIFS is designed to be more robust and UBI will ease the development of new filesystems. The authors of UBI have pointed some memory usage scalability problems but if a second version of UBI were written, filesystems on top of it would not need to be modified.

Troubleshooting

In case your system is missing the /dev/ubi_ctrl, /dev/ubi0 or /dev/ubi0_X device files, we advise you to recompile your kernel with DEVTMPFS and DEVTMPFS_MOUNT. This way, all the devices existing on your system will appear in /dev.

If you get write errors (code -74 or -5, probably), check that CONFIG_MTD_NAND_VERIFY_WRITE (respectively, ONENAND) is disabled : verifying subpages writes isn’t supported yet.

Sources

The primary place for information about MTD support in Linux is infradead.org. There also is a mailing list which you can also subscribe to.

The kernel sources under drivers/mtd and fs/ubisfs are also very helpful.

Videos from Libre Software Meeting 2010 in France

RMLL 2010The Libre Software Meeting (Rencontres Mondiales du Logiciel Libre in French) is a community-driven event that takes place every year in France, and covers a wide range of topics in the free and open source software domain. Each year, an Embedded systems and free hardware topic is proposed, which in 2010 was lead by Florian Fainelli, Pierre Ficheux and myself.

While most of the talks took place in French, a few talks were given in English and as we recoded videos from those talks, we thought it’d be a good idea to highlight them to the english readers of our blog. We found it especially important since amongst those videos, there are two particularly interesting presentations from Sarah Sharp, a kernel developer from Intel, about USB3 and its support in Linux. As usual, all our videos are published under the Creative Commons Attribution – ShareAlike Licence version 3.0 license.

Sarah Sharp presenting USB3 at LSM2010

The talks given in English were :

Our french readers will find all other videos in this blog post.

Building a small Debian root filesystem with Multistrap

There are several ways to build a root filesystem for an embedded Linux system: Buildroot and Open Embedded are the usual solutions to do this. They allow to fine tune the contents of your filesystem. The drawback is, in both cases, that you need to build everything from sources and this can take from tens of minutes to several hours.

Sometimes you don’t need all this flexibility and you just want to have a ready-to-use root filesystem, to which you just add a few extra programs. In this case using a distribution is a good solution. So let’s see what we need:

  • A binary distribution
  • Available on several architectures
  • Ability to generate a “small” root filesystem
  • A large choice of packages

Oh, I think it is a pretty good description of Debian!

Emdebian is a project to adapt Debian to embedded devices. A good description from the Debian wiki is:

“In short, what EmDebian does is wrap around the regular Debian package building tools to provide a more fine grained control over package selection, size, dependencies and content to enable creation of very small and efficient Debian packages for use on naturally resource limited embedded targets.”

And so, pretty recently (2009), Emdebian released Multistrap which is similar to Debootstrap but more appropriate for embedded devices. It seems better by the way it builds a system:

It works in a completely different way by simply using apt and dpkg, rather than avoiding to use them, which is how Debootstrap works.

And also more appropriate by its goals:

It is focused on producing rootfs images for devices, as opposed to chroots for existing machines

Practical case: build a root filesystem for the USB A9263 board from Calao Systems (arm926ejs based board).

A drawback of Multistrap is its limitation to Debian, but in fact it is also usable on any distribution based on Debian. In our case, we ran it on an Ubuntu 10.04 system.

First, let’s install Multistrap:

$sudo apt-get install multistrap dpkg-dev

Multistrap needs a config file. For our needs we just use the example one given by Embedian. Let’s name it multistrap.conf:

[General]
noauth=true
unpack=true
debootstrap=Grip
aptsources=Grip

[Grip]
# space separated package list
source=http://www.emdebian.org/grip
suite=lenny

Grip is the name of the lightweight Debian distro built by Emdebian.

Now we can run Multistrap:

$ multistrap -a armel -d $PWD/RFS -f multistrap.conf
em_multistrap 0.0.8 using multistrap.conf
Using foreign architecture: armel
em_multistrap building armel multistrap on 'amd64'
INF: Setting ./lib64 -> ./lib symbolic link.
Getting package lists: apt-get  -o Apt::Architecture=armel -o Apt::Get::AllowUnauthenticated=true -o Apt::Get::Download-Only=true -o Apt::Install-Recommends=false -o Dir=/home/mike/celf/multistrap/RFS/ -o Dir::Etc=/home/mike/celf/multistrap/RFS/etc/apt/ -o Dir::Etc::SourceList=/home/mike/celf/multistrap/RFS/etc/apt/sources.list.d/multistrap.sources.list -o Dir::State=/home/mike/celf/multistrap/RFS/var/lib/apt/ -o Dir::State::Status=/home/mike/celf/multistrap/RFS/var/lib/dpkg/status -o Dir::Cache=/home/mike/celf/multistrap/RFS/var/cache/apt/ update
Get:1 http://www.emdebian.org lenny Release.gpg [197B]
Ign http://www.emdebian.org/grip/ lenny/main Translation-en_US
Get:2 http://www.emdebian.org lenny Release [21.4kB]
Ign http://www.emdebian.org lenny Release
Ign http://www.emdebian.org lenny/main Packages
Ign http://www.emdebian.org lenny/main Sources
Ign http://www.emdebian.org lenny/main Packages
Ign http://www.emdebian.org lenny/main Sources
Get:3 http://www.emdebian.org lenny/main Packages [293kB]
Get:4 http://www.emdebian.org lenny/main Sources [351kB]
Fetched 665kB in 0s (6,280kB/s)                     
Reading package lists... Done
W: GPG error: http://www.emdebian.org lenny Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B5B7720097BB3B58
W: Duplicate sources.list entry http://www.emdebian.org/grip/ lenny/main Packages (/home/mike/celf/multistrap/RFS/var/lib/apt/lists/www.emdebian.org_grip_dists_lenny_main_binary-armel_Packages)
Use of uninitialized value within %packages in join or string at /usr/sbin/em_multistrap line 294.
Use of uninitialized value within %keyrings in join or string at /usr/sbin/em_multistrap line 296.
apt-get -y  -o Apt::Architecture=armel -o Apt::Get::AllowUnauthenticated=true -o Apt::Get::Download-Only=true -o Apt::Install-Recommends=false -o Dir=/home/mike/celf/multistrap/RFS/ -o Dir::Etc=/home/mike/celf/multistrap/RFS/etc/apt/ -o Dir::Etc::SourceList=/home/mike/celf/multistrap/RFS/etc/apt/sources.list.d/multistrap.sources.list -o Dir::State=/home/mike/celf/multistrap/RFS/var/lib/apt/ -o Dir::State::Status=/home/mike/celf/multistrap/RFS/var/lib/dpkg/status -o Dir::Cache=/home/mike/celf/multistrap/RFS/var/cache/apt/ install balloon3-config base-files base-passwd bash bsdutils coreutils debianutils diff dpkg e2fslibs e2fsprogs findutils gcc-4.3-base grep grip-config gzip hostname initscripts libacl1 libattr1 libblkid1 libc6 libcap1 libcomerr2 libdevmapper1.02.1 libgcc1 liblocale-gettext-perl libncurses5 libpam-modules libpam-runtime libpam0g libselinux1 libsepol1 libslang2 libss2 libstdc++6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libuuid1 libvolume-id0 login lsb-base makedev mawk mktemp mount ncurses-base ncurses-bin passwd perl-base procps sed sysv-rc sysvinit sysvinit-utils tar tzdata util-linux zlib1g
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  apt debconf debconf-i18n debian-archive-keyring dhcp3-client dhcp3-common gnupg gpgv ifupdown libbz2-1.0 libdb4.6 libncursesw5 libnewt0.52 libpopt0
  libreadline5 libssl0.9.8 libusb-0.1-4 lzma module-init-tools nano net-tools netbase ntpdate readline-common udev wget whiptail
The following NEW packages will be installed:
  apt balloon3-config base-files base-passwd bash bsdutils coreutils debconf debconf-i18n debian-archive-keyring debianutils dhcp3-client dhcp3-common diff
  dpkg e2fslibs e2fsprogs findutils gcc-4.3-base gnupg gpgv grep grip-config gzip hostname ifupdown initscripts libacl1 libattr1 libblkid1 libbz2-1.0 libc6
  libcap1 libcomerr2 libdb4.6 libdevmapper1.02.1 libgcc1 liblocale-gettext-perl libncurses5 libncursesw5 libnewt0.52 libpam-modules libpam-runtime libpam0g
  libpopt0 libreadline5 libselinux1 libsepol1 libslang2 libss2 libssl0.9.8 libstdc++6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl
  libusb-0.1-4 libuuid1 libvolume-id0 login lsb-base lzma makedev mawk mktemp module-init-tools mount nano ncurses-base ncurses-bin net-tools netbase
  ntpdate passwd perl-base procps readline-common sed sysv-rc sysvinit sysvinit-utils tar tzdata udev util-linux wget whiptail zlib1g
0 upgraded, 87 newly installed, 0 to remove and 0 not upgraded.
Need to get 15.4MB of archives.
After this operation, 48.4MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  libstdc++6 libbz2-1.0 readline-common libncurses5 libreadline5 libusb-0.1-4 zlib1g gpgv gnupg debian-archive-keyring apt debianutils dhcp3-common
  libattr1 libacl1 libselinux1 coreutils lzma dpkg perl-base liblocale-gettext-perl libtext-iconv-perl libtext-charwidth-perl libtext-wrapi18n-perl
  debconf-i18n debconf dhcp3-client sed ncurses-bin lsb-base module-init-tools libssl0.9.8 wget hostname net-tools ifupdown mawk libncursesw5 nano netbase
  libcap1 ntpdate libpam-runtime libpam0g libdb4.6 libpam-modules passwd libvolume-id0 udev libslang2 libnewt0.52 libpopt0 whiptail grip-config
  gcc-4.3-base libgcc1 libc6 base-passwd base-files bash diff libcomerr2 e2fslibs libuuid1 libblkid1 libss2 e2fsprogs findutils grep gzip login mktemp
  mount libsepol1 sysvinit-utils initscripts sysv-rc sysvinit tar tzdata util-linux balloon3-config bsdutils libdevmapper1.02.1 makedev ncurses-base procps
Authentication warning overridden.
Get:1 http://www.emdebian.org/grip/ lenny/main libstdc++6 4.3.2-1.1em1 [268kB]
Get:2 http://www.emdebian.org/grip/ lenny/main libbz2-1.0 1.0.5-1em1 [37.2kB]
Get:3 http://www.emdebian.org/grip/ lenny/main readline-common 5.2-3.1em1 [3,202B]
Get:4 http://www.emdebian.org/grip/ lenny/main libncurses5 5.7+20081213-1em1 [165kB]
Get:5 http://www.emdebian.org/grip/ lenny/main libreadline5 5.2-3.1em1 [108kB]
Get:6 http://www.emdebian.org/grip/ lenny/main libusb-0.1-4 2:0.1.12-13em1 [13.7kB]
Get:7 http://www.emdebian.org/grip/ lenny/main zlib1g 1:1.2.3.3.dfsg-12em1 [48.1kB]
Get:8 http://www.emdebian.org/grip/ lenny/main gpgv 1.4.9-3+lenny1em1 [139kB]
Get:9 http://www.emdebian.org/grip/ lenny/main gnupg 1.4.9-3+lenny1em1 [533kB]
Get:10 http://www.emdebian.org/grip/ lenny/main debian-archive-keyring 2010.08.28~lenny1em1 [17.9kB]
Get:11 http://www.emdebian.org/grip/ lenny/main apt 0.7.20.2+lenny2em1 [514kB]
Get:12 http://www.emdebian.org/grip/ lenny/main debianutils 2.30em1 [23.4kB]
Get:13 http://www.emdebian.org/grip/ lenny/main dhcp3-common 3.1.1-6+lenny4em1 [157kB]
Get:14 http://www.emdebian.org/grip/ lenny/main libattr1 1:2.4.43-2em1 [7,706B]
Get:15 http://www.emdebian.org/grip/ lenny/main libacl1 2.2.47-2em1 [14.0kB]
Get:16 http://www.emdebian.org/grip/ lenny/main libselinux1 2.0.65-5em1 [50.0kB]
Get:17 http://www.emdebian.org/grip/ lenny/main coreutils 6.10-6em1 [1,162kB]
Get:18 http://www.emdebian.org/grip/ lenny/main lzma 4.43-14em1 [51.0kB]
Get:19 http://www.emdebian.org/grip/ lenny/main dpkg 1.14.29em1 [405kB]
Get:20 http://www.emdebian.org/grip/ lenny/main perl-base 5.10.0-19lenny2em1 [905kB]
Get:21 http://www.emdebian.org/grip/ lenny/main liblocale-gettext-perl 1.05-4em1 [11.0kB]
Get:22 http://www.emdebian.org/grip/ lenny/main libtext-iconv-perl 1.7-1+b1em1 [11.2kB]
Get:23 http://www.emdebian.org/grip/ lenny/main libtext-charwidth-perl 0.04-5+b1em1 [6,656B]
Get:24 http://www.emdebian.org/grip/ lenny/main libtext-wrapi18n-perl 0.06-6em1 [4,444B]
Get:25 http://www.emdebian.org/grip/ lenny/main debconf-i18n 1.5.24em1 [2,882B]
Get:26 http://www.emdebian.org/grip/ lenny/main debconf 1.5.24em1 [110kB]
Get:27 http://www.emdebian.org/grip/ lenny/main dhcp3-client 3.1.1-6+lenny4em1 [185kB]
Get:28 http://www.emdebian.org/grip/ lenny/main sed 4.1.5-6em1 [23.8kB]
Get:29 http://www.emdebian.org/grip/ lenny/main ncurses-bin 5.7+20081213-1em1 [70.8kB]
Get:30 http://www.emdebian.org/grip/ lenny/main lsb-base 3.2-20em1 [5,888B]
Get:31 http://www.emdebian.org/grip/ lenny/main module-init-tools 3.4-1em1 [44.5kB]
Get:32 http://www.emdebian.org/grip/ lenny/main libssl0.9.8 0.9.8g-15+lenny8em1 [713kB]
Get:33 http://www.emdebian.org/grip/ lenny/main wget 1.11.4-2+lenny2em1 [116kB]
Get:34 http://www.emdebian.org/grip/ lenny/main hostname 2.95em1 [5,808B]
Get:35 http://www.emdebian.org/grip/ lenny/main net-tools 1.60-22em1 [156kB]
Get:36 http://www.emdebian.org/grip/ lenny/main ifupdown 0.6.8+nmu1em1 [18.9kB]
Get:37 http://www.emdebian.org/grip/ lenny/main mawk 1.3.3-11.1em1 [51.2kB]
Get:38 http://www.emdebian.org/grip/ lenny/main libncursesw5 5.7+20081213-1em1 [187kB]
Get:39 http://www.emdebian.org/grip/ lenny/main nano 2.0.7-5em1 [83.6kB]
Get:40 http://www.emdebian.org/grip/ lenny/main netbase 4.34em1 [11.6kB]
Get:41 http://www.emdebian.org/grip/ lenny/main libcap1 1:1.10-14em1 [7,574B]
Get:42 http://www.emdebian.org/grip/ lenny/main ntpdate 1:4.2.4p4+dfsg-8lenny3em1 [36.1kB]
Get:43 http://www.emdebian.org/grip/ lenny/main libpam-runtime 1.0.1-5+lenny1em1 [7,786B]
Get:44 http://www.emdebian.org/grip/ lenny/main libpam0g 1.0.1-5+lenny1em1 [41.0kB]
Get:45 http://www.emdebian.org/grip/ lenny/main libdb4.6 4.6.21-11em1 [531kB]
Get:46 http://www.emdebian.org/grip/ lenny/main libpam-modules 1.0.1-5+lenny1em1 [160kB]
Get:47 http://www.emdebian.org/grip/ lenny/main passwd 1:4.1.1-6+lenny1em1 [267kB]
Get:48 http://www.emdebian.org/grip/ lenny/main libvolume-id0 0.125-7+lenny3em1 [18.2kB]
Get:49 http://www.emdebian.org/grip/ lenny/main udev 0.125-7+lenny3em1 [145kB]
Get:50 http://www.emdebian.org/grip/ lenny/main libslang2 2.1.3-3em1 [266kB]
Get:51 http://www.emdebian.org/grip/ lenny/main libnewt0.52 0.52.2-11.3+lenny1em1 [36.7kB]
Get:52 http://www.emdebian.org/grip/ lenny/main libpopt0 1.14-4em1 [22.3kB]
Get:53 http://www.emdebian.org/grip/ lenny/main whiptail 0.52.2-11.3+lenny1em1 [11.7kB]
Get:54 http://www.emdebian.org/grip/ lenny/main grip-config 0.1.2em1 [11.5kB]
Get:55 http://www.emdebian.org/grip/ lenny/main gcc-4.3-base 4.3.2-1.1em1 [5,496B]
Get:56 http://www.emdebian.org/grip/ lenny/main libgcc1 1:4.3.2-1.1em1 [23.7kB]
Get:57 http://www.emdebian.org/grip/ lenny/main libc6 2.7-18lenny4em1 [4,410kB]
Get:58 http://www.emdebian.org/grip/ lenny/main base-passwd 3.5.20em1 [11.5kB]
Get:59 http://www.emdebian.org/grip/ lenny/main base-files 5lenny7em1 [49.2kB]
Get:60 http://www.emdebian.org/grip/ lenny/main bash 3.2-4em1 [364kB]
Get:61 http://www.emdebian.org/grip/ lenny/main diff 2.8.1-12em1 [59.6kB]
Get:62 http://www.emdebian.org/grip/ lenny/main libcomerr2 1.41.3-1em1 [6,366B]
Get:63 http://www.emdebian.org/grip/ lenny/main e2fslibs 1.41.3-1em1 [91.3kB]
Get:64 http://www.emdebian.org/grip/ lenny/main libuuid1 1.41.3-1em1 [10.8kB]
Get:65 http://www.emdebian.org/grip/ lenny/main libblkid1 1.41.3-1em1 [21.6kB]
Get:66 http://www.emdebian.org/grip/ lenny/main libss2 1.41.3-1em1 [10.9kB]
Get:67 http://www.emdebian.org/grip/ lenny/main e2fsprogs 1.41.3-1em1 [234kB]
Get:68 http://www.emdebian.org/grip/ lenny/main findutils 4.4.0-2em1 [160kB]
Get:69 http://www.emdebian.org/grip/ lenny/main grep 2.5.3~dfsg-6em1 [128kB]
Get:70 http://www.emdebian.org/grip/ lenny/main gzip 1.3.12-6+lenny1em1 [44.0kB]
Get:71 http://www.emdebian.org/grip/ lenny/main login 1:4.1.1-6+lenny1em1 [50.6kB]
Get:72 http://www.emdebian.org/grip/ lenny/main mktemp 1.5-9em1 [5,772B]
Get:73 http://www.emdebian.org/grip/ lenny/main mount 2.13.1.1-1em1 [69.3kB]
Get:74 http://www.emdebian.org/grip/ lenny/main libsepol1 2.0.30-2em1 [96.4kB]
Get:75 http://www.emdebian.org/grip/ lenny/main sysvinit-utils 2.86.ds1-61em1 [17.8kB]
Get:76 http://www.emdebian.org/grip/ lenny/main initscripts 2.86.ds1-61em1 [33.6kB]
Get:77 http://www.emdebian.org/grip/ lenny/main sysv-rc 2.86.ds1-61em1 [13.7kB]
Get:78 http://www.emdebian.org/grip/ lenny/main sysvinit 2.86.ds1-61em1 [46.8kB]
Get:79 http://www.emdebian.org/grip/ lenny/main tar 1.20-1+lenny1em1 [148kB]
Get:80 http://www.emdebian.org/grip/ lenny/main tzdata 2010j-0lenny1em1 [749kB]
Get:81 http://www.emdebian.org/grip/ lenny/main util-linux 2.13.1.1-1em1 [293kB]
Get:82 http://www.emdebian.org/grip/ lenny/main balloon3-config 0.6 [2,400B]
Get:83 http://www.emdebian.org/grip/ lenny/main bsdutils 1:2.13.1.1-1em1 [17.0kB]
Get:84 http://www.emdebian.org/grip/ lenny/main libdevmapper1.02.1 2:1.02.27-4em1 [44.1kB]
Get:85 http://www.emdebian.org/grip/ lenny/main makedev 2.3.1-88em1 [15.8kB]
Get:86 http://www.emdebian.org/grip/ lenny/main ncurses-base 5.7+20081213-1em1 [16.4kB]
Get:87 http://www.emdebian.org/grip/ lenny/main procps 1:3.2.7-11em1 [160kB]
Fetched 15.4MB in 3s (4,819kB/s)
Download complete and in download only mode
I: Calculating obsolete packages
I: Extracting apt_0.7.20.2+lenny2em1_armel.deb...
 -> Processing conffiles for apt
I: Extracting balloon3-config_0.6_all.deb...
I: Extracting base-files_5lenny7em1_armel.deb...
 -> Processing conffiles for base-files
I: Extracting base-passwd_3.5.20em1_armel.deb...
I: Extracting bash_3.2-4em1_armel.deb...
 -> Processing conffiles for bash
I: Extracting bsdutils_1%3a2.13.1.1-1em1_armel.deb...
I: Extracting coreutils_6.10-6em1_armel.deb...
I: Extracting debconf-i18n_1.5.24em1_all.deb...
I: Extracting debconf_1.5.24em1_all.deb...
 -> Processing conffiles for debconf
I: Extracting debian-archive-keyring_2010.08.28~lenny1em1_all.deb...
I: Extracting debianutils_2.30em1_armel.deb...
I: Extracting dhcp3-client_3.1.1-6+lenny4em1_armel.deb...
 -> Processing conffiles for dhcp3-client
I: Extracting dhcp3-common_3.1.1-6+lenny4em1_armel.deb...
I: Extracting diff_2.8.1-12em1_armel.deb...
I: Extracting dpkg_1.14.29em1_armel.deb...
 -> Processing conffiles for dpkg
I: Extracting e2fslibs_1.41.3-1em1_armel.deb...
I: Extracting e2fsprogs_1.41.3-1em1_armel.deb...
 -> Processing conffiles for e2fsprogs
I: Extracting findutils_4.4.0-2em1_armel.deb...
I: Extracting gcc-4.3-base_4.3.2-1.1em1_armel.deb...
I: Extracting gnupg_1.4.9-3+lenny1em1_armel.deb...
I: Extracting gpgv_1.4.9-3+lenny1em1_armel.deb...
I: Extracting grep_2.5.3~dfsg-6em1_armel.deb...
I: Extracting grip-config_0.1.2em1_all.deb...
I: Extracting gzip_1.3.12-6+lenny1em1_armel.deb...
I: Extracting hostname_2.95em1_armel.deb...
I: Extracting ifupdown_0.6.8+nmu1em1_armel.deb...
 -> Processing conffiles for ifupdown
I: Extracting initscripts_2.86.ds1-61em1_armel.deb...
 -> Processing conffiles for initscripts
I: Extracting libacl1_2.2.47-2em1_armel.deb...
I: Extracting libattr1_1%3a2.4.43-2em1_armel.deb...
I: Extracting libblkid1_1.41.3-1em1_armel.deb...
I: Extracting libbz2-1.0_1.0.5-1em1_armel.deb...
I: Extracting libc6_2.7-18lenny4em1_armel.deb...
 -> Processing conffiles for libc6
I: Extracting libcap1_1%3a1.10-14em1_armel.deb...
I: Extracting libcomerr2_1.41.3-1em1_armel.deb...
I: Extracting libdb4.6_4.6.21-11em1_armel.deb...
I: Extracting libdevmapper1.02.1_2%3a1.02.27-4em1_armel.deb...
I: Extracting libgcc1_1%3a4.3.2-1.1em1_armel.deb...
I: Extracting liblocale-gettext-perl_1.05-4em1_armel.deb...
I: Extracting libncurses5_5.7+20081213-1em1_armel.deb...
I: Extracting libncursesw5_5.7+20081213-1em1_armel.deb...
I: Extracting libnewt0.52_0.52.2-11.3+lenny1em1_armel.deb...
I: Extracting libpam-modules_1.0.1-5+lenny1em1_armel.deb...
 -> Processing conffiles for libpam-modules
I: Extracting libpam-runtime_1.0.1-5+lenny1em1_all.deb...
 -> Processing conffiles for libpam-runtime
I: Extracting libpam0g_1.0.1-5+lenny1em1_armel.deb...
I: Extracting libpopt0_1.14-4em1_armel.deb...
I: Extracting libreadline5_5.2-3.1em1_armel.deb...
I: Extracting libselinux1_2.0.65-5em1_armel.deb...
I: Extracting libsepol1_2.0.30-2em1_armel.deb...
I: Extracting libslang2_2.1.3-3em1_armel.deb...
I: Extracting libss2_1.41.3-1em1_armel.deb...
I: Extracting libssl0.9.8_0.9.8g-15+lenny8em1_armel.deb...
I: Extracting libstdc++6_4.3.2-1.1em1_armel.deb...
I: Extracting libtext-charwidth-perl_0.04-5+b1em1_armel.deb...
I: Extracting libtext-iconv-perl_1.7-1+b1em1_armel.deb...
I: Extracting libtext-wrapi18n-perl_0.06-6em1_all.deb...
I: Extracting libusb-0.1-4_2%3a0.1.12-13em1_armel.deb...
I: Extracting libuuid1_1.41.3-1em1_armel.deb...
I: Extracting libvolume-id0_0.125-7+lenny3em1_armel.deb...
I: Extracting login_1%3a4.1.1-6+lenny1em1_armel.deb...
 -> Processing conffiles for login
I: Extracting lsb-base_3.2-20em1_all.deb...
I: Extracting lzma_4.43-14em1_armel.deb...
I: Extracting makedev_2.3.1-88em1_all.deb...
I: Extracting mawk_1.3.3-11.1em1_armel.deb...
I: Extracting mktemp_1.5-9em1_armel.deb...
I: Extracting module-init-tools_3.4-1em1_armel.deb...
 -> Processing conffiles for module-init-tools
I: Extracting mount_2.13.1.1-1em1_armel.deb...
I: Extracting nano_2.0.7-5em1_armel.deb...
 -> Processing conffiles for nano
I: Extracting ncurses-base_5.7+20081213-1em1_all.deb...
 -> Processing conffiles for ncurses-base
I: Extracting ncurses-bin_5.7+20081213-1em1_armel.deb...
I: Extracting net-tools_1.60-22em1_armel.deb...
I: Extracting netbase_4.34em1_all.deb...
 -> Processing conffiles for netbase
I: Extracting ntpdate_1%3a4.2.4p4+dfsg-8lenny3em1_armel.deb...
 -> Processing conffiles for ntpdate
I: Extracting passwd_1%3a4.1.1-6+lenny1em1_armel.deb...
 -> Processing conffiles for passwd
I: Extracting perl-base_5.10.0-19lenny2em1_armel.deb...
I: Extracting procps_1%3a3.2.7-11em1_armel.deb...
 -> Processing conffiles for procps
I: Extracting readline-common_5.2-3.1em1_all.deb...
I: Extracting sed_4.1.5-6em1_armel.deb...
I: Extracting sysv-rc_2.86.ds1-61em1_all.deb...
I: Extracting sysvinit-utils_2.86.ds1-61em1_armel.deb...
I: Extracting sysvinit_2.86.ds1-61em1_armel.deb...
I: Extracting tar_1.20-1+lenny1em1_armel.deb...
 -> Processing conffiles for tar
I: Extracting tzdata_2010j-0lenny1em1_all.deb...
I: Extracting udev_0.125-7+lenny3em1_armel.deb...
 -> Processing conffiles for udev
I: Extracting util-linux_2.13.1.1-1em1_armel.deb...
 -> Processing conffiles for util-linux
I: Extracting wget_1.11.4-2+lenny2em1_armel.deb...
 -> Processing conffiles for wget
I: Extracting whiptail_0.52.2-11.3+lenny1em1_armel.deb...
I: Extracting zlib1g_1%3a1.2.3.3.dfsg-12em1_armel.deb...
I: Unpacking complete.
Get:1 http://www.emdebian.org lenny Release.gpg [197B]
Ign http://www.emdebian.org/grip/ lenny/main Translation-en_US
Get:2 http://www.emdebian.org lenny Release [21.4kB]
Ign http://www.emdebian.org lenny Release
Ign http://www.emdebian.org lenny/main Packages
Ign http://www.emdebian.org lenny/main Sources
Ign http://www.emdebian.org lenny/main Packages
Ign http://www.emdebian.org lenny/main Sources
Hit http://www.emdebian.org lenny/main Packages
Hit http://www.emdebian.org lenny/main Sources
Fetched 198B in 0s (2,020B/s)
Reading package lists... Done
W: GPG error: http://www.emdebian.org lenny Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B5B7720097BB3B58

Multistrap system installed successfully in /home/mike/celf/multistrap/RFS/.

Let’s explain the parameters:

  • armel is the architecture, for our example: arm in little endian
  • -d $PWD/RFS is the output directory containing the root filesystem. Be careful to pass an absolute path.
  • -f multistrap.conf is the name of the configuration file

If you look at RFS/dev, you will see that there are no device files in it. This will be a problem at boot time, unless you build a kernel with the below options:

CONFIG_DEVTMPFS=y
CONFIG_DEVTMPFS_MOUNT=y

Thanks to these parameters, the kernel will automatically mount a tmpfs filesystem on /dev, and will populate it with devices present on the system.

Now we have a root filesystem, but we still need to run the package configuration scripts to make it usable. The packages were installed, but their configuration scripts couldn’t be executed, because they can only run on the target architecture.

The easiest way to do this is to use NFS. On the host side, you need to export the root filesystem directory through NFS. On the target side you have to select /bin/sh for the init process. A typical kernel command could be:

console=ttyS0,115200 root=/dev/nfs nfsroot=192.168.0.1:/path/RFS rw ip=192.168.0.20 init=/bin/sh

Then boot your board. You should reach a command line.

First mount /proc:

mount -t proc nodev /proc

Then configure your packages using this command line:

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin  dpkg --configure -a 

You will get a few questions about localization for tzdata, then the packages will be configured.

Finally go back to your host to change the RFS/etc/inittab file by uncommenting the below line and modifying it according to your serial console configuration (usually 115200). For example, replace

#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100

by

T0:23:respawn:/sbin/getty -L ttyS0 115200 vt100

As we built this root filesystem as a normal user we may have problems with some setuid programs, which need to be owned by the root user. So let’s change the ownership of some directories:

sudo chown root:root -R RFS/bin RFS/usr/bin RFS/sbin RFS/usr/sbin

The last trick is to delete the root password by modifying RFS/etc/passwd, by replacing

root:x:0:0:root:/root:/bin/bash

by

root::0:0:root:/root:/bin/bash

You can now reboot your system without the init=/bin/sh kernel parameter. We now have a ready to use embedded Linux root filesystem with the power of Debian.

Other things to fix and do:

  • Configure the /etc/resolv.conf file to be able to connect to the Internet.
  • Configure the gateway in the ip= kernel parameter (ip=client-ip:server-ip:gw-ip:netmask:hostname:device:autoconf). For example:
    bootargs=console=ttyS0,115200n8 root=/dev/nfs ip=192.168.2.100::192.168.2.1:255.255.255.0:emdebian:eth0:off nfsroot=192.168.2.1:/home/mike/work/celf/
  • Install other packages such as mtd-utils and vim
  • Install kernel modules (either manually or through a kernel package)
  • Add a new user
  • Create a minimum /etc/fstab file

You now have a Debian system for which it is very easy to add new software, and which can be configured in a very familiar way. That’s great to make product prototypes, small, low-power and secure servers for home or office use, and in some cases, even real products.