Search:  
Gentoo Wiki

OpenPandora

Contents

Introduction

This guide is intended for Gentoo users and the OpenPandora system. While this may also be applicable to similar designs, the essence of this article will remain true to its purpose of assisting in the installation and configuration of this system and its minor subsets.

Note: This is still a work in progress since I don't have the an OpenPandora as of yet. All my edits, until I can get my grubby hands on one, is based on searching the forums, HOWTOs, and a lot of coffee.
* http://www.arm.com/products/CPUs/ARM_Cortex-A8.html
* http://www.kroah.com/lkn/
* http://www.gentoo-wiki.info/Embedded_Gentoo
* http://www.gentoo-wiki.info/TinyGentoo
* http://www.gentoo.org/proj/en/base/embedded/cross-development.xml
* http://groups.google.org/beagleboard/
* http://elinux.org/BeagleBoard

Hardware

OpenPandora MK2 Specifications Status Photos
  • ARM® Cortex™-A8 600Mhz+ CPU running Linux
  • 430-MHz TMS320C64x+™ DSP Core
  • PowerVR SGX OpenGL 2.0 ES compliant 3D hardware
  • 800x480 4.3" 16.7 million colours touchscreen LCD
  • Wifi 802.11b/g, Bluetooth & High Speed USB 2.0 Host
  • Dual SDHC card slots & SVideo TV output
  • Dual Analog and Digital gaming controls
  • 43 button QWERTY and numeric keypad
Function Status Method
Booting unknown unknown
Keyboard unknown unknown
Mouse unknown unknown
Touchscreen unknown unknown
Video unknown unknown
Audio unknown unknown
Wireless unknown unknown
Bluetooth unknown unknown
SD/MMC unknown unknown
Microphone unknown unknown

System Layout

Build System Root Directory

Establish a directory point as an environmental variable that you will be using for your build.

Note: This directory's primary purpose is to compile and test your ARM builds prior to installing them on your Pandora. If desired, you can merge the pandora and pandora-img directories.
mkdir /usr/local/build/arm/pandora
export SYSROOT="/usr/local/build/arm/pandora"

Append to ~/.bashrc:

File: ~/.bashrc
SYSROOT="/usr/local/build/arm/pandora"

Directory for Compiled Binary Packages

mkdir /usr/local/build/arm/packages

Final Installation Directory

Note: You may want to make this a mount-point for your external SDHC card or a OS img that will be placed on internal NAND drive, we will come back to this at the end.
mkdir /usr/local/build/arm/pandora-img

Prebuilt Base Systems

Note: If you are going to use one of the systems below, you can immediately jump to the Configuring & Building Your System section after you install it in your SYSROOT directory

armin76's generic ARM 2008

Unpack armin76's stage1 2008.0 tarball

cd $SYSROOT
tar -xvjpf stage1-arm-2008.0.tar.bz2

Getting Started

Method 1 - Crossdev


Warning: Due to either the lack of having a pandora available or you just don't want to compile everything on your 600MHz CPU, 128MB RAM OpenPandora system... This section is intended for users that want to use a Gentoo linux host to cross-compile their personal pandora build which will later be placed on either a external SDHC or the internal NAND drive. If you want to use a prebuilt system then use another method.

Generate a new ARM build using crossdev

Method 2 - generic arm 2008.0 tarball


Note: I found armin76's arm-unknown-linux-gnu via forums. This is a generic gentoo toolchain build and IS NOT optimized for the pandora. However this should work from the box and you can use the generic install guide to get you going.

Use armin76's generic arm-2008.0 tarball and recompile

Compiling & Building Your System

Warning: BEFORE you proceed, this guide is assuming that you have successfully completed one of the Getting Started method's. If you have not, You shall not pass!
Note: Much of this information was gleened from TinyGentoo.

Setup of Base System

Create appropriate mounts and chroot into client environment

mount --bind /usr/portage $SYSROOT/usr/portage
mount --bind /dev $SYSROOT/dev
mount -t proc proc $SYSROOT/proc
??? chroot $SYSROOT /bin/bash
??? env-update && source /etc/profile

CLIENT make.conf

