OpenPandora
|
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.
- Recommended Reading
- Guides
- * http://www.gentoo-wiki.info/Embedded_Gentoo
- * http://www.gentoo-wiki.info/TinyGentoo
- * http://www.gentoo.org/proj/en/base/embedded/cross-development.xml
- Other Information
Hardware
| OpenPandora MK2 Specifications | Status | Photos | |||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
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
Generate a new ARM build using crossdev
Method 2 - generic arm 2008.0 tarball
Use armin76's generic arm-2008.0 tarball and recompile
Compiling & Building Your System
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
- http://www.gentoo-wiki.info/Power_Management
- http://www.gentoo-wiki.info/HOWTO_Userspace_Software_Suspend_%28uswsusp%29
- http://www.gentoo-wiki.info/TuxOnIce
ACPI
Frequency Scaling
X
X.Org
| File: /etc/X11/xorg.conf |
- http://www.gentoo-wiki.info/HOWTO_Modular_Xorg
- http://www.gentoo-wiki.info/HOWTO_Widescreen_Resolutions_%28WSXGA%29
- http://www.gentoo-wiki.info/HOWTO_Automatically_turn_off_your_monitor
- http://www.gentoo-wiki.info/HOWTO_Dual_Monitors
- http://www.gentoo-wiki.info/HOWTO_Enabling_Monitor_Power_Saver
- http://www.gentoo-wiki.info/HOWTO_Separate_x-screens_on_Monitor_and_TV
KDrive
Multimedia
Video
Sound
http://elinux.org/BeagleBoard/DSP_Howto
Networking
- http://www.gentoo-wiki.info/Wireless/Managers
- http://www.gentoo-wiki.info/HOWTO_NetworkManager
- dropbear
- lynx
Peripherals
USB
Bluetooth
- http://www.gentoo-wiki.info/HOWTO_The_host-to-host_Bluetooth
- http://www.gentoo-wiki.info/HOWTO_Configure_a_bluetooth_network_access_point
- http://www.gentoo-wiki.info/Bluetooth_headset
- http://www.gentoo-wiki.info/Bluetooth_mouse
- http://www.gentoo-wiki.info/Bluetooth_keyboard
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
- OpenPandora.org
- Gentoo Wiki HOWTO: Setup Gentoo on a PDA or Embedded System
- armin76's gentoo-arm-2000.8 stages
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should be using interactive floor plans and list their apartments, townhouses and units.

