Steps to setup DirectFB dev enviroment on Ubuntu

Directly copied from a wiki page written by me, so in such a bad format.
Hope it’s still useful for others. 
 

Contents

Preparation

download & install Ubuntu 8.04 LTS

http://www.ubuntu.com/getubuntu/download

download DirectFB 1.0.1

download DirectFB-1.0.1.tar.gz and DirectFB-examples-1.0.0.tar.gz

http://www.directfb.org/

(Note: DirectFB-examples-1.0.1 doesn’t work with DirectFB-1.0.1. Get DirectFB-examples-1.0.0 from http://www.directfb.org/downloads/Old/.)

install packages

sudo apt-get install build-essential autoconf automake
sudo apt-get install libpng12-dev libjpeg62-dev libfreetype6-dev

(Note: some commands in this page need ‘root’ privilege, use ‘sudo’ if you are not logined as ‘root’.)

Enable FrameBuffer support

On Ubuntu, FrameBuffer support is disabled by default.

Try ‘ls -l /dev/fb*’ to check whether it has already been enabled.

enable FrameBuffer

Edit ‘/etc/initramfs-tools/modules’ to add

fbcon 
vesafb 
vga16fb 

Edit ‘/etc/modprobe.d/blacklist-framebuffer’ to comment out the following two lines:

vesafb
vga16fb

Update initramfs to make above changs effective

sudo update-initramfs -u

edit grub startup menu

Edit ‘/boot/grub/menu.lst’ to append parameter: ‘vga=0x317’ to kernel line, for example:

kernel /boot/vmlinuz...... ro quiet splash vga=0x317

It’s better to name the startup section title with a specific name, such as: ‘Ubuntu …. (framebuffer)’.

(You can also duplicate a section and do modification.)

Build & run DirectFB examples

build & install DirectFB and DirectFB-examples

tar xzvf DirectFB-1.0.1.tar.gz 
./configure
make
make install

DirectFB-examples takes same steps. If all is OK, the binary files will be put into: /usr/local/lib and /usr/local/bin.

You can also use ‘./configure –prefix=/usr’ to put them into /usr instead of /usr/local. If so, skip next step.

edit ‘/etc/ld.so.conf’

add ‘/usr/local/lib’ into ‘/etc/ld.so.conf’, then run ‘ldconfig’ to refresh.

vi /etc/ld.so.conf
ldconfig

This makes newly built DirectFB libraries accessible by applications.

restart system & choose framebuffer startup

Press ‘Esc’ to show the grub menu while system begins to startup. Choose the appropriate menu item to boot into.

try various DirectFB example applications

If you are in X, press Alt+F1 to switch to linux virtual terminal, then

cd /usr/local/bin
./df_andi
./df_fonts
./df_knuckles
./spacedream 
./dfbinfo
......

(Note: press Alt+f7 to return to X.)

This entry was posted in 计算机与 Internet. Bookmark the permalink.

1 Response to Steps to setup DirectFB dev enviroment on Ubuntu

  1. Unknown says:

    "Enable FrameBuffer support" was precisely what I was looking for. I’ve had trouble finding this information – for Jaunty, etc…Thanks!

Leave a comment