HOWTO Modular Xorg

出自Gentoo Linux Wiki

跳转到: 导航, 搜索
这篇文章属于 HOWTO 系列的一部分。
安装方法 架构/平台 内核 & 硬件 Portage 系统相关 网络 & 服务器 X服务器 软件 游戏 非x86平台

Xorg


配置


输入设备


字体


显卡

edit

目录

[编辑] 关于本 HOWTO

Gentoo已经进入X11R7了,你现在可以帮助测试了!

你可以参考这篇文章 http://www.gentoo.org/proj/en/desktop/x/x11/modular-x-howto.xml

[编辑] 释放xorg-x11的屏蔽(Unmask xorg-x11)

注意: 在默认情况下,xorg 7现在已经不再受unmasked标记的屏蔽了。你只需确认正在使用的正确的keywords便可(例如:x86,你需要把"~x86"添加到make.conf文件的ACCEPT_KEYWORDS中)

At this point, given that OpenMotif does not compile against xorg-x11-7.x, you should do "emerge -Dav openmotif" and then continue with this howto.

[编辑] 卸载旧的 X.org

注意: 假如你正在阅读本文并打算升级X,那么在进行这个“install“期间,当前运行在X的程序将可能变得不稳定。比如,Firefox可能出现不可预料的崩溃,或者可能出现不能启动其他X应用程序的情况。在此建议在你开工之前打印一份本安装向导的拷贝以备不时之需。你的程序在本install完成后应该回到正常状态,然而你可能仍需要重启X才可以。
emerge -Ca xorg-x11
rm -rf /usr/lib/modules
rm -rf /usr/lib/opengl/xorg-x11
rm -rf /usr/lib/libGL*
注意: 确证/usr/X11R6 是连接到../usr. 如果是不是,则删除并重新连接一个。

[编辑] Emerge X.org 7

首先,你应在make.conf文件中设置合适的VIDEO_CARDS和INPUT_DEVICES旗标。要查看哪些旗标是可用的,运行emerge -Dpv xorg-x11。在一台典型的安有nvidia video的机器上,本命令的输出类似如下信息:

INPUT_DEVICES="keyboard mouse"
VIDEO_CARDS="nv nvidia vesa"

在ATI系统上,VIDEO_CARDS应类似下面(除非你已经使用了自己的驱动[fglrx]):

VIDEO_CARDS="ati fglrx vesa"
警告: Wacom写字板的支持是坏掉的,不要添加 'wacom' 到INPUT_DEVICES变量
注意: 如果你要Direct Rendering 支持,添加USE旗标"dri"到make. Needed by fglrx (ati-drivers)

注意: 喜欢冒险的用户可能希希望尝试"evdev" 输入设备驱动作为键盘和USB鼠标的替代。

警告: xorg-x11这个新的USE旗标只能工作在最新的portage下。当'emerge -pv xorg-x11' 不能显示可选的项目时,可以试着升级.

确证工作在 portage-2.1_pre7-r4


现在 emerge :

代码: Emerging xorg-x11
emerge -Dv xorg-x11
注意: 运行 etc-update 否则你会得到一些类似rgb module and X will crash的提示信息

一些有用的x11工具以前包括在6.8的build里,而现在他们有了属于自己的包,你可以有选择地emerge一些或干脆把他们都安上,只要你觉得需要:

代码: Emerging optioanl tools
emerge -Dav xev xdpyinfo xvinfo xset xdriinfo xprop

如果你喜欢一些额外的字体,你同样可以emerge过来:

代码: Emerging fonts
emerge -Dav font-adobe-100dpi font-adobe-75dpi font-adobe-utopia-100dpi \
font-adobe-utopia-75dpi font-bh-100dpi font-bh-75dpi font-bh-type1 \
font-bh-lucidatypewriter-100dpi font-bh-lucidatypewriter-75dpi \
font-bitstream-100dpi font-bitstream-75dpi ttf-bitstream-vera \
corefonts sharefonts freefonts font-ibm-type1

注意: 如果构建openmotif失败, "emerge -Dav --oneshot printproto xbitmaps libXp" 并重新开始emerge.

[编辑] 安装一个 window manager

如果是全新安装 Xorg 你需要安装并配置一个window manager(即使你要上xgl也一样). Portage 让这个变得很简单,当然.

Gnome 是一个好的选择:

代码: Emerging Gnome
emerge -D gnome

如果你有wmf UES 旗标这可能带来一个依赖性出错,如libwmf“显然”依赖一个旧版本的 X。不过,只要你个别地安装了libwmf,它仍可以和Xorg 7一起工作。那么好,继续emerge你的window manager。

代码: Emerging libwmf on Xorg 7
emerge --nodeps libwmf

[编辑] Features Apparently Missing

[编辑] 键盘映射Keyboard Mappings

有些人可能会在xorg 7.0中查找ca_enhanced的键盘映射。也许你找不到,可是它并没有消失,只是改了名字变成“ca(fr)",下面是这个键盘映射的配置:

代码: Xorg 7.0 with ca_enhanced keyboard equivalent
 Section "InputDevice"
     Identifier  "Keyboard1"
     Driver      "kbd"
     Option "AutoRepeat" "500 30"
     Option "XkbRules"   "xorg"
     Option "XkbModel"   "pc105"
     Option "XkbLayout"  "ca(fr)" #此行十分重要!!!
 EndSection

万一你定制了一个 xkb 模块(举例来说,如果你添加了一个diNovo的键盘),则要检查你修改过的/usr/share/X11/xkb文件,如果你的X server每次重启的时候按键盘都死掉的话,加上下面的链接

ln -s /usr/share/X11/XKeysymDB /usr/lib/X11/XKeysymDB

[编辑] 模块化 X 相关问题

[编辑] AMD64 GL 问题

Problems building xorg-server, glx, and other GL-related packages in modular X may be due to a multilib issue.

The first thing to try is to run

eselect opengl set nvidia

Or the correct opengl implementation for your system.

Note (20060306): Building the X server failed on my system as a result of not upgrading my version of nvidia-kernel and nvidia-glx before attempting to emerge xorg-x11.

=nvidia-kernel-1.0.8178-r3
=nvidia-glx-1.0.8178-r1

Another workaround if that doesn't work is to try the following:

cd /usr/include/GL
rm gl.h
rm glext.h
rm glx.h
rm glxext.h
rm glxmd.h
rm glxproto.h
rm glxtokens.h
ln -s /usr/lib/opengl/nvidia/include/gl.h
ln -s /usr/lib/opengl/global/include/glext.h
ln -s /usr/lib/opengl/nvidia/include/glx.h
ln -s /usr/lib/opengl/global/include/glxext.h
ln -s /usr/lib/opengl/xorg-x11/include/glxmd.h
ln -s /usr/lib/opengl/xorg-x11/include/glxproto.h
ln -s /usr/lib/opengl/xorg-x11/include/glxtokens.h

Note that the above assumes you have an NVidia card!

This also may work on AMD Athlon XP machines too. (added by solafide)

On AMD64 machines, try doing the following (substituting ati or nvidia as necessary):

