歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> BSD >> FreeBSD實現3D桌面

FreeBSD實現3D桌面

日期:2017/3/1 18:14:39   编辑:BSD

這幾天晚上閒來無事在琢磨FreeBSD上的3D桌面實現。現搜羅兩篇比較仔細的參考文檔給大家看看。我尚未動手折騰,因為有一些問題尚且不是很清楚。

1. 實現XGL/GLX,需要的xorg的版本最低是多少?要xorg7以上還是xorg6.9就可以?
2.能夠支持的顯卡是哪些?我的顯卡是Intel865G集成顯卡。

下面這篇很仔細,不過有些地方不是很明白,主要是第8步,有明白的給講解講解。有興趣的可以照做看看。

AIGLX for FreeBSD(FreeBSD_Release_6.2+AIGLX+Beryl)

1: 系統的安裝
選擇最小化安裝,起碼這裡需要把網絡或鍵盤配好,其他的可以再去細化。

2: bash

root@cnbsd/#cd /usr/ports/shells/bash
root@cnbsd/usr/ports/shells/bash#make install clean
root@cnbsd/usr/ports/shells/bash#ln -s /usr/local/bin/bash /bin/bash
root@cnbsd/usr/ports/shells/bash#chsh -s /usr/local/bin/bash
root@cnbsd/usr/ports/shells/bash#reboot
以後再創建的用戶就可以指定shell為bash了。

系統裝好後注意裝好linux_base、perl包、修改fstab顯示/proc目錄等。也可以在這裡修改環境變量,總之根據你自己的愛好來就是了。

3: axel

root@cnbsd/#cd /usr/ports/ftp/axel
root@cnbsd/usr/ports/ftp/axel#make install clean
root@cnbsd/usr/ports/ftp/axel#cd /etc
root@cnbsd/etc#make.conf

加入以下內容:
"
FETCH_CMD = axel -a
MASTER_SITE_OVERRIDE= /
ftp://ftp.freebsd.org.cn/pub/FreeBSD/ports/distfiles/ \
"

4: fcitx

wanglong@unixsir/usr/ports/chinese/fcitx$make install clean

5:git

root@cnbsd/etc#cd /usr/ports/devel/git
root@cnbsd/usr/ports/devel/git#make install clean

6: pkg_deinstall

root@cnbsd/usr/ports/sysutils/portupgrade#cd /usr/ports/sysutils/portupgrade
root@cnbsd/usr/ports/devel/git#cd /usr/ports/sysutils/portupgrade
root@cnbsd/usr/ports/sysutils/portupgrade#make install clean

7: pkgdb

root@cnbsd/usr/ports/sysutils/portupgrade#cd /usr/ports/sysutils/pkg_trackinst
root@cnbsd/usr/ports/sysutils/pkg_trackinst#make install clean

8: checkout the code

root@cnbsd/usr/ports/sysutils/pkg_trackinst#cd /usr
root@cnbsd/usr#mv ports ports.20070128
root@cnbsd/usr#git clone git://git.geekfire.com/git/ports.git
root@cnbsd/usr#cd ports
root@cnbsd/usr#pkg_info -Ex xorg- | grep -v linux | xargs -n1 pkg_create -b
root@cnbsd/usr#pkg_deinstall -fP xorg-\* libdrm-\* dri-\* libGL-\* libGLU-\* libglut-\* nvidia-driver-\*
root@cnbsd/usr#cd /usr/ports/x11/xorg
root@cnbsd/usr/ports/x11/xorg#make all install clean
root@cnbsd/usr/ports/x11/xorg#cd /usr
root@cnbsd/usr#pkgdb -F
root@cnbsd/usr#reboot
root@cnbsd/#Xorg -configure
root@cnbsd/#cp /root/xorg.conf.new /etc/X11/xorg.conf

增加以下內容到"/etc/X11/xorg.conf":
"
Section "ServerFlags"
Option "AIGLX" "on"
EndSection

Section "DRI"
Mode 0666
EndSection


Section "Extensions"
Option "Composite" "true"
EndSection

"

另外打開"#Option "Dac6Bit" # []"
改為"Option "DRI" "True""

9:確認3D功能是否打開

在裝xfce4前可以測試下3D功能是否已經打開,這裡主要通過"/var/log/Xorg.0.log"來見檢查確認(linux下滿街都有glxinfo,bsd下ports裡連
key也找不到)。

root@cnbsd/#Xorg -config /etc/X11/xorg.conf
root@cnbsd/#grep rendering /var/log/Xorg.0.log
(II) I810(0): direct rendering: Enabled
root@cnbsd/#

如能看到是"Enable"就可以稍微放心點了。"disabled"多半是由於"mesa""dri"的問題,"dri""mesa"關系密切,不過這裡還是要具體情況具
體對待,多看日志。

root@cnbsd/#cd /home
root@cnbsd/home#git clone git://anongit.freedesktop.org/git/mesa/mesa
root@cnbsd/home#chown -R surferwl:surferwl mesal
root@cnbsd/home#su - surferwl
surferwl@cnbsd~$

平常習慣用"surferwl"這個用戶,添加的步驟就省了。

surferwl@cnbsd~$vi .profile

增加以下內容:

"
export PKG_CONFIG_PATH=/usr/local/libdata/pkgconfigPKG_CONFIG_PATH
"

保存後退出。

root@cnbsd/#cd /home/mesa
root@cnbsd/home/mesa#gmake freebsd-dri-x86
root@cnbsd/home/mesa#gmake install
root@cnbsd/home/mesa#ln -s /usr/X11R6/lib/modules/dri /usr/X11R6/lib/dri

增加以下內容到"/home/surferwl/.profile":
"
export LIBGL_DRIVERS_PATH="/home/mesa/lib"
export LD_PRELOAD="/home/mesa/lib/libGL.so.1"
"

root@cnbsd/#reboot

再去調試3D功能,心平氣和的操作應該是沒有問題的。至於"drm",是這樣解釋的:"The DRM is shipped with the kernel, so you shouldn't need to build it. If you choose to, simply run "make && make install" from the drm/bsd-core directory."

若3D搞定後再去install其他的。


10: xfce4

root@cnbsd/usr/ports/x11-wm/xfce4#make install clean

11: beryl

root@cnbsd/usr/ports/x11-wm/beryl#make install clean

12: .xinitrc
surferwl@cnbsd~$ echo "exec fcitx -nb &" > .xinitrc
surferwl@cnbsd~$ echo "exec beryl-manager &" >> .xinitrc
surferwl@cnbsd~$ echo "exec /usr/local/bin/startxfce4" >> .xinitrc


接著就去"startx"或再"gdm"吧、再就是去轉你的屏幕吧,最好放張女朋友的照片,你這樣可以360度的隨心所意的轉著看,就看你的發揮了!


說明:以上的步驟有摻和了不少個人習慣性動作,有多余的步驟,比如切換目錄的、使用bash shell等,其實這是個人習慣,自己明白就o了,>對著去畫就行;我習慣用"simsun""文泉"字體,這裡也沒有寫出來。另外就是還沒有仔細檢查,可能還有錯字情況,但大體思想是這樣的。我在使用的過程中還沒有發現問題,和平常沒有使用AIGLX功能的時侯一樣,就是比較"動態"了。

Copyright © Linux教程網 All Rights Reserved