BeagleBoardUbuntuKarmic

From eLinux.org
Revision as of 00:05, 25 May 2010 by RobertCNelson (Talk | contribs) (Advanced: sgx)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is about running Ubuntu 9.10 Karmic distribution on the BeagleBoard.

Demo Image

Karmic 9.10

Built with:

sudo ./rootstock --fqdn beagleboard --login ubuntu --password temppwd --imagesize 2G \
--seed wget,nano,linux-firmware,wireless-tools,usbutils --dist karmic --serial ttyS2 \
--kernel-image http://rcn-ee.net/deb/kernel/beagle/karmic/v2.6.32.11-x13/linux-image-2.6.32.11-x13_1.0karmic_armel.deb

Get prebuilt image:

wget http://rcn-ee.net/deb/rootfs/ubuntu-9.10.2-minimal-armel.tar.7z
mirrors:
wget http://ynezz.ibawizard.net/beagleboard/ubuntu-9.10.2-minimal-armel.tar.7z
wget http://vivaphp.net/beagle/ubuntu-9.10.2-minimal-armel.tar.7z

Unpack it:

7za x ubuntu-9.10.2-minimal-armel.tar.7z
tar xf ubuntu-9.10.2-minimal-armel.tar
cd ubuntu-9.10.2-minimal-armel

Quick Install script

./setup_sdcard.sh --mmc /dev/sdX --ignore_md5sum
  • Bug: --ignore_md5sum is needed
  • Additional Options
    • --rootfs <ext3 default>
    • --swap_file <swap file size in MB's>

md5sum: 0bf198beac0a0358bc2c0097c6dddec7 ubuntu-9.10.2-minimal-armel.tar.7z

RootStock

Karmic: (9.10) boot fixup

util-linux-ng 2.16 causes this

Edit /etc/fstab

mkdir -p ./tmp
sudo mount /dev/sdX2 ./tmp
sudo gedit ./tmp/etc/fstab
add:
/dev/mmcblk0p2   /   ext3   errors=remount-ro   0   1

Note change the above "ext3" to "ext2" if the root filesystem is ext2

Add/Edit /etc/e2fsck.conf

sudo gedit ./tmp/etc/e2fsck.conf
[problems]

# Superblock last mount time is in the future (PR_0_FUTURE_SB_LAST_MOUNT).
0x000031 = {
    preen_ok = true
    preen_nomessage = true
} 

# Superblock last write time is in the future (PR_0_FUTURE_SB_LAST_WRITE).
0x000032 = {
    preen_ok = true
    preen_nomessage = true
}

Add karmic updates to /etc/apt/sources.list

sudo gedit ./tmp/etc/apt/sources.list
deb http://ports.ubuntu.com/ubuntu-ports karmic-updates main universe

Finally

cd ./tmp
sync 
cd ..
sudo umount ./tmp

You can now place the SD card into the BeagleBoard and start up the BeagleBoard.

Please be patient as the first boot can take a couple of minutes.

Advanced

SGX Video Acceleration

Use a "corporate email" and download the latest (3.01.00.02):

http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/gfxsdk/latest/index_FDS.html

Kernel Modules

An older version of these instructions was adapted for the IGEPv2 platform - if you are following this tutorial and have an IGEPv2, consider using http://wiki.jmaustin.org/wiki/IgepSGXUbuntu instead

Use the "build_sgx_module.sh" script in 2.6-stable, module source is now in the *.bin

https://code.launchpad.net/~beagleboard-kernel/+junk/2.6-stable

Directions: (2.6.34+ this will change..)

bzr branch lp:~beagleboard-kernel/+junk/2.6-stable
cd 2.6-stable
./build_kernel.sh
./build_sgx_modules.sh

Copy the *.uImage and extract the matching *.modules.tar.gz from the deploy directory to your SD card.

Copy the GFX_Linux_SDK.tar.gz examples to either your SD card or another media (large file) then boot your omap board.

Run depmod:

sudo depmod -a omaplfb

Tweak System Libraries:

sudo ln -sf /usr/lib/libXdmcp.so.6.0.0 /usr/lib/libXdmcp.so.0
sudo ln -sf /usr/lib/libXau.so.6.0.0 /usr/lib/libXau.so.0

Startup Script

For 3.01.00.02

Copy /opt/pvr/pvr script:

Jaunty:

