ubuntu10.04下的DirectFB安裝

來源:互聯網
上載者:User

  根據網上查詢的資料,然後結合自己安裝的過程,作以記錄,方便下次用到。

一 軟體安裝

 1.下載DirectFB與DirectFB-example
     Direct官方網站:http://www.directfb.org/

2.解壓縮這兩個檔案
   tar -zxf DirectFB-1.6.2.tar.gz
   tar -zxf DirectFB-examples-1.6.0.tar.gz

3.安裝必要的package
   如果要自行安裝DirectFB,則需要autoconf與automake等工具。
   sudo apt-get installautoconf
   sudo apt-get installlibtool(autoreconf會用到)

4.安裝DirectFB-1.6.2

   1) cd DirectFB-1.6.2

   2) ./configure

      a) 如果在./configure這步出現下面的提示:
           PNG support is missing - many applications won't work correctly!
           JPEG support is missing - many applications won't work correctly! 

       解決:sudo apt-cache search libpng
                   sduo apt-get install libpng12-dev

                   sudo apt-cache search libjpeg
                   sudo apt-get install libjpeg62-dev

   3) make

      a) 報錯:

           libtool: Version mismatch error.  This is libtool 2.4.2 Debian-2.4.2-1ubuntu1, but the
           libtool: definition of this LT_INIT comes from libtool 2.2.6b.
           libtool: You should recreate aclocal.m4 with macros from libtool 2.4.2 Debian-2.4.2-1ubuntu1
           libtool: and run autoconf again.

           解決:

           autoreconf --force --install
          ./configure

       b) make, 報錯:

           ../../libtool: line 984: g++: command not found

          解決:sudo apt-get -y install g++

      c) make, 報錯:

          libtool: link: unsupportedhardcodeproperties
          libtool: link: See the libtool documentation for more information.
          libtool: link: Fatal configuration error.

          解決:

          ./configure
          make clean
          make

5. 安裝DirectFB-examples-1.6.0

    安裝DirectFB-example的過程與DirectFB大致一樣,這裡我就不再贅述。
    我只將--enable-debug的選項開啟,其它則採用它的預設值。

    cd ~/DirectFB-examples-1.6.0
    autoreconf
    ./configure--enable-debug
    make
    sudo make install 

最新的核心已經支援framebuffer,只需要啟動是指定相關參數 ,比如 “vga=解析度 ” 就可以了。具體設定方法如下:

vi/etc/default/grub 

 1、找到如下的行,GRUB_CMDLINE_LINUX="" 在裡面加入樓上說的vga=**, 結果如下:

GRUB_CMDLINE_LINUX="vga=792" 

2、另外還有一行要設定一下:

GRUB_GFXMODE=1024x768 

該行原來是注釋掉的,需要設定的解析度與上面的 vga=792一致。

3、更新grub設定檔,如下

 sudoupdate-grub 

重新啟動後在其他tty就可以使用framebuffer了,比如按alt+ctrl+F1 進入一號虛擬終端麼,登入之。

4、另外普通使用者要設定一下vedio觀看的許可權, 比如:

 sudochmod o+rw /dev/fb0    

5、軟體需求fbi即可

sudo apt-getinstall fbi

無 論是ati顯卡還是nvidia顯卡,在ubuntu10.04系統上啟用受限驅動 (或手動安裝官方驅動),都會導致開機splash解析度變低的問題。由於這問題在ubuntu10.04上很普遍,所以也就有很多牛人為我們提供瞭解決 方法,下面是我在ubuntu中文論壇上看到的(參考上面給出的三個文章),並且親自實驗並成功解決問題的一個整理方案。

1、安裝v86d和hwinfo包,下面我們要用到。

sudo apt-get install v86d hwinfo

2、查看自己顯卡支援的解析度。

sudo hwinfo --framebuffer

None 00.0: 11001 VESA Framebuffer
  [Created at bios.464]
  Unique ID: rdCR.QOJHFkjgnM2
  Hardware Class: framebuffer
  Model: "(C) 1988-2005, ATI TechnologiesInc.  M92"
  Vendor: "(C) 1988-2005, ATI TechnologiesInc. "
  Device:"M92"
  SubVendor: "ATI ATOMBIOS"
  SubDevice:
  Revision: "01.00"
  Memory Size: 16 MB
  Memory Range: 0xd0000000-0xd0ffffff (rw)
  。。。
  Mode 0x03ee: 1366x768 (+1408), 8 bits
  Mode 0x03ef: 1366x768 (+2752), 16 bits
  Mode 0x03f0: 1366x768(+5504), 24 bits
  Config Status: cfg=new, avail=yes, need=no,active=unknown

3、修改/etc /default/grub檔案,使用uvesafb的framebuffer來啟動。

sudo gedit /etc/default/grub

把下面的兩行

GRUB_CMDLINE_LINUX_DEFAULT="quietsplash"

#GRUB_GFXMODE=640×480

修改為:

GRUB_CMDLINE_LINUX_DEFAULT="quietsplash nomodeset video=uvesafb:mode_option=1366x768-24,mtrr=3,scroll=ywrap"

(ps:其中的nomodeset禁用核心 kms,個人見解)

GRUB_GFXMODE=1366x768

這個要根據第2步所查到的顯卡所支援的最大解析度 (當然也可以是其他支援的解析度)來修改,注意要把前面的#去掉。

4、修改/etc/initramfs-tools/modules檔案。

sudo gedit /etc/initramfs-tools/modules

添加下面這行:

uvesafb mode_option=1366x768-24 mtrr=3scroll=ywrap

(ps:這一步的修改與上一步中的第1處修改關聯 一致)

5、運行下面的命令,啟用 framebuffer。

echo FRAMEBUFFER=y | sudo tee /etc/initramfs-tools/conf.d/splash

6、運行下面的命令,更新grub配置以及 initramfs鏡像檔案。

sudo update-grub
sudo update-initramfs -u

7、重啟。

相 關問題及解決方案:
按照上述步驟操作後確實解決了開機splash解析度低的問題,不過還有另外一個問題:無法正常使用虛擬控制台 (tty1-6),即切換到虛擬控制台——“黑屏”。

確實這樣修改後出現登陸不了console的情況,需要添加vga=XXX參數。

其實,這個問題應該也是使用官方的閉源驅動(或受 限驅動)造成的,即不是上述的操作導致的。
相應的,上述步驟的第3步修改中添加vga=xxx參數。

GRUB_CMDLINE_LINUX_DEFAULT="quietsplash nomodeset video=uvesafb:mode_option=1366x768-24,mtrr=3,scroll=ywrap vga=792"

注意792代表的是1024×768x16M(分 辨率1024×768,色彩深度24位),可根據自己的情況設定

環境變數設定

PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

vi /etc/ld.so.conf在最後一行加入:/usr/local/lib,儲存退出。
    ldconfig

五 重啟電腦後

    cd DirectFB-examples-1.6.0/src/ 

   ./df_andi  //成功運行企鵝的執行個體。

參考文章:http://blog.csdn.net/ndhui/article/details/7109806

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.