Linux应用随笔(三)命名行下连接WIFI并解决A卡驱动问题

来源:互联网 发布:游戏策划笔试 知乎 编辑:程序博客网 时间:2024/05/29 11:27

最近linux经常出现开机进入不了图形界面的情况,startx会卡住,reboot也会卡住,最后发现是ati开源驱动的问题,换成fglrx闭源驱动问题就都解决了。
在这过程中,图形出不来,除非grub时设置成nomodeset。那么如何在命令行下连接WIFI呢?
vim /etc/wpa_supplicant/wpa_supplicant.conf写入以下内容:

ctrl_interface=/var/run/wpa_supplicantctrl_interface_group=0update_config=1network={    ssid="WIFI名称"    psk="WIFI密码"    priority=1}

wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf连上后按Ctrl+Z挂起
dhclient wlan0自动获取IP

这样就有网了,接下来就要下载fglrx-*驱动了,直接apt-get install就行了。
安装后需要生成xorgl.conf文件,使用aticonfig –initial,这样startx就能进入图形界面了。不过,有时我们需要用两个屏幕,这时就应该用:

aticonfig --initial=dual-head --screen-layout=right

这样开机后VGA屏自动扩展。
这里和ATI驱动对比一下:ati驱动通过xrandr –output VGA-0 –right-of LVDS命令实现双屏显示,而fglrx则是aticonfig自动生成xorg.conf文件。xorg.conf内容如下:

Section "ServerLayout"    Identifier     "aticonfig Layout"    Screen      0  "aticonfig-Screen[0]-0" 0 0    Screen         "aticonfig-Screen[0]-1" RightOf "aticonfig-Screen[0]-0"    Option         "Xinerama" "on"EndSectionSection "Module"EndSectionSection "Monitor"    Identifier   "aticonfig-Monitor[0]-0"    Option      "VendorName" "ATI Proprietary Driver"    Option      "ModelName" "Generic Autodetecting Monitor"    Option      "DPMS" "true"EndSectionSection "Monitor"    Identifier   "aticonfig-Monitor[0]-1"    Option      "VendorName" "ATI Proprietary Driver"    Option      "ModelName" "Generic Autodetecting Monitor"    Option      "DPMS" "true"EndSectionSection "Device"    Identifier  "aticonfig-Device[0]-0"    Driver      "fglrx"    BusID       "PCI:0:1:0"EndSectionSection "Device"    Identifier  "aticonfig-Device[0]-1"    Driver      "fglrx"    BusID       "PCI:0:1:0"    Screen      1EndSectionSection "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    EndSubSectionEndSectionSection "Screen"    Identifier "aticonfig-Screen[0]-1"    Device     "aticonfig-Device[0]-1"    Monitor    "aticonfig-Monitor[0]-1"    DefaultDepth     24    SubSection "Display"        Viewport   0 0        Depth     24    EndSubSectionEndSection

需要注意的是“ServerLayout”中Option “Xinerama” “on”要自己加上,否则相当于又开了一个工作空间,不过不可以拖窗口进去。
我安装Debian只装最基本的系统而不选择utuntu,虽然会比较麻烦,不过遇到问题也就能找到是什么原因,还是值得的。

1 0