File: SYSROOT/etc/make.conf
 ### Hardware
 ARCH="arm"
 CHOST="arm-unknown-linux-gnueabi"
 CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=vfp -mfloat-abi=softfp -fexpensive-optimizations -ftree-vectorize -fomit-frame-pointer -O4 -ffast-math"
 CXXFLAGS="${CFLAGS}"
 VIDEO_CARDS=""
 ALSA_CARDS=""
 INPUT_DEVICES="keyboard"

 ### Build Options
 ACCEPT_KEYWORDS="arm"
 FEATURES="ccache buildpkg"
 PKGDIR="${SYSROOT}/../packages"
 EMERGE_DEFAULT_OPTS=""
 MAKEOPTS="-j2"
 PORTAGE_NICENESS="3"
 GENTOO_MIRRORS=""
 SYNC=""

 ### Language
 LINGUAS = "en"
 
 ### USE Section
 #USE_DISABLED="-nls -iconv -pregen -userlocales"
 #USE_CPU=""
 #USE_HARDWARE=""
 #USE_X11="X"
 #USE_MEDIA=""
 #USE_NETWORK=""
 #USE_OPTIONAL=""
 #USE="${USE_DISABLED} ${USE_CPU} ${USE_HARDWARE} ${USE_X11} ${USE_MEDIA} ${USE_NETWORK} ${USE_OPTIONAL}"

 ### USE for Cross Compiling
 USE="-* minimal"

Compiling

Recompile Environment

??? emerge ccache
??? emerge -au portage
??? emerge -auDN world
??? cp /etc/skel/.bash_profile /etc/skel/.bashrc /root/

Check and see if the environment is sane.

??? emerge gentoolkit
??? revdep-rebuild

Everything is ok, lets move on.

??? mkdir -p /etc/portage
??? echo "=sys-apps/baselayout-2.0.0 **" >> /etc/portage/package.keywords
??? echo "=sys-apps/openrc-0.2.1-r1 **" >> /etc/portage/package.keywords
??? echo "=sys-fs/udev-118-r2 **" >> /etc/portage/package.keywords
??? echo "=sys-apps/baselayout-2.0.0" >> /etc/portage/package.unmask
??? echo "=sys-apps/openrc-0.2.1-r1" >> /etc/portage/package.unmask
??? USE=make-symlinks emerge -avkN =sys-apps/baselayout-2.0.0 busybox

Kernel

Note: To improve the use of the Pandora's hardware from stock kernels, you more then likely will need to patch your kernel accordinginly. Below is some useful software to install.
xmerge dev-util/git

gentoo-sources-2.6.26-xx


Install client gentoo kernel

xmerge -av sys-kernel/gentoo-sources

OMAP Processor and DSP Patch for 2.6 kernels from BeagleBoard DSP Howto

git clone http://www.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6.git
cd linux-omap-2.6
wget http://4869037.web.fc2.com/tidspbridge-20080922.tgz
tar xvzf tidspbridge-20080922.tgz
git am *.patch
make omap3_beagle_defconfig
File: SYSROOT/usr/src/linux/.config
 CONFIG_FB_OMAP_CONSISTENT_DMA_SIZE=14
 CONFIG_MPU_BRIDGE=m

??? Use Pandora 43key keymap ???

