LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2886|回复: 14

求助:新装的gentoo,在X下不认鼠标和键盘

[复制链接]
发表于 2009-2-27 11:56:10 | 显示全部楼层 |阅读模式
前几天开始在公司电脑上以ubuntu为宿主安装gentoo,因为以前在笔记本上装过一次,再加上gentoo详尽的文档,安装过程相当顺利。直到装完X和gnome,重启后卡在登录界面,发现鼠标和键盘(都是PS/2的)不起作用了,借同事的USB鼠标和USB键盘也没反应。

内核:
gentoo和ubuntu用的是同样的2.6.28.7内核,已经将PS/2鼠标和键盘及USB下的Human Interface Device,直接编译进内核,在ubuntu下鼠标和键盘(PS/2和USB)都很正常。
而且在gentoo的终端下,鼠标(安装了gpm)和键盘也都可用。

/etc/X11/xorg.conf:
xorg.conf是先用gentoo的Xorg -configure生成,再参考ubuntu下的xorg.conf写成的。
$cat /etc/X11/xorg.conf
Section "Files"
        FontPath     "/usr/share/fonts/misc/"
        FontPath     "/usr/share/fonts/TTF/"
        FontPath     "/usr/share/fonts/OTF"
        FontPath     "/usr/share/fonts/Type1/"
        FontPath     "/usr/share/fonts/100dpi/"
        FontPath     "/usr/share/fonts/75dpi/"
EndSection

Section "ServerLayout"
        Identifier        "Default Layout"
        Screen                "Default Screen"
        InputDevice        "Generic Keyboard"
        InputDevice        "Configured Mouse"
EndSection

Section "Module"
        Load  "xtrap"
        Load  "record"
        Load  "dri"
        Load  "extmod"
        Load  "glx"
        Load  "dbe"
        Load  "GLcore"
        Load  "freetype"
        Load  "type1"
EndSection

Section "InputDevice"
        Identifier        "Generic Keyboard"
        #Driver                "kbd"
        Driver                "keyboard"
        Option                "CoreKeyboard"
        Option                "XkbRules"        "xorg"
        Option                "XkbModel"        "pc105"
        Option                "XkbLayout"        "us"
EndSection

Section "InputDevice"
        Identifier        "Configured Mouse"
        Driver                "mouse"
        Option                "CorePointer"
        Option                "Device"                "/dev/input/mice"
        #Option                "rotocol"                "auto"
        Option                "rotocol"                "IMPS/2"
        #Option                "rotocol"                "S/2"
        Option                "ZAxisMapping"                "4 5"
        #Option                "Emulate3Buttons"        "true"
EndSection

Section "Monitor"
        Identifier        "HP w17e"
        VendorName        "HWP"
        ModelName        "HP w17e"
        HorizSync        30.0 - 83.0
        VertRefresh        55.0 - 75.0
        Option                "DPMS"
EndSection

Section "Device"
        Identifier        "Intel Corporation Integrated Graphics Controller"
        Driver                "intel"
        BusID                "CI:0:2:0"
EndSection

Section "Screen"
        Identifier        "Default Screen"
        Device                "Intel Corporation Integrated Graphics Controller"
        Monitor                "HP w17e"
        DefaultDepth        24
        SubSection "Display"
                Viewport   0 0
                Modes                "1440x1440" "1440x900" "1280x1024" "1152x864" "1024x768" "832x624" "800x600" "720x400" "640x480"
        EndSubSection
EndSection
X启动后除了鼠标键盘不认外,其它都很正常。

附上我的make.conf
$cat /etc/make.conf
CFLAGS="-O2 -march=i686 -pipe"
CXXFLAGS="-O2 -march=i686 -pipe"

CHOST="i686-pc-linux-gnu"
MAKEOPTS="-j3"

GENTOO_MIRRORS="ftp://ftp3.tsinghua.edu.cn/mirror/gentoo        \
http://gentoo.in.th/ \
http://mirror.averse.net/pub/gentoo/        \
ftp://gentoo.anheng.com.cn/gentoo"

SYNC="rsync://mirror.averse.net/gentoo-portage"

FETCHCOMMAND="/usr/bin/aria2c -m 5 -t 60 --ftp-pasv -d \"\${DISTDIR}\" \"\${URI}\" "
RESUMECOMMAND="/usr/bin/aria2c -c -m 5 -t 60 --ftp-pasv -d \"\${DISTDIR}\" \"\${URI}\" "

