sl400上面安装ubuntu

来源:互联网 发布:visio 书籍 知乎 编辑:程序博客网 时间:2024/05/01 18:45

写下这篇文章只是为了让自己不要忘了装系统的和配置环境的过程,以及方便以后重装。

 

首先,安装ubuntu,很简单,选择一个磁盘进行安装。装完之后,修改源 vi /etc/apt/source.list,我一般改成香港的源,下面贴出我的源:
deb http://hk.archive.ubuntu.com/ubuntu/ karmic main restricted
deb-src http://hk.archive.ubuntu.com/ubuntu/ karmic main restricted
deb http://hk.archive.ubuntu.com/ubuntu/ karmic universe
deb-src http://hk.archive.ubuntu.com/ubuntu/ karmic universe
deb http://hk.archive.ubuntu.com/ubuntu/ karmic multiverse
deb-src http://hk.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://security.ubuntu.com/ubuntu/ karmic-security restricted main multiverse universe
改完之后,就使用apt-get更新和安装吧。到此,ubuntu安装就算完成了。

在联想的sl400上面安装ubuntu并不是一件困难的事情,但是,如果你要把所有的硬件驱动都装好,也不是一件容易的事,当初我为了能装好热键驱动可是费了好些时间。
下面是转载的一篇文章:
文章转载:http://q.yesky.com/group/review-17874716.html

原始的文档:http://gianlucamagalotti.wordpress.com/2009/02/16/lenovo-thinkpad-sl-series-hotkeys/,我针对ubuntu进行了一些细微的修改。

1、下载源程序。
到http://github.com/tetromino/lenovo-sl-laptop/tree/master 去下载Makefile 和lenovo-sl-laptop.c两个文件。可以下载tar包或zip包,下载完毕后解压缩,只需要其中的Makefile和 lenovo-sl-laptop.c 两个文件

2、编译、安装源程序。
打开终端,进入文件下载到的目录,用下面的命令进行编译(请不要用root用户编译,即不要用sudo)
代码:make all
再将编译好的驱动模块复制到驱动目录
代码:sudo cp lenovo-sl-laptop.ko /lib/modules/`uname -r`/kernel/drivers/misc
并重建模块间的依赖关系
代码:sudo depmod

3、禁用原来的thinkpad-acpi模块。
编辑/etc/modprobe.d/blacklist文件,
代码:sudo gedit /etc/modprobe.d/blacklist
在末尾加入下面这行内容
代码:blacklist thinkpad-acpi
保存,关闭。

4、设置模块自动加载(重启后生效)
在/etc/modules中加入一行lenovo-sl-laptop,或者用下面的命令:
代码:sudo sed -i '$alenovo-sl-laptop' /etc/modules

5、允许驱动管理屏幕背光
创建/etc/modprobe.d/lenovo-sl-laptop.conf
代码:sudo gedit /etc/modprobe.d/lenovo-sl-laptop.conf
加入一行
代码:options lenovo-sl-laptop control_backlight=1

6、手动加载模块
代码:sudo modprobe lenovo-sl-laptop


现在应该能用除Fn+F8(禁用/启用触摸板)以外所有的快捷键了,如果你遇到了关于背光控制的问题,请仿照第3步禁用video模块,并将 /etc/init.d/hotkey-setup文件中的echo 0 > /sys/module/video/parameters/brightness_switch_enabled一行删掉(如果有的话),并重新启动。

对于Fn+F8,按照以下步骤:
1、创建/etc/hal/fdi/policy/shmconfig.fdi
代码:sudo gedit /etc/hal/fdi/policy/shmconfig.fdi

2、加入下列内容,保存,关闭。
代码:<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
<device>
<match key="input.x11_driver" string="synaptics">
<merge key="input.x11_options.SHMConfig" type="string">True</merge>
</match>
</device>
</deviceinfo>

3、安装notify-send(这步我没有做,一样可以用)
代码:sudo apt-get install libnotify-bin

4、创建一个脚本来处理按下Fn+F8的事件
代码:sudo mkdir /usr/share/hotkey-setup/gconf-commands
sudo gedit /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle
加入以下内容
代码:#!/bin/bash
STATE=`synclient -l | grep TouchpadOff | cut -f2 -d'=' | cut -c2`
PARAMS="-t 1500 -i /usr/share/pixmaps/gnome-user-interface.png"
if [ $STATE -eq 0 ] ; then
synclient TouchpadOff=1
notify-send $PARAMS "Touchpad <i>DISABLED</i>" "Touchpad has been <b><i>DISABLED</i></b>"
else
synclient TouchpadOff=0
notify-send $PARAMS "Touchpad <i>ENABLED</i>" "Touchpad has been <b><i>ENABLED</i></b>"
fi
保存,关闭
给脚本加上可执行权限
代码:sudo chmod uga+x /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle
让GNOME在按下Fn+F8时执行脚本(注意,这会覆盖原来的command_1的值,可以在配置编辑器或者Ubuntu-Tweak里看到,你可以换成command_2~command_12)
代码:gconftool-2 -s --type string /apps/metacity/keybinding_commands/command_1 /usr/share/hotkey-setup/gconf-commands/synaptic-touchpad-toggle
gconftool-2 -s --type string /apps/metacity/global_keybindings/run_command_1 XF86Launch1

到此所有的热键就都可以用了

原创粉丝点击