loadkeys -m <path_to_keymap> > drivers/char/defkeymap.c
Linux Kernel Configuration: gentoo-sources-2.6.26-xx
 Code maturity level options  --->
  [*] Prompt for development and/or incomplete code/drivers
 General setup  --->
  [*] Optimize for size
  [*] Configure standard kernel features (for small systems)  --->  
 Processor type and features --->
  (4GB) High Memory Support
  [*] MTRR (Memory Type Range Register) support
  [ ] Symmetric multi-processing support
 Device Drivers --->
  ATA/IDE/MFM/RLL support  --->
   < > ATA/IDE/MFM/RLL support
  SCSI support  --->
   <*> SCSI support
   <*>   SCSI disk support
  Block devices  --->
  <*> RAM disk support
  (16) Default number of RAM disks
  (4096) Default RAM disk size (kbytes)
  [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support
  Network device support  --->
   < > Dummy net driver support
   Ethernet (10 or 100Mbit)  --->
  Input device support  --->
   [*]   Keyboards
  Character devices  --->
   [*] Virtual terminal
   [*]   Support for console on virtual terminal
   [*] Unix98 PTY support
   < > /dev/agpgart (AGP Support)
   < > Direct Rendering Manager 
  USB support  --->
   <*> Support for USB
   <*>   EHCI HCD (USB 2.0) support (EXPERIMENTAL)
   <*>   UHCI Alternate Driver (JE) support
   <*>   OHCI (Compaq, iMacs, OPTi, SiS, ALi, ...) support
   <*>   USB Mass Storage support
  <M> DOS FAT fs support
  <M>   VFAT (Windows-95) fs support
  [*] /proc file system support
  Native Language Support  --->
   <*> NLS ISO 8859-1  (Latin 1; Western European Languages) (NEW)
 Console drivers  --->
  [*] VGA text console
  [*] Video mode selection support

Kernel Installation


cd SYSROOT/usr/src/linux
make ARCH=arm CROSS_COMPILE=arm-unknown-linux-gnu-
make modules_install

Configuration

Boot

GRUB

File: SYSROOT/boot/grub/grub.conf
 timeout 5
 default 0
 fallback 1
 splashimage=(hdx,x)/boot/grub/splash.xpm.gz

 title  Gentoo-x.x.xx-xxxx-xx
 root   (hdx,x)
 kernel /boot/xxxx
 initrd /initramfs-x.x.xx-xxxx-xx
 

Make an init

File: SYSROOT/init
#!/bin/ash
echo
echo
echo " Welcome to Gentoo on the OpenPandora."
echo
echo

echo " * Setting umask.."
umask 022
echo " * Mounting /proc.."
mount -t proc none /proc
echo " * Mounting metafilesystems..."
mount -t proc   proc   /proc
mount -t tmpfs  mdev   /dev && mkdir /dev/pts
mount -t devpts devpts /dev/pts
mount -t sysfs  sysfs  /sys
echo " * Populating /dev..."
echo /sbin/mdev > /proc/sys/kernel/hotplug
mdev -s		
echo " * Starting init.."
exec <dev/console >dev/console 2>&1
exec chroot . /sbin/init

echo " *** Starting init failed! ***"
echo " * Trying to start a shell.."
exec /bin/ash
chmod +x SYSROOT/init

System Configs

Edit your fstab

File: SYSROOT/etc/fstab
<nowiki>
 none                    /tmp            tmpfs           defaults        0 0
 none                    /proc           proc            defaults        0 0
 /dev/sda1               /boot           ext2            noauto,ro       0 0
 /dev/sda2               /mnt/dongle     vfat            defaults        0 0
</nowiki>

Set your hostname

echo "OpenPandora" > SYSROOT/etc/hostname

Finishing Up

chroot and user creation

??? chroot /tinygentoo /bin/ash
??? passwd
??? addgroup -g 100 users
??? adduser -h /home/foo -s /bin/ash -G users foo
??? exit

Recommended Software

Boot

INITRAMFS


Power


ACPI


sys-apps/acpid

Frequency Scaling


X

X.Org


File: /etc/X11/xorg.conf

KDrive


Multimedia

Video


Sound


http://elinux.org/BeagleBoard/DSP_Howto

Networking

Peripherals

USB


Bluetooth


Input Devices


Keyboard


Touchscreen


Gaming Controls


Optional Software

Gaming / Emulation


Installing

Installing on External SDHC

Installing on Internal NAND

MMC Boot Disk


Note: This section assumes that you have a working SD/MMC device on a linux host designated /dev/sda. If the device is not /dev/sda, alter the following commands accordingly. The mount point is designated /mnt/mmc

Using fdisk in expert mode, set geometry to 255 heads and 63 sectors, then calculate your resulting cylinders by dividing the size (in bytes) of your MMC by 255, 63, and 512; e.g. 128450560 / 255 / 63 / 512 = 15.7 Round your result down; e.g. 15.7 = 15

/usr/sbin/fdisk /dev/sda
Command (m for help): x

Set partition geometry

Expert command (m for help): h
Number of heads (1-256, default 4): 255
Expert command (m for help): s
Number of sectors (1-63, default 62): 63
Warning: setting sector offset for DOS compatiblity
Expert command (m for help): c
Number of cylinders (1-1048576, default 1011): 15

Make partition bootable

Command (m for help): a
Partition number (1-4): 1

Set as FAT32 LBA

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

Write partition to disk

Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.

Format partition

mkfs.vfat -F 32 /dev/sda1

Mount partition

mount -t vfat -o rw /dev/sda1 /mnt/mmc

See also

Retrieved from "http://www.gentoo-wiki.info/OpenPandora"

Last modified: Sat, 11 Oct 2008 02:56:00 +0000 Hits: 678