Get DirectFB 1.2.* running on Ubuntu 9.04 (with multi app support)

引用
http://blog.mageprojects.com/2009/05/12/get-directfb-12-running-on-ubuntu-904-with-multi-app-support/

------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Hi,

 

Since there is no guide anywhere on the internet that tells you how you can get DirectFB working on ubuntu, i will make one.

 

I expect you know how you compile things in this article. If you don’t follow some guide that explains how to do that.

 

The very first thing you have to do is get ubuntu (9.04 but the last few versions should all work fine).
next is setting up your “framebuffer” at boot time. To do this restart your pc. while in grub press “e” to edit that boot line. Then select the kernel line and again press “e” to edit that line. Now add (at the end of that line) vga=ask . Right after that it will ask you which resolution you want. See if yours is in that list and anter the number that’s standing infront of it. Now just let it boot. Once booted you will have to edit your grub menu file (sudo nano /boot/grub/menu.lst) and add vga=0xthe number you picked ) and then when you reboot you should have the framebuffer stuff. If you don’t have it look for a solution somewhere on the internet. Problems with framebuffers can be quite hard to understand or find solutions for. I don’t know much more about those framebuffers then this.

 

Once that’s all done you will have to setup your build environment. run the following commands:

 

sudo apt-get install linux-source // Will install the actual linux source of your current kernel
sudo apt-get build-dep linux // Will get your linux kernel source dependencies installed on your system
sudo apt-get build-dep libdirectfb-1.0-0 // We are going to use a later version of DirectFB but this will do fine to install the requirements
wget http://www.directfb.org/downloads/Core/DirectFB-1.2.8.tar.gz
wget http://www.directfb.org/downloads/Core/linux-fusion-8.1.1.tar.gz
wget http://www.directfb.org/downloads/Extras/DirectFB-examples-1.2.0.tar.gz

 

Note: go to: http://www.directfb.org/index.php?path=Main%2FDownloads to download the latest DirectFB 1.2.* (do not download the 1.3.* versions because that’s still in development) release and the latest linux-fusion file.

 

Once you’ve done the two apt-get lines and downloaded the files you will have to extract those later two.
Do that by running:

 

tar -xvf DirectFB-1.2.8.tar.gz
tar -xvf linux-fusion-8.1.1.tar.gz
tar -xvf DirectFB-Examples-1.2.0.tar.gz

 

The first thing we’re going to do now is getting that fusion module compiled and loaded at boot time.
Here is the list of commands to do that:

 

cd linux-fusion-8.1.1 make && sudo make install
sudo su -
echo fusion >> /etc/initramfs-tools/modules // this adds the text “fusion” at the end of the modules file
exit
sudo update-initramfs -u // This updates your initramfs file
sudo modprobe fusion // Only needed if you didn’t restart after you changed initramfs. Otherwise this module will be loaded anyway beacayse it’s done so during boot.

 

Now fusion is done.
Next is compiling DirectFB with multi application support.

 

Here is the list of commands needed for that:


cd DirectFB-1.2.8
./configure –enable-multi –libdir=/usr/lib64 –bindir=/usr/bin // note the libdir is /usr/lib64 for x86_64 distributions and just /usr/lib for the rest. Change it to your needs
make && sudo make install

 

Now it should be compiling for a few minutes. Depending on your cpu. My quadcore does this in a few minutes.
Once it’s done DirectFB is installed and (if all previous steps worked fine) can be used.

 

Now to see it in use we need some examples.
here is the command list for that:

 

cd DiirectFB-Examples-1.2.0
./configure –bindir=/usr/bin // note no need to set a libdir because it’s not making libs
make && sudo make install

Now the examples are also ready to use.
You can now switch to another tty (CTRL + ALT + F<number>), login and run something like df_window.
Be sure to type df_ followed by a hit on the tab button. It will give you all run commands that start with df_ and all the results that  you get to see are DirectFB examples.

 

But this didn’t show you a multi-app environment yet.

 

Log in into your gnome or kde or whatever graphical environment you use. Open up a terminal in there and type:

 

nano ~/.directfbrc

 

What we’re going to do now is change a few directfb settings to run it under X11. (see man directfbrc for more settings)
Just plain copy and paste the following settings in that file:

 

mode=1024×768
pixelformat=RGB32
system=x11

 

You can change the resolution to your

liking if you want.

 

Now type (still in that same console that’s running inside your graphical environment):

 

df_window & // runs it in the background
df_cpuload &

 

And you will see the df_window example with in there the cpuload graphic. Nifty huh?
Just be carefull here. save all your data before you start with this because if you do anything wrong it COULD completely crash your system in a way that you just have to reboot to get it back. While writing this howto i experienced this myself because i did do df_window & but i didn’t add the “&” to df_cpuload

 

This was it for the DirectFB howto.
I might post more stuff about DirectFB in the future.

 

I hope it was useful to you,
Mark

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值