INPUT_DEVICES="keyboard mouse"
VIDEO_CARDS="intel"
FEATURES="distlocks fixpackages keeptemp noclean parallel-fetch protect-owned sandbox sfperms strict unmerge-orphans userfetch"
ACCEPT_KEYWORDS="~x86"
LINGUAS="zh_CN"

USE="acpi alsa avahi bash-completion bluetooth cairo cdr cjk crypt cscope cxx dbus -directfb dvd dri examples fbcon ftp gdbm geoip gif gimp gnome gnutls gpm gstreamer gtk gtk2 gtkhtml gzip hal hddtemp iconv icu imagemagick javascript jpeg jpeg2k latex libnotify lm_sensors mmap mmx mozilla mp3 mpeg mplayer ncurses networkmanager nls nptl ogg opengl openmp pch pdf perl png posix profile pulseaudio python quicktime rdesktop readline samba sdl smp sockets socks5 spell sse sse2 ssl startup-notification subversion suid symlink syslog threads tiff truetype unicode usb v4l v4l2 vim-syntax vnc win32codecs wmf X xft xine xinerama xinetd xml xpm xscreensaver xulrunner zlib -a52 -aac -adns -aim -arts -cups -cgi -chasen -clamav -cracklib -css -cvs -db2 -dbase -dbm -dbmaker -dbx -debug -dedicated -djvu -doc -dts -dv -dvb -dvdr -dvdread -eds -emacs -emboss -empress -empress-bcs -encode -esoob -evo -exif -expat -fam -fastcgi -fftw -firebird -flac -flatfile -fltk -fontconfig -foomaticdb -fortran -freetds -freewnn -frontbase -gcj -gd -gd-external -ggi -ginac -glut -gmp -gnome-keyring -gnuplot -gnustep -gphoto2 -gps -graphviz -gsl -guile -hdf5 -htmlhandbook -ibm -icq -idn -ieee1394 -imap -imlib -inifile -innodb -interbase -iodbc -ipod -ipv6 -jabber -jack -java -java5 -java6 -jbig -jingle -joystick -kde -kontact -kdeenablefinal -kdehiddenvisibility -kdeprefix -kerberos -kolab -krb4 -ladcca -ladspa -lame -lapack -lash -lcms -ldap -libcaca -libedit -libgda -libsamplerate -libwww -lirc -livecd -lua -lzo -m17n-lib -mad -maildir -mailwrapper -matroska -mbox -mcve -memlimit -mhash -migemo -mikmod -milter -mime -minimal -mng -modplug -mono -motif -mpi -msn -msql -mssql -mule -multilib -musepack -musicbrainz -mysql -mysqli -nas -neXt -netboot -netcdf -nis -nntp -nocd -nocxx -nsplugin -ocaml -ocamlopt -oci8 -oci8-instant-client -odbc -offensive -ofx -old-linux -openal -openexr -oracle -osc -oscar -oss -pam -pcmcia -pcntl -pcre -pda -php -plasma -plotutils -portaudio -postgres -ppds -prelude -qdbm -qmail-spp -qt3 -qt4 -radius -raw -recode -rss -ruby -sapdb -sasl -scanner -seamonkey -session -sharedext -sharedmem -shorten -simplexml -skey -slang -slp -smartcard -sndfile -snmp -soap -solid -source -sox -speex -spl -sqlite -sqlite3 -static -svg -svga -sybase -sybase-ct -sysvipc -szip -taglib -tcl -tcpd -theora -tidy -timidity -tk -tokenizer -uclibc -vcd -vhosts -videos -voodoo3 -vorbis -wavpack -wddx -wifi -wxwindows -x264 -xattr -xcb -xemacs -xface -xmlrpc -xosd -xprint -xsl -xv -xvid -yahoo -yaz -zeroconf"


望高手支招。
发表于 2009-2-27 12:02:02 | 显示全部楼层
看一下Xorg的log
回复 支持 反对

使用道具 举报

发表于 2009-2-27 12:12:08 | 显示全部楼层
Section "InputDevice"
        Identifier        "Generic Keyboard"
        #Driver                "kbd"
        Driver                "keyboard"
        Option                "CoreKeyboard"
        Option                "XkbRules"        "xorg"
        Option                "XkbModel"        "pc105"
        Option                "XkbLayout"        "us"
EndSection

