Modular x howto
出自wiki.gentoo.tw
此篇文章翻譯自 http://www.gentoo.org/proj/en/desktop/x/x11/modular-x-howto.xml 所有權利均為原作者及團體所保留 本譯文僅供交流,並非正式中文譯文。
原文作者:Donnie Berkholz (mailto:spyderous@gentoo.org),Joshua Baergen (mailto:joshuabaergen@gentoo.org)
原文版權宣告:The contents of this document are licensed under the Creative Commons - Attribution / Share Alike license.
Migrating to Modular X HOWTO
目錄 |
1.介紹
為什麼要 modular ?
| You may be wondering, why in the world did one nice, easy xorg-x11 package turn into almost 300 separate ones? And you'd certainly be justified in this. =) It's not something Gentoo is doing independently of upstream X.Org; they're splitting up all the packages into separate releases, and we're just following along. |
|
你也許會問,為什麼一個好好的 xorg-x11 package,要把它切割成近 300 個 package 呢? 而且你也確信此種方式是理所當然。 這不是 gentoo 與 X.Org 各做各的,他們將整個 package 切割成獨立的釋出版本,我們也只是依照此方式運作。 |
| The reasoning behind the split and changing build system is at least threefold: |
|
對於切割和改變系統建立的方式其隱藏在背後的理由最少有三個: |
|
|
|
|
|
|
2.升級至Modular X
介紹
|
To keep old packages from getting in the way, we're going to clean out all the old xorg-x11 cruft before installing modular X. This isn't absolutely crucial, but it will help ensure a smooth migration. |
|
在安裝modular X 之前,我們必須先清除所有舊的 xorg-x11,以免造成妨礙 。這不是絕對必要,但可以確保平順地進行轉換。 |
第一步 清除舊 X
|
Create a backup copy of the monolithic xorg-x11 in case modular X works poorly for you, and you want to revert to 6.x. |
|
建立一個完整的 xorg-x11 備份,當你覺得 modular X 運作的不是很好的時候,可以還原回去 6.x. |
| Code Listing 2.1: Backing up the old xorg-x11 |
# emerge gentoolkit # quickpkg xorg-x11 |
|
Get rid of the monolithic installation: |
|
將先前的 Xorg 整個移除 |
| Code Listing 2.2: Unmerging the monolitic installation |
# emerge -Ca xorg-x11 virtual/x11 |
|
If your /usr/X11R6 isn't a symlink to /usr, delete it and start from scratch. But first, save a list of all the packages installing there. The gentoolkit package provides equery. |
|
如果你的 /usr/X11R6 不是一個 symlink 指到 /usr,將它刪除,然後從頭開始。但首先,把所有 package 安裝的路徑列表存下來。gentoolkit package 提供了 equery 這個工具。 |
| Code Listing 2.3: Make a package list |
# if [[ ! -L /usr/X11R6 ]]; \
then equery belongs /usr/X11R6 > ~/usr-x11r6-packages \
&& rm -rf /usr/X11R6; fi
|
第二步 安裝 modular X
|
If you are running a stable system, add the required packages to /etc/portage/package.keywords. Download the package list, and open it in a text editor of your choice. Copy and paste the full modular X mask over to package.keywords. If none of that made any sense, read the handbook section on masking. |
|
如果您正執行一個穩定的系統,請把所需的 package 加到 /etc/portage/package.keywords 裡面。請下載 package 的列表,然後在您愛用的文字編輯器打開它,把裡面所有的 modular X 的 mask 用 copy & paste 的方式,加到 package.keywords 的檔案裡。如果您對這個動作不熟,請參考 handbook 裡頭 masking 這個 section。 |
| Other packages that may require package.keywords for stable users |
>=sys-apps/portage-2.1_pre4 =sys-apps/man-1.6b-r2 app-admin/eselect-opengl >=app-admin/eselect-1.0_rc1 media-video/nvidia-kernel media-video/nvidia-glx |
|
For direct rendering, check that the dri USE flag is active. It should be on by default. |
|
要用 direct rendering 的人,請確定 dri 這個 USE flag 是啟動的。預設是開啟的。 |
|
Next, decide which drivers you need to install. This will vary depending on your input and video hardware. If you already have a working /etc/X11/xorg.conf, then just run this command to get an idea of what drivers you need: |
|
接下來,決定您需要安裝哪些 drivers。在此將會依據每人的輸入及顯示設備而有所不同。如果你已經有一個可正常使用的 /etc/X11/xorg.conf,那只要執行下面指令就可以得知您需要哪些 driver: |
| Code Listing 2.4: Finding what drivers you need |
# grep Driver /etc/X11/xorg.conf Driver "kbd" Driver "mouse" Driver "radeon" |
| Code Listing 2.5: Checking available drivers |
# emerge --verbose --pretend xorg-x11 [ebuild R ] x11-base/xorg-x11-7.0-r1 USE="-xprint" INPUT_DEVICES="keyboard mouse -acecad -aiptek -calcomp -citron -digitaledge -dmc -dynapro -elo2300 -elographics -evdev -fpit -hyperpen -jamstudio -joystick -magellan -magictouch -microtouch -mutouch -palmax -penmount -spaceorb -summa -synaptics% -tek4957 -ur98 -vmmouse -void" VIDEO_CARDS="i128 mga savage -apm -ark -ati* -chips -cirrus -cyrix -dummy -fbdev -fglrx% -glint -i740 -i810 -imstt -neomagic -newport -nsc -nv -nvidia% -rendition -s3 -s3virge -siliconmotion -sis -sisusb -sunbw2 -suncg14 -suncg3 -suncg6 -sunffb -sunleo -suntcx -tdfx -tga -trident -tseng -v4l -vesa -vga -via -vmware -voodoo" 0 kB
|
|
Set INPUT_DEVICES and VIDEO_CARDS to what you need in /etc/make.conf. The minimal setting for the above example would be INPUT_DEVICES="keyboard mouse" VIDEO_CARDS="ati". If you don't set one or the other variable, xorg-x11 will pull in all possible drivers of that type. For backup drivers, you may also want to add vesa and fbdev to VIDEO_CARDS. |
|
將 INPUT_DEVICES 及 VIDEO_CARDS 設成你所需要的值並加入到 /etc/make.conf。在上面的例子中,最少要設定 INPUT_DEVICES="keyboard mouse" VIDEO_CARDS="ati" 如果你沒有設定任何值,xorg-x11 會將同類型所有可能的 driver 都加進去。為了備份 driver,你也需要把 vesa 及 fbdev 這兩個值設進 VIDEO_CARDS |
|
Now, install the metabuild. This will install the server and popular applications, giving you a working desktop implementation of X: |
|
現在,安裝 metabuild。這會安裝 server 及受歡迎的應用程式,給您一個可用的 X 桌面: |
| Code Listing 2.6: Installing the modular metabuild |
# emerge xorg-x11 # etc-update # revdep-rebuild # emerge $(<~/usr-x11r6-packages) |
| Note: If you really want a minimal installation, just install xorg-server. This will pull in only what you need to start an X server. |
| Note: 如果你真的只要最小的安裝,那就只要安裝 xorg-server。這只會安裝"起動 X server所必需的東西". |
|
This install tries to be rather minimal, so things like xcursor-themes are not installed by default. In that particular example, you would want xcursor-themes if you changed your cursor setting to whiteglass, redglass or handhelds. If you use the gentoo, gentoo-blue or gentoo-silver cursor themes, install gentoo-xcursors. |
|
這次的安裝試著採用最小安裝,所以,像預設的 xcursor-themes 是不安裝的。在特殊的例子中,如果您要切換你的cursor 設定至 whiteglass、redglass、handhelds,你應該要安裝 xcursor-themes。如果您使用 gentoo、gentoo-blue 或是 gentoo-silver 的 cursor 主題,那就安裝 gentoo-xcursors。 |
| Note: With modular installed, external drivers such as nvidia-glx and wacom as well as some vnc apps may not work if they install things to /usr/lib/modules instead of /usr/lib/xorg/modules. Many of these will have modular X detection added to the installation process and thus will need to be re-merged after modular X install. In addition, many external drivers have a dlloader USE flag that you must enable. |
| Note: 使用 modular X 的時候,某些外部的 driver ,例如,nvidia-glx,wacom 以及某些 vnc 應用程式裝在/usr/lib/modules (而不是裝在 /usr/lib/xorg/modules) 將會無法使用。這些 driver 會在 modular X 安裝過程中被偵測到,且在 modular X 安裝完後,將重新被 emerge。此外,你必須致能 dlloader 這個 USE Flag,因為許多的外部 driver 都有 dlloader 需求。 |
3.警告/常見的問題
emerge -u world 後,要安裝 xorg-x11 6.x 或是 virtual/x11 ?
| This is because the tree isn't fixed for modular dependencies yet. You can help the porting effort by reading the Porting to Modular X HOWTO and filing bugs with patches to the individual package maintainers. The maintainers will be listed in metadata.xml in the same directory as the package and the herdstat package will speed up querying for them. |
|
這是因為 Portage tree 中的 modular 相依性尚未修正。你可以閱讀 Porting to Modular X HOWTO 的相關成果,而且利用單一的套件修正 patch 去修正 bug ,該修正將被條列在 metadata.xml,該檔案存放在其套件下的目錄,而且將有利於查詢時速度的提升。 |
| Particularly if you are running modular X on an otherwise stable system, you may run into issues with this. Many packages only work with modular X in their ~arch versions, so you may need to add additional packages to /etc/portage/package.keywords. |
|
特別的是當你正在不同的穩定系統上執行 modular X,你可能偶爾會遇上這個問題。很多 X modular 套件僅能在 ~arch 版本中運作,所以你也許須要將那些新增的套件加入 /etc/portage/package.keywords。 |
What happened to all the USE flags?
Many USE flags in the xorg-x11-6.8 series vanished or moved in 7.0. Some new USE flags appeared. Here's why:
這裡還有一個 table 還沒有放上來
| Many USE flags in the xorg-x11-6.8 series vanished or moved in 7.0. Some new USE flags appeared. Here's why: |
|
許多 xorg-x11-6.8 的 USE 旗標消失了或移到 7.0,有些新的 USE 旗標出現,以下列出 |
| USE flag | What happens in 7.0? |
| 3dfx | In 7.0, pulls in glide-v3 from the xorg-x11 metabuild |
| 3dnow, mmx, sse | Enabled by default at build time, because there are runtime checks |
| bitmap-fonts, truetype-fonts, type1-fonts | The xorg-x11 metabuild pulls in a small selection of the most used or required fonts. You may additionally install any others in media-fonts/. |
| cjk | USE=nls on font-misc-misc and font-sony-misc to get Japanese JISX0201 fonts. More are in font-jis-misc. Chinese fonts are in font-isas-misc. Korean fonts are in font-daewoo-misc. |
| dlloader | 7.0 uses the dlloader by default, and the elfloader doesn't work. |
| doc | Moved to app-doc/xorg-docs |
| dmx | Built in xorg-server unless USE=minimal |
| font-server | You may manually install xfs. |
| ipv6 | Moved to individual packages using it. Set globally if you want it. |
| minimal | To get the same effect, install just xorg-server rather than xorg-x11. USE=minimal on xorg-server to avoid building Xdmx, Xvfb and Xnest. If you require something more minimal, look into x11-base/kdrive. |
| nls | In 7.0, USE=nls installs all non-ISO8859-1 versions of fonts. |
| nocxx | Not yet an equivalent in 7.0 |
| opengl | Changed names to "dri," which enables direct rendering in xorg-server and many drivers. Whether USE=dri is on or off, you should still get software 3D via Mesa. |
| pam | Moved to individual packages using it, such as xorg-server and xdm |
| sdk | 7.0 must install the SDK as a consequence of modularization. |
| static | Mostly doesn't make much sense to try building a static server in a modular world, because the driver can't be built into it. |
| xprint | On metabuild, pulls in libXp. On other applications, builds in xprint support. Most people will not want to enable this. |
| xv | No longer optional because it doesn't save much size and causes other issues with some packages expecting it. |
驅動程式的問題
I've had reports that:
* vesa locks up box with a Matrox card * vga produces a very weird-looking screen, divided into quarters |
|
我己經有一些相關報告如下: *當使用 Matrox card 時,在vesa 模式下會造成機器的鎖定。 *vga 模式下提供一個非常怪異的顯示方式,就是將畫面分成四等份。 |
| Getting 3D acceleration working again
To get some debugging info to help in getting direct rendering working: |
|
如何讓 3D 加速器能再次運作 下列將教導你如何取得 direct rendering 的除錯訊息: |
| Code Listing 3.1: Getting some debug info |
# grep -e EE -e WW /var/log/Xorg.0.log # LIBGL_DEBUG=verbose glxinfo |
自動偵測滑鼠的通訊協定
| If you have "Protocol" "auto" set in xorg.conf for your mouse, it may not work. You may need to specify "Protocol" "ExplorerPS/2" or "IMPS/2" for your wheel to work. |
|
如果你在 xorg.conf 中設定你的滑鼠協定為 "Protocl" "auto" 時,滑鼠還不能正常工作時。你可能須要詳盡的描述你的滑鼠裝置的協定方式如 "Protocol" "ExplorerPS/2" 或"IMPS/2"。 |
我收到 libbitmap 和 libpcidata not found 的錯誤訊息
| Make sure no ModulePath entry exists in /etc/X11/xorg.conf. |
|
請確定 /etc/X11/xorg.conf 中沒有 ModulePath 的路徑設定。 |
gdm/kdm 沒有正常運作
| If you installed modular X on a fresh Gentoo installation, you may not have a /usr/X11R6 -> /usr symlink. The x11-base/xorg-x11 package will ensure that the symlink exists during the emerge process. |
|
如果你安裝 modular X 在一個剛設置的 Gentoo 中,你也許並沒有一個符號連結 /usr/X11R6 -> /usr。x11/base/xorg-x11 套件在 emerge 的過程式將確認該連結是否存在。 |
| You can help get things out of /usr/X11R6 by fixing the packages that install there and filing bugs. Also, remember to reinstall these packages. |
|
你可以藉由修正過的套作來修正 /usr/X11R6 中的 bugs。請記得重新安裝上述套件。 |
| Code Listing 3.2: Packages that install to /usr/X11R6 |
# cat ~/usr-x11r6-packages # emerge --pretend $(< ~/usr-x11r6-packages ) |
XKB 並沒有運作,導致我不能切換至其它虛擬終端機 (VTs)等等..
| * Many XKB layouts have moved around, consolidated or disappeared. Take a look in /usr/share/X11/xkb/symbols/ to see what happened to your old XkbLayout settings in xorg.conf. For example, to replace the old "us_intl" layout, you would put "XkbLayout" "latin", "XkbOptions" "lv3:ralt_switch". To replace the old "sk_qwerty" layout, you would put "XkbLayout" "sk", "XkbVariant" "qwerty". For a more advanced example, perhaps you have "XkbLayout" "us,sk_qwerty". To get that working, the new setting would be "XkbLayout" "us,sk", and the tricky part is in the comma here: "XkbVariant" ",qwerty", because you want the variant to apply to your second layout. |
|
許多 XKB 的設定己經被合併或消失了。請檢查 /usr/share/X11/xkb/symbols 的異動是否造成在 xorg.conf 的 XkbLayout 設定值失效。例如,想要取代舊的 "us_intl" 的設定,你必須設置成 "XkbLayout" "latin", "XkbOptions" "lv3:ralt_switch"。或者想取代舊的 "sk_qwerty" 的設定,你必須設置成 "XkbLayout" "sk", "XkbVariant" "qwerty"。同上,為了使其能正常運作,則你必須修改設定為 "XkbLayout" "us,sk",而且設定 "XkbVariant" ",qwerty",這裡的設置是須要一點技巧的,當你想要使用不同的第二項設定。 |
| Code Listing 3.3: Tracking down XKB changes |
Check /var/log/Xorg.0.log for this message:
(WW) Couldn't load XKB keymap, falling back to pre-XKB keymap
If you do not have that error, your XKB works already.
# grep Xkb /etc/X11/xorg.conf
Option "XkbModel" "logibik"
Option "XkbLayout" "dvorak"
Option "XkbOptions" "ctrl:swapcaps"
First, see what changed with your layout. This is in the symbols/pc directory.
# cd /usr/share/X11/xkb/symbols/
If you have xkbdata instead of xkeyboard-config installed, change to the pc/ subdirectory.
# ls *dvorak*
OK, nothing showed up.
Lots of old layouts moved into their country-coded keymaps.
# ls *us*
us
Now, we check for an xkb_symbols variant called dvorak.
# grep xkb_symbols.*dvorak us
xkb_symbols "dvorak" {
That means in xorg.conf, we need Option "XkbLayout" "us"
and Option "XkbVariant" "dvorak".
But when we try to test this with setxkbmap, we still get an error
# setxkbmap -model logibik -layout us -variant dvorak -option "ctrl:swapcaps"
Maybe the model changed, too.
# cd /usr/share/X11/xkb/rules/
# grep logibik xorg.lst
No output from that, so that model is gone. How about similar ones?
# grep logi* xorg.lst
logiaccess Logitech Access Keyboard
logicdit Logitech Cordless Desktop iTouch
logicdp Logitech Cordless Desktop Pro
logicdpa Logitech Cordless Desktop Pro (alternate option)
logicdpa2 Logitech Cordless Desktop Pro (alternate option2)
logicdo Logitech Cordless Desktop Optical
logicfn Logitech Cordless Freedom/Desktop Navigator
logicdn Logitech Cordless Desktop Navigator
logidak Logitech Deluxe Access Keyboard
logiitc Logitech iTouch Cordless Keyboard (model Y-RB6)
logiik Logitech Internet Keyboard
logiitc Logitech iTouch Cordless Keyboard (model Y-RB6)
logiik Logitech Internet Keyboard
logiink Logitech Internet Navigator Keyboard
logiultrax Logitech Ultra-X Keyboard
Great! The "logiik" model looks similar, so test it out with setxkbmap.
# setxkbmap -model logiik -layout us -variant dvorak -option "ctrl:swapcaps"
It worked, so change the XkbModel entry to that.
After that, everything works
|
其它相關討論
| * The x11-base/xorg-x11 package now filters all ModulePath and RgbPath lines from your /etc/X11/xorg.conf, as both of these paths have changed since previous versions. Make sure you run etc-update to finalize these changes. If for some reason they weren't filtered, remove them yourself. |
|
x11-base/xorg-x11 套件現在會濾除 /etc/X11/xorg.conf 中所有包含 ModulePath 和 RgbPath 的所在列,那些路徑設定將會被改變,連同先前版本也會進行相同的動作。在完成那些變動後,請確定你有執行 etc-update 。如果在某些原因下它們並沒有被濾除,那你必須手動的移除。 |

