Meego Wiki
Views

ARM/Meego on Beagleboard from scratch

From MeeGo wiki
(Difference between revisions)
Jump to: navigation, search
(Prerequisites)
Line 48: Line 48:
'''The only board currently fully supported is the BeagleBoard RevC!'''
'''The only board currently fully supported is the BeagleBoard RevC!'''
 +
 +
== Prepared images ==
 +
 +
Ready-to-run SD card images can be found on [http://bug10738.openaos.org/images/beagleboard/ bug10738]. These images can be copied directly onto a 2GB SD card:
 +
 +
<pre>
 +
dd if=<image name> of=/dev/<sd card device> bs=64k
 +
</pre>
 +
 +
It is possible that your SD card is slighty smaller than these images. In this case you can e.g. use fdisk to adjust the size of the 512MB swap partition on the card and afterwards use mkswap to reformat that partition.
== Prerequisites ==
== Prerequisites ==

Revision as of 11:59, 20 January 2011


This document describes how to create a MeeGo image for the beagleboard. More information regarding MeeGo on the Beagleboard can be found at ARM/Meego_on_the_Beagle.

[Youtube video of BeagleBoard running MeeGo handset UX]

Contents

Introduction

Tested distros

Creating this image has been tested on Ubuntu 10.10, other distros may require some things to be done differently. Several people have tried and failed to make this work on Ubuntu 9.04 and Ubuntu 9.10. Ubuntu 10.04 requires some tweaks when installing the cross compilers. It is recommended to use Ubuntu 10.10, if you want the best chance of success. Conversely, if you have made this work for other versions of Ubuntu or other distros, please add to this page any information that will help others achieve the same success.

  • Debian Lenny (you'll need to install some packages from Sid and you'll need to build some software.)

This is a work in progress. However, if you think these instructions are incomplete or lack some important aspect, feel free to edit this page or ask for help on IRC in #meego-arm on irc.freenode.net.

What works, what remains to be done

Please keep in mind that MeeGo is a work in progress. Things which already worked may be broken again and you might not end up with a working setup even though you followed the instructions precisely. Everything up to the running TI demos will likely be stable, but the MeeGo UI itself is still broken every now and then.

Working:

  • Same features as MeeGo on n900
  • MeeGo handset UX with touchscreen
  • 2D/3D video acceleration
  • Audio
  • Various USB add-ons incl. ethernet, mass-storage and bluetooth
  • Setup toolchain known working on Ubuntu 10.04/10.10

Todo:

  • Make mouse cursor visible under MeeGo HX for users without touchscreen
  • Definitive works / does not work on other distros and other versions

Known issues:

  • No beagleboard specific problems known, all known n900 problems still apply

Supported BeagleBoard versions

The RevA and RevB boards have only 128MB RAM. This is not enough for the handset distribution of MeeGo. With swap enabled the UX boots, but is barely usable. Tested board revisions: B7

The RevC boards are the best choice at this moment as their hardware is fully supported by the Linux kernel and since their 256MB RAM allow for a more fluid UX experience. Tested board revisions: C4

The XM RevA boots into handset UX and is very fast and responsive. The stock kernel doesn't yet fully support this board (CPU only runs at 800Mhz) and most important, the USB hub doesn't work under the MeeGo kernel. Tested board revisions: XM-A2

The only board currently fully supported is the BeagleBoard RevC!

Prepared images

Ready-to-run SD card images can be found on bug10738. These images can be copied directly onto a 2GB SD card:

dd if=<image name> of=/dev/<sd card device> bs=64k

It is possible that your SD card is slighty smaller than these images. In this case you can e.g. use fdisk to adjust the size of the 512MB swap partition on the card and afterwards use mkswap to reformat that partition.

Prerequisites

This document assumes that you have worked with the beagleboard before and it may be helpful if you e.g. know how to format a memory card to boot from.

If you are new to BeagleBoard you might want to learn the basics using the following resources:

The following instructions assume that your beagleboard boots from sd card. Xloader and uboot versions stored in beagleboard internal nand memory might prevent the following setup from working properly. If a bootloader is installed, you'll usually get its command prompt on the serial console when booting without sd card inserted. Entering

nand erase

there will erase the entire nand memory and reset the beagleboard into the state expected in the following instructions. Warning: Other beagleboard sd cards you might be using may rely on certain parts being store in nand and might not work anymore afterwards.

Please use a memory card of at least 2GB size for the following experiments. Otherwise the generated image may not fit onto the card.

Building MeeGo for the BeagleBoard

The beagleboard sd card image generation consists of three major steps:

  • Build of kernel and kernel modules
  • Assembly of root file system
  • Installation of bootloader, kernel and root file system on sd card

Shell scripts have been created to automate all of these steps as much as possible. You can download an archive containing those scripts here. Unpack the contents of this somewhere into your hard disk. The following steps will require about 4GB of additional free disk space.

This archive contains three shell scripts, each of them performing one of the three steps outlined before:

  • build_kernel.sh build the kernel and the modules,
  • build_image.sh assembles the root file system, and
  • setup_sdcard.sh creates an sd card from these

Build of kernel and kernel modules

To build the kernel and its modules, you'll need to cross compile for the ARM platform. The most convenient option under Ubuntu is to install the arm cross compiler that comes with ubuntu:

sudo apt-get install gcc-4.5-arm-linux-gnueabi


The MeeGo kernel source code is downloaded and compiled using the build_kernel.sh shell script:

./build_kernel.sh

All downloaded files go into the ./downloads directory, temporary build files are created in ./build and the resulting kernel will be placed in the ./deploy directory. If you are low on disk space, you can delete the ./downloads and ./build directories after the kernel has successfully been built.

Setup for Ubuntu 10.04 LTS Lucid Lynx

The gnueabi cross compiler is not available by default on the Lucid Lynx distribution. But you can get access to it using either the natty or maverick universe repositories (just be careful to disable them when you are done getting what you need).

Add the following line to your /etc/apt/sources.list. Or use the Synaptic package manager (sudo synaptic, Settings->Repositories, Other Software->Add). You may choose your own mirror if xmission is slow or doesn't work for you.

deb http://mirrors.xmission.com/ubuntu/ maverick main universe >> /etc/apt/sources.list

Do an update (hit Reload in synaptic or sudo apt-get update) and then install the gnueabi cross compiler + a few other programs that might be missing:

sudo apt-get install gcc-4.5-arm-linux-gnueabi rpm2cpio uboot-mkimage

Assembly of the root file system

The root file system (rootfs) is assembled from binary packages available in the MeeGo ARM repositories. The tool used to assemble the rootfs is called mic (MeeGo image creator). Follow the instructions at Image_Creation#From_Development_Git_Tree to install the latest version from git. Older versions will probably not work.

When using ubuntu 10.04/10.10 you'll need to install qemu using the qemu-kvm-extras-static package. If you have an existing scratchbox setup, this will collide with qemu-kvm-extras-static. After installing that package scratchbox arm will not work anymore. Removing that package and restarting the scratchbox services makes scratchbox work again.

The rootfs will also include the kernel modules. Thus the kernel has already to be built before starting the rootfs image assembly.

The rootfs image creation itself is started by the following command:

sudo ./build_image.sh

This will download all packages required to build the root file system from the internet into the ./mycachedir directory and assemble the root file system image in the ./daily directory.

If you need to save hard disk space you can remove the ./mycachedir directory once the image has successfully been built.

Installation on sd card

The last step is to put the kernel and the rootfs onto an sd card together with an xloader and uboot boot loader as required to boot the beagleboard. This is accomplished by invoking the third shell script. This script has to be given the device name of the sd card you are intending to use. On my system the sd card is /dev/sdd, so i have to invoke the script as follows:

./setup_sdcard.sh --mmc /dev/sdd

The script will as you to acknowledge this. Please watch the output carefully. Specifying e.g. your systems hard drive will wipe your entire hard disk instead of the sd card.

This will take some time as the sd card is reformatted, all bootloaders are installed, file systems are created and the kernel and the contents of the root file system are copied onto the sd card.

Boot

Plug the resulting SD card into your beagleboard and power on. After a few seconds the video will switch to 800x480 pixels and the MeeGo handset UX should appear on the screen. The first boot will always take several minutes as some media files are copied forth and back on the card.

Meego beagle.jpg

Peripheral hardware

I have tested various peripheral devices on this setup and most of them are working out of the box.

USB hubs, mice and keyboards

These just work, nothing to configure.

On the BB-XM the built-in USB hub is not detected and not working. This is currently being investigated as this worked well with previous non-MeeGo kernel versions and is broken since we switched to the MeeGo kernel line. The OTG port works and can be equipped with an external hub as a temporary work-around.

Bluetooth keyboard

My CSR bluetooth dongle works out of the box. Hcitool is present to scan for devices as well as hidd to connect to bluetooth HID devices. This has been tested with a bluetooth keyboard.

Touchscreen

My 7 inch egalax based touchscreen worked nearly perfectly out of the box. It was just a little bit mis-calibrated.

The latest hal driven xorg can be given a input configuration file to deal with this.An example setup is already included at /etc/X11/xorg.conf.d/50-input-touch.conf. If you don't have a touchscreen this file is ignored.

This configuration is automatically applied to all touchscreen devices that map to /dev/input/event*. You may have to adjust the calibration values in that file to match your device.

Ethernet

A D-Link DUB-E100 ethernet dongle works out of the box and gets an IP address via DHCP. With this network connection i was able to verify that zypper and the package management also work. A "zypper up" successfully updated a few packages.

The beagleboard XM's onboard Ethernet (a SMSC95xx based USB device) cannot be tested with the MeeGo kernel since the USB hub it is connected to currently isn't supported.

WLAN

A Ralink RT2501 based USB dongle works, is detected and can scan for networks. But it isn't provided an address via dhcp.

Audio

Audio works out of the box. Appropriate configuration files for the beagleboard have been included.

Troubleshooting/hints

Starting X programs from the serial console

If you have a keyboard and mouse you can skip this section. If you don't have a keyboard connected and want to run X programs from the console, you need to set the DISPLAY environment variable. Also it's required to change to the meego user before doing so:

[root@localhost ~]# su meego
[meego@localhost root]$ export DISPLAY=:0
[meego@localhost root]$ widgetsgallery

Making screenshots

Do you like what you see? Want to share it? Make a screenshot! This doesn't need any special software. Just copy the framebuffer contents into some file:

cp /dev/fb0 screenshot.raw

The resulting file should have a size of exactly 770048 bytes (800x480x2) if you are using a 800x480 display size at 16 bits per pixel.

On your host use ffmpeg to convert this into some standard format like png:

ffmpeg -vcodec rawvideo -f rawvideo -pix_fmt rgb565 -s 800x480 -i screenshot.raw -f image2 -vcodec png screenshot.png

Beagle-Main.jpg

Screenshot of an early handset UX on beagle (jul 2010)

Beagle-Ivi.png

Screenshot of IVI UX on beagle (nov 2010)

Related links

Personal tools