sudo cp /opt/pvr/pvr /etc/rcS.d/S60pvr.sh
sudo chmod +x /etc/rcS.d/S60pvr.sh

Karmic/Lucid:

sudo cp /opt/pvr/pvr /etc/init.d/pvr
sudo chmod +x /etc/init.d/pvr
sudo update-rc.d pvr defaults

Note, if your updating..

cat /opt/pvr/pvr | sudo tee /etc/init.d/pvr > /dev/null

Test SGX with a DEMO

In GFX_Linux_SDK:

cd OGLES/SDKPackage/Binaries/CommonX11/Demos/ChameleonMan
./OGLESChameleonMan

Trouble Shooting

sudo rm /etc/powervr-esrev
sudo depmod -a omaplfb
sudo /etc/init.d/pvr restart

Xorg omapfb Drivers

By default Ubuntu will try to use the FBDEV video driver, however for the beagleboard we can take advantage of a more software optimized driver (still not using the sgx video hardware) using the NEON extensions of the Cortex-A8 core.

cat /var/log/Xorg.0.log | grep FBDEV

(II) FBDEV: driver for framebuffer: fbdev
(II) FBDEV(0): using default device
(II) FBDEV(0): Creating default Display subsection in Screen section
(==) FBDEV(0): Depth 16, (==) framebuffer bpp 16
(==) FBDEV(0): RGB weight 565

Login into Ubuntu and open a new terminal, xorg has to be running..

xvinfo -display :0.0

X-Video Extension version 2.2
screen #0
 no adaptors present

Drivers

Note: These are built with neon optimizations: http://git.debian.org/?p=collab-maint/xf86-video-omapfb.git;a=blob;f=debian/rules;h=c2f0d5391c96c5abb60b1e691ad86bb27e0c17d8;hb=HEAD (line 48/49)

Karmic:

sudo apt-get install xserver-xorg-video-omap3

xorg.conf

/etc/X11/xorg.conf

Section "Monitor"
    Identifier "Configured Monitor"
EndSection

Section "Screen"
    Identifier "Default Screen"
    Device "Configured Video Device"
    #Limited by SGX?
    DefaultDepth 16
EndSection

Section "Device"
    Identifier "Configured Video Device"
    Driver "omapfb"
    Option "fb" "/dev/fb0"
EndSection

To verify it was correctly installed, reboot and:

cat /var/log/Xorg.0.log | grep omapfb

(II) LoadModule: "omapfb"
(II) Loading /usr/lib/xorg/modules/drivers//omapfb_drv.so
(II) Module omapfb: vendor="X.Org Foundation"
(II) omapfb: Driver for OMAP framebuffer (omapfb) and external LCD controllers:
(WW) Error opening /sys/devices/platform/omapfb/ctrl/name: No such file or directory
(II) omapfb(0): VideoRAM: 1800KiB (SDRAM)
(II) omapfb(0): Creating default Display subsection in Screen section
(**) omapfb(0): Depth 16, (--) framebuffer bpp 16
(==) omapfb(0): RGB weight 565
(==) omapfb(0): Default visual is TrueColor
(--) omapfb(0): Virtual size is 1280x720 (pitch 1280)
(**) omapfb(0):  Built-in mode "current"
(==) omapfb(0): DPI set to (96, 96)
(II) omapfb(0): DPMS enabled
(II) omapfb(0): Video plane capabilities:
(II) omapfb(0): Video plane supports the following image formats:
(II) omapfb(0): XVideo extension initialized

Login into Ubuntu and open a new terminal, xorg has to be running..

xvinfo -display :0.0

X-Video Extension version 2.2
screen #0
  Adaptor #0: "OMAP XV adaptor"
    number of ports: 1
    port base: 56
    operations supported: PutImage 
    supported visuals:
      depth 16, visualID 0x21
    number of attributes: 1
    etc..

Bugs & Workarounds

Karmic

Root on external USB, fsck always errors's on boot, fsck.ext3 never fixes it, and no real time clock on board (Rev Bx and C2 (C3 has backup battery hookup))

mount -o remount,rw /

Script found here:

nano /etc/e2fsck.conf

[problems]

# Superblock last mount time is in the future (PR_0_FUTURE_SB_LAST_MOUNT).
0x000031 = {
    preen_ok = true
    preen_nomessage = true
}

# Superblock last write time is in the future (PR_0_FUTURE_SB_LAST_WRITE).
0x000032 = {
    preen_ok = true
    preen_nomessage = true
}