2009年2月23日星期一

终于用上了Arch Linux

折腾了几天。首先是无限网卡问题,这个到很快从 ArchWiki 上得到解决的办法。
接下来很折腾的是 Xorg 上显卡的驱动问题。一开始 google 了一些资料,无论是使用了 vesa 驱动、开源驱动 vf86-video-ati 还是最新的 catalyst 驱动,均告失败。正在我准备放弃的时候,突然又乱搞搞好了。其实这个做法很简单,也不漂亮。首先要安装好 xorg 和 catalyst ,接下来具体就是:
1、安装 hwd :
$ sudo pacman -S hwd
自动生成 xorg.conf 文件:
$ sudo hwd -xa
2、初始化 catalyst 驱动:
$ sudo aticonfig --initial -f
配置 catalyst 驱动:
这个参照:终于在Fedora10上成功安装并使用ATI显卡驱动fglrx
最后我的 xorg.conf 是这样的:


# Auto-generated by Archie mkxcfg
# Auto-generated by Archie mkxcfg

Section "ServerLayout"

# PS/2 Mouse not detected
# Serial Mouse not detected
Identifier "Xorg Configured"
Screen 0 "aticonfig-Screen[0]-0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "USB Mouse" "CorePointer"
EndSection

Section "Files"

# Additional fonts: Locale, Gimp, TTF...
# FontPath "/usr/share/lib/X11/fonts/latin2/75dpi"
# FontPath "/usr/share/lib/X11/fonts/latin2/100dpi"
# True type and type1 fonts are also handled via xftlib, see /etc/X11/XftConfig!
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/misc:unscaled"
FontPath "/usr/share/fonts/misc"
FontPath "/usr/share/fonts/75dpi:unscaled"
FontPath "/usr/share/fonts/75dpi"
FontPath "/usr/share/fonts/100dpi:unscaled"
FontPath "/usr/share/fonts/100dpi"
FontPath "/usr/share/fonts/PEX"
FontPath "/usr/share/fonts/cyrillic"
FontPath "/usr/share/fonts/Type1"
FontPath "/usr/share/fonts/ttf/western"
FontPath "/usr/share/fonts/ttf/decoratives"
FontPath "/usr/share/fonts/truetype"
FontPath "/usr/share/fonts/truetype/openoffice"
FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera"
FontPath "/usr/share/fonts/latex-ttf-fonts"
FontPath "/usr/share/fonts/defoma/CID"
FontPath "/usr/share/fonts/defoma/TrueType"
EndSection

Section "Module"

#Load "type1"
#Load "ddc" # ddc probing of monitor
#Load "dbe"
#Load "dri"
#Load "extmod"
#Load "glx"
#Load "bitmap" # bitmap-fonts
#Load "freetype"
#Load "record"
#Load "synaptics"
EndSection

Section "ServerFlags"
Option "AllowMouseOpenFail" "true"
Option "AutoAddDevices" "False"
Option "AIGLX" "on"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "keyboard"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
Option "XkbVariant" ""
EndSection

Section "InputDevice"
Identifier "Serial Mouse"
Driver "mouse"
Option "Protocol" "Microsoft"
Option "Device" "/dev/ttyS0"
Option "Emulate3Buttons" "true"
Option "Emulate3Timeout" "70"
Option "SendCoreEvents" "true"
EndSection

Section "InputDevice"
Identifier "PS/2 Mouse"
Driver "mouse"
Option "Protocol" "auto"
Option "ZAxisMapping" "4 5"
Option "Device" "/dev/psaux"
Option "Emulate3Buttons" "true"
Option "Emulate3Timeout" "70"
Option "SendCoreEvents" "true"
EndSection

Section "InputDevice"
Identifier "USB Mouse"
Driver "mouse"
Option "Device" "/dev/input/mice"
Option "SendCoreEvents" "true"
Option "Protocol" "IMPS/2"
Option "ZAxisMapping" "4 5"
Option "Buttons" "5"
EndSection

Section "Monitor"
Identifier "aticonfig-Monitor[0]-0"
Option "VendorName" "ATI Proprietary Driver"
Option "ModelName" "Generic Autodetecting Monitor"
Option "DPMS" "true"
EndSection

Section "Device"
Identifier "aticonfig-Device[0]-0"
Driver "fglrx"
BusID "PCI:1:0:0"
Option "OpenGLOverlay" "off"
Option "VideoOverlay" "on"
EndSection

Section "Screen"
Identifier "aticonfig-Screen[0]-0"
Device "aticonfig-Device[0]-0"
Monitor "aticonfig-Monitor[0]-0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

Section "DRI"
Mode 0666
EndSection

启动进入 X 有点慢,可能有些地方还没配置好,不过已经可以很好的工作了。
接下来享受 平滑升级 和 最新软件包 的乐趣了,还有强大的 abs 。

2009年2月22日星期日

Cygwin中的DAEMON程序

以前写过一篇文章:继续尝试Cygwin上运行zope
那时候得出的结论是错误的。那并不是 ZODB 的问题,而是在 Cygwin 中运行 DAEMON 程序的话,是需要注册成 Windows 服务的。
昨晚在 Cygwin 中尝试最新的 Zope3.4.0 时候发现了这个问题。在使用 zope3 创建的实例中的 bin/zopeservice.py 命令中有这样的说明:

You can view the usage options by running ntservice.py without any
arguments.

Note: you may have to register the Python service program first,

win32\PythonService.exe /register

就像在 Cygwin 中运行 Apache 服务器一样,都是需要注册成 Windows 服务的。

2009年2月14日星期六

终于在Fedora10上成功安装并使用ATI显卡驱动fglrx

主要参考这篇国人翻译的文章:http://linuxtoy.org/archives/rpmfusion-testing-added-fglrx-for-fedora10-added-uninstall.html
forum.fedoraforum.org 上的原文:http://forums.fedoraforum.org/showthread.php?t=155503

我在一个星期前曾经安装过,但是那个时候装完了却还是没有使用上已经装上去的 fglrx 驱动,那时很郁闷地卸载了。
今天我看到这个文章,才发现我以前没有完全正确安装 fglrx 驱动,导致没有使用上 fglrx 驱动。

没错, fglrx 相关的驱动包已经放到 rpmfusinon-nonfree-updates 中了。

参照了这篇文章,我的安装一开始就遇到了个小问题, google 了会终于解决了这个奇怪的依赖问题。
就是在执行:
$ sudo yum install akmod-fglrx xorg-x11-drv-fglrx xorg-x11-drv-fglrx-libs.i386
安装驱动包的时候, yum 的依赖关系出了个问题,提示 elfutils 和elfutils-libs 这两个包缺失。
google 一下, forum.fedoraforum.org 上已经有这个问题的解决方法了:
http://forums.fedoraforum.org/showthread.php?t=212336
按照 #4 的回帖,运行:
$ sudo yum install rpm-build rpmdevtools --enablerepo=updates-testing
安装了 testing 中几个相关联的包之后,再安装驱动就没问题了。
我安装的版本是:8.573
现在安装驱动的时候连 system-config-display 也都一起装上了。

接下来的配置非常重要,我原来没有完全装好就是因为下面四点:
1、显卡驱动配置初始化工作:
$ sudo aticonfig --initial -f
我原来就是少了个 -f 参数!
2、修改 /etc/X11/xorg.conf 配置文件:
添加的三个字段中其实前面两个已经有了,把最后一个补上:
Section "DRI"
Mode 0666
EndSection
暂时不知道不添加这个字段是否可行。
然后在 Device 字段内添加如下两行:
Option "OpenGLOverlay" "off"
Option "VideoOverlay" "on"
暂时也不知道这个是否可以不加。
3、禁止载入已有的 radeon 驱动:
先备份,运行:
$ sudo mv /boot/initrd-`uname -r`.img /boot/initrd-`uname -r`.img.backup
然后重新生成新的 initrd,使 radeon 模块不会被强行载入:
$ sudo mkinitrd -v /boot/initrd-`uname -r`.img `uname -r`
我以前在 Debian 和 Ubuntu 中使用 Nvidia 官方提供的安装包安装 GF2MX400 显卡驱动的时候,看到的提示也是类似,都需要重新生成新的 inird 。
4、编辑 /boot/grub/grub.conf
在内核(kernel)所在行的最后添加 nopat参数
暂时也不知道这个是否可以不添加。

最后重启机器。不出意外的话,fglrx 驱动就已经成功安装上了。
使用 glxgears 命令可以看到现在的帧数有 3000fps 多,原来系统默认驱动的帧数只有 200fps 多!还有个 fgl_glxgears 命令,出来一个类似glxgears的东东,帧数有 700fps 多。
运行:
$ fglrxinfo
得到:
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Mobility Radeon HD 2400 XT
OpenGL version string: 2.1.8395 Release

开启桌面特效(compiz),可以炫耀了,哈哈!原来系统默认驱动一点击“启用桌面特效”按钮,就黑屏了几十秒钟!晕~

不久前没有完全正确装上 fglrx 驱动的情况下,登录过程并不平滑,无论我对 /etc/X11/xorg.conf 做怎样的配置,在登录界面(gdm)上是我设置的 1280x800 分辨率,但是在过度到桌面的过程中,分辨率闪到了 1024x768 ,这对于使用宽屏的机器来说显示效果极其不好,而且不平滑的登录过程让人反感。最后我把 /etc/X11/xorg.conf 文件删除了,就恢复了原来的平滑过度和 1280x800 分辨率,真是怪事。

我的机器:Gateway T-6832c

Linux之hostname更正

我曾经写过一篇文章:Linux之hostname修改问题

这两天查看 hostname 的 Manual 才发现原来自己搞错了。
在我的 Fedora 10 里,
$ man hostname
中提到 hostname 命令只是临时的修改 hostname ,下次重启机器之后,hostname 将恢复原来的设置。
真正记录 hostname 的在
/etc/sysconfig/network
这个配置文件中。只要修改了其中的 HOSTNAME 参数的值,以后每次启动机器默认都是使用这个值作为 hostname 。
当然最好也修改 /etc/hosts 配置文件,这个文件和 Windows 下的 %system32%/drivers/etc/hosts 文件作用相同,写法类似。

--------------------------------
2009,02,16
最近迷上了 Arch Linux ,其 hostname 似乎存放在 /etc/rc.conf 的 “HOSTNAME”参数中。