cd /usr/include/GL
rm gl.h glext.h glx.h glxext.h glxmd.h glxproto.h glxtokens.h
ln -s /usr/lib64/opengl/(ati|nvidia)/include/* ./

Note that whatever you do, it will have to be re-done after any package that triggers an eselect opengl (or opengl-update).

This links these gl-related headers to the /usr/lib versions instead of /usr/lib32. Then try re-emerging.

Another thing to try, if you're using AMD64 and having problems compiling, is to check /etc/env.d/03opengl. Mine looks like this:

# Configuration file for eselect
# This file has been automatically generated.
LDPATH="//usr/lib/opengl/nvidia/lib://usr/lib32/opengl/nvidia/lib"
OPENGL_PROFILE="nvidia"

Notice that the LDPATH value points to both the /usr/lib and /usr/lib32 directories. If you only see /lib32, you might wanna try changing it to the above, then typing:

env-update
source /etc/profile

And see if that helps.

Note (20060226): My AMD64 system says:

LDPATH="/usr/lib32/opengl/nvidia/lib:/usr/lib64/opengl/nvidia/lib"
OPENGL_PROFILE="nvidia"

Note (20060318): You can also try

eselect opengl set xorg-x11

if none of the above works for you.

[编辑] xorg-server 试图编译每一个输入设备驱动

解决办法:你可以通过修改/etc/make.conf文件来制定使用哪个驱动。否则,将会把它们全部编译!

例如:

INPUT_DEVICES="keyboard mouse"

[编辑] Conflict: GNOME & evdev driver

On some machines, using the evdev driver w/modular X seems to conflict with GNOME. Symptoms include the following message when starting GNOME:

There was an error starting the GNOME Settings Daemon.
Some things such as themes, sounds, or background settings may not work correctly.
The Settings Dameon restarted too many times.  The last error message was:
Child process did not give an error message, unknown failure occurred.
Gnome will still try to restart the Settings Daemon next time you log in.

Icons are not customized and there is other strange behavior. (see screenshot of the error here)

[编辑] Workaround

A temporary solution is adding a patch that has not yet been included in the gnome-main/control-center ebuild. See:

http://bugs.gentoo.org/show_bug.cgi?id=116195 and http://bugzilla.gnome.org/show_bug.cgi?id=323724

Until the bug is addressed, you have to create an overlay of gnome-main/control-center manually. Here are the steps to do so:

1. Copy the contents of /usr/portage/gnome-base/control-center/ into /usr/local/portage/gnome-base/control-center/ -- the directory probably won't exist. You'll have to make it. The /usr/local/* version is the overlay directory where you can mess with stuff.

2. Modify the control-center-2.12.3.ebuild in the /usr/local/portage/gnome-base/control-center version so that in the "src_unpack()" section, you add:

#Fix for evdev problem
epatch ${FILESDIR}/${PN}-evdev-fix.patch

3. In the "files" subdirectory of your overlay, add the control-center-evdev-fix.patch. Make sure you name it that.

4. Now do this:

ebuild /usr/local/portage/gnome-base/control-center/control-center-2.12.3.ebuild digest

5. Make the overlay active by editing /etc/make.conf and adding the following:

PORTDIR_OVERLAY="/usr/local/portage"

6. Now try to emerge control-center and see if it works.

[编辑] Mouse Speed Uncontrollable with evdev Driver

My mouse is currently way too fast. xset m seems to have no effect on the speed or acceleration. I have tried changing the Resolution settings in xorg.conf too, to no avail. Anyone have any advice for working with evdev and high-speed mice?

I am using "lomoco" for setting my MX518 to 1600 dpi, xset m 0 0; seems to work pretty fine for me.

[编辑] Synaptics拒绝加载

先确保synaptics的ebuild被emerge安装,然后执行如下: ln -s /usr/lib/modules/input/synaptics_drv.so /usr/lib/xorg/modules/input/

另外,到synaptics-0.14.4-r2为止,ebuild安装工具已将驱动安装到正确的位置不再需要手动链接它了。

[编辑] 'emerge -u world' wants to install xorg-x11 6.x or 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.

[编辑] Workaround

Add the following to /etc/portage/package.mask:

文件: /etc/portage/package.mask

<=virtual/x11-6.8

This will force many of the dependency checks to want modular Xorg libraries to be installed instead of immediately wanting to install virtual/x11-6.8 when one of the modular Xorg dependencies is missing. Most packages have been ported to modular dependencies at this point, so this should be sufficient.

注意: People, please do some research and look at the ebuilds and read about portage resolver. The above won't fix nor work around anything, at best it can help to discover the real ebuild that has not been ported yet.


If it isn't, and you don't want to wait for it to be fixed (or fix it yourself), you may want to try this:

Add the following to /etc/portage/profile/package.provided:

文件: /etc/portage/profile/package.provided

virtual/x11-6.8

警告: This will BREAK dependency checking. If you do this, do NOT file any bugs about missing libraries or headers.

When a package gets its dependencies updated for modular X, it is set to depend on the components of modular X that it needs OR virtual/x11. Adding an entry to provide virtual/x11 will cause portage to completely skip checking if you have the right portions of modular X.

If you do this and file bugs, you will make the Gentoo developers VERY ANNOYED with you.


Or create a Virtual for Xorg 7.0

Code: Code:

cd /etc/portage
mkdir profile
cd profile
touch virtuals
echo 'virtual/x11 >=xorg-x11-7.0.0_rc3' >> virtuals

警告: This will BREAK dependency checking. If you do this, do NOT file any bugs about missing libraries or headers.

When a package gets its dependencies updated for modular X, it is set to depend on the components of modular X that it needs OR virtual/x11. Adding an entry to provide virtual/x11 will cause portage to completely skip checking if you have the right portions of modular X.

If you do this and file bugs, you will make the Gentoo developers VERY ANNOYED with you.

[编辑] Mouse wheel no longer works (xmodmap problem)

If you were previously using xmodmap -e "pointer = 1 2 3 6 7 4 5" to get your mouse wheel working, you may have to change this to xmodmap -e "pointer = 1 2 3 8 9 4 5 6 7 10 11". If this doesn't work, you might have to try other xmodmap expressions. See the Modular Xorg section in the Mouse Nav Buttons wiki for more info.

If this doesn't work, add evdev to INPUT_DEVICES in /etc/make.conf, emerge xorg-x11 and change your xorg.conf (for the InputDevice Section) to:

Section "InputDevice"
   Identifier  "Mouse0"
   Driver      "evdev"
   Option      "Protocol"     "Auto"
   Option      "Device"       "/dev/psaux"
   Option      "ZAxisMapping" "6 7 8 9" #Only "6 7" if you don't have sidebuttons
EndSection

Disable any xmodmap commands you used before. Just use imwheel for activating your side buttons: imwheel -p -k -b "89" -f

[编辑] Xorg won't start due to fglrx module missing

Re-emerge ati-drivers package to get X running again after the install. Make sure you recompile the the drivers with same compiler you used for the kernel, otherwise you'll get message about the module format being incompatible when you try to load the fglrx kernel module.

[编辑] Other problems

Please see http://bugs.gentoo.org and http://www.gentoo.org/proj/en/desktop/x/x11/modular-x-howto.xml

Note that unmasking portage in package.keywords--which is required for modular-x--will bring in the 2.1 development version of portage. There are some changes to portage 2.1 that will affect folks running mostly stable systems. For example, the 'autouse' flag settings are now disabled. See http://www.gentoo.org/news/en/gwn/20060116-newsletter.xml.