Section "InputDevice"
        Identifier        "Configured Mouse"
        Driver                "mouse"
        Option                "CorePointer"
        Option                "Device"                "/dev/input/mice"
        #Option                "rotocol"                "auto"
        Option                "rotocol"                "IMPS/2"
        #Option                "rotocol"                "S/2"
        Option                "ZAxisMapping"                "4 5"
        #Option                "Emulate3Buttons"        "true"
EndSection


你把Section "InputDevice"里面
  1. #Driver                "kbd"
  2. #Option                "Protocol"                "PS/2"
复制代码

之类的去掉注释看看.
回复 支持 反对

使用道具 举报

发表于 2009-2-27 12:15:54 | 显示全部楼层
还可以在xorg.conf 底下加上
  1. Section “DRI”
  2. Mode         0666
  3. EndSection
复制代码
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-27 12:58:03 | 显示全部楼层
不好意思,回复的晚了,刚才吃饭去了。
#Driver                "kbd"
#Option                "rotocol"                "S/2"
这些注释都是试过后不行,才注释掉的。

X的log有点长
$cat /var/log/Xorg.0.log


X.Org X Server 1.5.3
Release Date: 5 November 2008
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.28.2 i686
Current Operating System: Linux localhost 2.6.28.7 #1 SMP Wed Feb 25 15:32:38 CST 2009 i686
Build Date: 24 February 2009  11:30:04PM

        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Fri Feb 27 20:53:20 2009
(==) Using config file: "/etc/X11/xorg.conf"
(==) ServerLayout "Default Layout"
(**) |-->Screen "Default Screen" (0)
(**) |   |-->Monitor "HP w17e"
(**) |   |-->Device "Intel Corporation Integrated Graphics Controller"
(**) |-->Input Device "Generic Keyboard"
(**) |-->Input Device "Configured Mouse"
(==) Automatically adding devices
(==) Automatically enabling devices
(**) FontPath set to:
        /usr/share/fonts/misc/,
        /usr/share/fonts/TTF/,
        /usr/share/fonts/OTF,
        /usr/share/fonts/Type1/,
        /usr/share/fonts/100dpi/,
        /usr/share/fonts/75dpi/,
        /usr/share/fonts/misc/,
        /usr/share/fonts/TTF/,
        /usr/share/fonts/OTF,
        /usr/share/fonts/Type1/,
        /usr/share/fonts/100dpi/,
        /usr/share/fonts/75dpi/,
        built-ins
(==) ModulePath set to "/usr/lib/xorg/modules"

(WW) AllowEmptyInput is on, devices using drivers 'kbd' or 'mouse' will be disabled.
(WW) Disabling Generic Keyboard
(WW) Disabling Configured Mouse

(WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
(II) No APM support in BIOS or kernel
(II) Loader magic: 0x81c7be0
(II) Module ABI versions:
        X.Org ANSI C Emulation: 0.4
        X.Org Video Driver: 4.1
        X.Org XInput driver : 2.1
        X.Org Server Extension : 1.1
        X.Org Font Renderer : 0.6
(II) Loader running on linux
(--) using VT number 7

后面省略...
回复 支持 反对

使用道具 举报

发表于 2009-2-27 13:01:30 | 显示全部楼层
在/etc/make.conf 里面, INPUT_DEVICES="keyboard mouse"
改为: INPUT_DEVICES="keyboard mouse evdev"
再emerge -uDN world 试试.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-27 13:13:48 | 显示全部楼层
谢楼上,
刚才加了
Section “DRI”
Mode         0666
EndSection
进去,不行
另:
那个INPUT_DEVICES里的evdev代表什么?


Xorg.0.log的第39-41行很奇怪啊。
(WW) AllowEmptyInput is on, devices using drivers 'kbd' or 'mouse' will be disabled.
(WW) Disabling Generic Keyboard
(WW) Disabling Configured Mouse

好像就是它了
这个AllowEmptyInput是这哪个地方设置的?我没有设置过它,怎么会成on了呢?
回复 支持 反对

使用道具 举报

发表于 2009-2-27 13:24:33 | 显示全部楼层
回复 支持 反对

使用道具 举报

发表于 2009-2-27 13:32:38 | 显示全部楼层
默认就是 on. 如果想在 xorg.conf 里设置键盘鼠标,把它设成 off.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-2-27 14:13:31 | 显示全部楼层
感谢楼上各位亲爱的弟兄,可以结贴了
参考8楼的链接
http://www.linuxsir.cn/bbs/thread339907.html

Section "ServerFlags"
Option "AllowEmptyInput" "False"
Option "AutoAddDevices" "False"
EndSection
加入Xorg.conf

鼠标和键盘复活。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表