这次从新装了8。04, 所以aps又要从新作一遍,不过因为我把该用到的东西都保存了,所以比较简单,但是这里还是记录一下全部信息,因为肯定也有和其他小黑用户希望自己的机器能用上硬盘保护和电池充电阀门。
------------------------
首先,你所需要的是linux-headers-2.6.22-14的安装,在8。04中,已经没有2。6。22了所以你需要在/etc/apt/source.list 中加入7。10的cn99的源,然后使用
sudo apt-get install linux-headers-2.6.22-14
接着,你将用到的所有的包如下:
在这里我说明一下:你所需要的所有的包均可以到ftp.ubuntu.org.cn/home/casio1374633/linux_on_thinkpad/下载。用户名是ubuntu 密码是 ubuntuftp
为了方便,我建议你在/home/your_name/下建立APS/文件夹,然后把东西一次性都放进去。
*************************************
hdapsd_0.0.20070803-1_i386.deb
hdapsd-20070524.c
linux-headers-2.6.22-14-thinkpad_2.6.22-14.47_i386.deb
linux-image-2.6.22-14-thinkpad_2.6.22-14.47_i386.deb
linux-restricted-modules-2.6.22-14-thinkpad_2.6.22.4-14.10_i386.deb
linux-ubuntu-modules-2.6.22-14-thinkpad_2.6.22-14.37_i386.deb
tp_smapi
tp-smapi-modules-2.6.22-14-thinkpad_0.34-1+2.6.22-14.47_i386.deb
tp-smapi-source_0.34-1_all.deb
gnome-hdaps-applet/
*************************************
当安装了headers-2.6.22-14以后,你就可以安装linux-headers-2.6.22-14-thinkpad_2.6.22-14.47_i386.deb了。
----------------------------
sudo dpkg -i linux-headers-2.6.22-14-thinkpad_2.6.22-14.47_i386.deb
----------------------------
接着输入:
---------------------------------------
sudo dpkg -i \
linux-restricted-modules-2.6.22-14-thinkpad_2.6.22.4-14.10_i386.deb \
linux-ubuntu-modules-2.6.22-14-thinkpad_2.6.22-14.37_i386.deb \
linux-image-2.6.22-14-thinkpad_2.6.22-14.47_i386.deb
----------------------------------------
当安装好后,grub中就应该有新的选项了。
## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false
## ## End Default Options #
如果没有,请在此处手动添加如下代码:
title Thinkpad_8.04, kernel 2.6.22-14-thinkpad
root (hd0,7)
kernel /boot/vmlinuz-2.6.22-14-thinkpad root=UUID=230b9faf-4d2f-40bc-9ee0-0902ce63b191 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-thinkpad
------------------------------------
从起以后,安装tp_smapi模块
--------------------------------------------
sudo dpkg -i tp-smapi-modules-2.6.22-14-thinkpad_0.34-1+2.6.22-14.47_i386.deb
sudo dpkg -i hdapsd_0.0.20070803-1_i386.deb
--------------------------------------------
并且执行以下代码
sudo rmmod hdaps
sudo modprobe -a tp_smapi hdaps
sudo udevtrigger
--------------------------------------------
修改文件
sudo vim /etc/default/hdapsd
将hda改成sda。
--------------------------------------------
重启电脑,这个时候,硬盘保护系统就应该装好了
检测如下:
dmesg | grep hdaps
你应该看到的信息是:
hdaps: IBM ThinkPad T43 detected.
hdaps: initial latch check good (0x01).
hdaps: device successfully initialized.
input: hdaps as /class/input/input4
hdaps: driver successfully loaded.
这里可能会有些不同,但一定要看到第一行和最后一行。
--------------------------------------------
另外一个是虽然和hdapsd重复,但是我建议你还是做了的好:
gcc -o hdapsd hdapsd-*.c
sudo cp hdapsd /usr/local/sbin/
通过输入hdapsd -d sda -s 15 来看看是否运行。
-------------------------------------------
重启电脑
然后输入:
dmesg | grep protect
如果你能看到parked的词语,说明硬盘防震已经开始工作了。恭喜你安装成功。
------------------------------------------
再来看gnome-hdaps-applet,这是一个桌面显示时时状态的。
安装如下:
$ sudo install gnome-hdaps-applet /usr/bin/
$ sudo mkdir /usr/share/pixmaps/gnome-hdaps-applet/
$ sudo cp *.png /usr/share/pixmaps/gnome-hdaps-applet/
$ sudo cp GNOME_HDAPS_StatusApplet.server /usr/lib/bonobo/servers(注意:wiki上面只到bonobo是错误的)
这样你就算安装成功了,在面板上添加附件能看到hdapsd的图标。
-------------------------------------------
tp_smapi里面带了给电池充电的阀门软件,所以你只需要作很小的配置即可:
这个模块主要是电池相关功能的设置
需要root:
# echo 40 > /sys/devices/platform/smapi/BAT0/start_charge_thresh
# echo 70 > /sys/devices/platform/smapi/BAT0/stop_charge_thresh
# cat /sys/devices/platform/smapi/BAT0/*_charge_thresh
可以把头两行加入/etc/rc.local中, 每次开机就ok了
-------------------------------------------
下面再增加在屏幕上显示音量变化和亮度变化,和win一致。用到的软件是tpb
直接apt-get就可以了
然后配置tbprc
------------------------
配置~/.tpbrc或/etc/tpbrc,以下设置仅作参考代码:
# Use OSS mixer to change volume and for mute/unmute. This should be use on
# models with no hardware mixer (volume and mute buttons show no effect). R31
# is reported to have no hardware mixer. To use this you must enable write
# access to the NVRAM device (possibly dangerous). Possible values are on and
# off. Default is off.
#
MIXER ON
## MIXERSTEPS
# Defines how much steps should be available when using the OSS mixer. Default
# is 14. If an other number of steps is used, tpb needs write access to the
# nvram device.
#
#MIXERSTEPS 14
## MIXERDEVICE
# Defines the mixer device to use for OSS mixer support. Default is /dev/mixer.
#
#MIXERDEVICE /dev/mixer
### POWERMANAGEMENT SETTINGS
## APM
# Some ThinkPads generate mouse and keyboard events or have a high CPU load when
# polling /proc/apm. You may enable this, if you want the AC connected/AC
# disconnected messages. Default is off.
#
#APM OFF
## POWERMGT
# The program apmiser (part of tpctl package) switches the power management
# mode according to the needs of the user. This results in lots of changes
# displayed in OSD. To avoid this, the power management messages can be turned
# off. Default is auto.
#
#POWERMGT AUTO
### X11 SETTINGS
## XEVENTS
# Some of the special keys generate X11 events instead of changing the nvram. TPB
# is able to grab those keys and run an application. However some people like to
# use the X11 events through xmodmap or the like. This option turns off the
# grabbing of the events. Affected keys are HOME, SEARCH, MAIL, FAVORITES,
# RELOAD, ABORT, BACKWARD, FORWARD and FN. Default is on.
#
#XEVENTS OFF
### ON-SCREEN DISPLAY SETTINGS
## OSD
# Global switch for showing on-screen display for volume, mute and brightness.
# Possible values are on and off. Default is on.
#
#OSD ON
## OSDZOOM
# Specific switch for showing on-screen display for zoom button.
# Possible values are on and off. Default is unset, follows the OSD option.
#
#OSDZOOM OFF
## OSDTHINKLIGHT
# Specific switch for showing on-screen display for thinklight button.
# Possible values are on and off. Default is unset, follows the OSD option.
#
#OSDTHINKLIGHT OFF
## OSDDISPLAY
# Specific switch for showing on-screen display for display output button.
# Possible values are on and off. Default is unset, follows the OSD option.
#
#OSDDISPLAY OFF
## OSDHVEXPANSIOFF
# Specific switch for showing on-screen display for HV expansion button.
# Possible values are on and off. Default is unset, follows the OSD option.
#
#OSDHVEXPANSION OFF
## OSDBRIGHTNESS
# Specific switch for showing on-screen display for brightness buttons.
# Possible values are on and off. Default is unset, follows the OSD option.
#
#OSDBRIGHTNESS OFF
## OSDVOLUME
# Specific switch for showing on-screen display for ivolume and mute buttons.
# Possible values are on and off. Default is unset, follows the OSD option.
#
#OSDVOLUME OFF
## OSDPOWERMGT
# Specific switch for showing on-screen display for ipower management changes.
# Possible values are on and off. Default is unset, follows the OSD option.
#
#OSDPOWERMGT OFF
## OSDFONT
# Defines the font for the on-screen display. You may use "xfontsel" to choose
# one. Default is the default font of the xosd library.
#
#OSDFONT -*-lucidatypewriter-*-*-*-*-*-240-*-*-*-*-*-*
OSDFONT -adobe-helvetica-*-r-*-*-12-*-*-*-*-*-iso10646-1
## OSDCOLOR
# Defines the color of the on-screen display. You may use "xcolors" to choose
# one. Default is BLUE.
#
OSDCOLOR Blue
## OSDTIMEOUT
# Defines how long (in seconds) the on-screen display is shown after the last
# keys was pressed. Default is 3.
#
#OSDTIMEOUT 3
## OSDOFFSET
# For backward compatibility. Same as OSDVERTICAL.
#
OSDOFFSET 25
## OSDSHADOW
# Defines the offset of the font shadow in pixels. Default is 2.
#
OSDSHADOW 0
## OSDSHADOWCOLOR
# Defines the color of the shadow of the on-screen display. You may use
# "xcolors" to choose one. Default is BLACK.
#
#OSDSHADOWCOLOR BLACK
## OSDOUTLINE
# Defines the width of the font outline in pixels. Default is 1.
#
OSDOUTLINE 0
## OSDOUTLINECOLOR
# Defines the color of the outline of the on-screen display. You may use
# "xcolors" to choose one. Default is BLACK.
#
#OSDOUTLINECOLOR BLACK
## OSDVERTICAL
# Defines the offset from the top or bottom of the screen in pixels. Default is 25.
#
OSDVERTICAL 50
## OSDHORIZONTAL
# Defines the offset from the left or right of the screen in pixels. Only
# supported by xosd 2.0.0 and above. Default is 25.
#
OSDHORIZONTAL 100
## OSDPOS
# Defines where the osd is shown. Possible values are top, middle and bottom.
# The value middle is only supported by xosd 2.0.0 and above. Default is bottom.
#
OSDPOS bottom
## OSDALIGN
# Defines the alignment of the osd. Possible values are left, center and right.
# Default is left.
#
#OSDALIGN LEFT
7、注意事项
i、如果使用gnome,需取消gnome快捷键的设置,否则会出现休眠待机两次的情况,具体处理如下:
在你使用的用户下执行gconf-editor,将如下两项的键值设为nothing
代码:
/apps/gnome-power-manager/button/hibernate
/apps/gnome-power-manager/button/suspend
9、Shift+NumLk:数字键盘切换
建立~/.xmodmaprc文件
代码:
clear mod2
keycode 77 = Num_Lock
add mod2 = Num_Lock
执行# xmodmap ~/.xmodmaprc,然后按Shift+NumLk数字灯会亮,实现小数字键盘功能
要实现每次重启后自动生效,在~/.xintirc中添加:
代码:
xmodmap ~/.xmodmaprc