https://wiki.archlinux.org/api.php?action=feedcontributions&user=Landhar&feedformat=atomArchWiki - User contributions [en]2024-03-29T06:59:43ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Pm-utils&diff=121992Pm-utils2010-11-22T16:03:33Z<p>Landhar: </p>
<hr />
<div>[[Category:Power management (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|pm-utils}} {{DISPLAYTITLE:pm-utils}}<br />
<br />
'''pm-utils''' is the new suspend and powerstate setting framework. It is designed to replace such scripts as those provided by the <tt>powersave</tt> package.<br />
<br />
It is usually used by HAL to execute the various hacks needed to work around bugs in drivers and subsystems that are not yet aware of suspend. It is easily extensible by putting custom hooks into a directory, which can either be done by the system administrator or those hooks can be part of a package, especially if this package needs special attention during a system suspend or power state transition.<br />
<br />
A lesser known feature is one that mimmicks toggling done by [[Laptop Mode Tools]].<br />
<br />
Used in conjunction with the [[cpufrequtils]] package, notebook (and desktop) owners are provided with a complete power management suite.<br />
<br />
== Installation ==<br />
<br />
The <tt>pm-utils</tt> package is now available from the [http://www.archlinux.org/packages/search/?q=pm-utils Extra] repository:<br />
# pacman -S pm-utils<br />
<br />
{{note|If you run into issues when resuming video, it might be necessary to also sync <tt>vbetool</tt> from [extra].}}<br />
<br />
{{note|If you are starting from a clean install, make sure that you have <tt>acpi</tt> installed.}}<br />
<br />
== Basic Configuration ==<br />
=== Hibernation (suspend2disk) ===<br />
In order for suspend2disk (hibernate) to work, we need to edit ''/boot/grub/menu.lst'' as root and add '''resume=/path/to/swap/drive''' (e.g. /dev/sda2) to the kernel options, for example:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 '''resume=/dev/sda2''' ro vga=0<br />
initrd /kernel26.img<br />
<br />
Raid swap example:<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/md2 resume=/dev/md0 ro md=0,/dev/sda2,/dev/sdb2 md=2,/dev/sda5,/dev/sdb5 vga=773<br />
initrd /kernel26.img<br />
<br />
If you want to use the UUID of the device instead then use the following example. The UUID itself can by find out by using the blkid command as root.<br />
# (0) Arch Linux<br />
title Arch Linux<br />
root (hd0,0)<br />
kernel /vmlinuz26 cryptdevice=/dev/sda2:main root=/dev/mapper/main-root resume=/dev/disk/by-uuid/1d893194-b151-43cd-a89e-6f89bd8b9f99 ro<br />
initrd /kernel26.img<br />
<br />
<br />
When the machine is placed into hibernation, it will now move all data from RAM to the swap partition... you ''did'' make your swap partition large enough to hold your RAM data, right?<br />
<br />
Even if your swap partition is smaller than RAM, you still have a big chance in hibernating successfully. According to [http://www.mjmwired.net/kernel/Documentation/power/interface.txt kernel documentation], ''/sys/power/image_size controls the size of the image created by the suspend-to-disk mechanism'', which has a default value of 500M. ''The suspend-to-disk mechanism will do its best to ensure the image size will not exceed that number.'' You may either decrease it due to a small swap partition or increase it in purpose of possible hibernation speed up.<br />
<br />
'''Note: you may have to add the resume hook to mkinitcpio, see [[Pm-utils#Resume_Hook|below]]'''<br />
<br />
=== Suspend/Hibernate as regular user ===<br />
<br />
Three methods are available to suspend without the need for a root password: using HAL, using UPower, and giving the user permissions with visudo.<br />
<br />
==== UPower method ====<br />
<br />
To suspend to RAM:<br />
<br />
<pre><br />
$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" \<br />
/org/freedesktop/UPower org.freedesktop.UPower.Suspend<br />
</pre><br />
<br />
To suspend to disk (hibernate):<br />
<br />
<pre><br />
$ dbus-send --system --print-reply --dest="org.freedesktop.UPower" \<br />
/org/freedesktop/UPower org.freedesktop.UPower.Hibernate<br />
</pre><br />
<br />
==== HAL Method ====<br />
<br />
HAL can be invoked as regular user to suspend by:<br />
<br />
<pre>$ dbus-send --system --print-reply --dest=org.freedesktop.Hal \<br />
/org/freedesktop/Hal/devices/computer \<br />
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0</pre><br />
<br />
and Hibernate by:<br />
<br />
<pre>$ dbus-send --system --print-reply --dest=org.freedesktop.Hal \<br />
/org/freedesktop/Hal/devices/computer \<br />
org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate</pre><br />
<br />
==== User Permission Method ====<br />
<br />
Because the <tt>pm-utils</tt> scripts must be run as root, you may want to make the scripts accessible to normal users by running sudo without the root password. To do so, edit the {{Filename|/etc/sudoers}} file with {{Codeline|visudo}}, for example:<br />
<br />
# visudo<br />
<br />
add the following lines, replacing ''username'' with your own:<br />
<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''username'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
save and exit visudo<br />
<br />
Or you can enable it for a group, using the following lines, of course replacing ''group'':<br />
<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-hibernate<br />
''%group'' ALL = NOPASSWD: /usr/sbin/pm-suspend<br />
<br />
Note: These must come after any user privilege specifications, e.g., "username ALL=(ALL) ALL", or they won't work.<br />
<br />
You can now run the scripts without a password by simply typing:<br />
<br />
$ sudo pm-hibernate<br />
<br />
or <br />
<br />
$ sudo pm-suspend<br />
<br />
Also, add yourself to the ''power'' group so that way using things like applets to do suspend will work. If you do not do this, when you try to use suspend though things like the gnome shutdown applet to suspend/hibernate your computer will just play a very annoying loud triple beep and lock the screen.<br />
<br />
# gpasswd -a ''username'' power<br />
<br />
You should now be able to use gnome power management tools (and kpowersave?) to automatically suspend/hibernate when doing things like closing the laptop lid, running low on battery power etc...<br />
<br />
=== Power Management ===<br />
Write a custom [[acpid]] event:<br />
{{File|name=/etc/acpi/events/ac|content=<br />
event=ac_adapter.*<br />
action=/etc/acpi/actions/ac.sh %e<br />
}}<br />
<br />
Write a custom acpid action:<br />
{{File|name=/etc/acpi/actions/ac.sh|content=<br />
#!/bin/sh<br />
case "$4" in<br />
*0) /usr/sbin/pm-powersave true;;<br />
*1) /usr/sbin/pm-powersave false;;<br />
esac<br />
}}<br />
<br />
Be sure not to install {{Package Official|laptop-mode-tools}} since the rules may conflict.<br />
<br />
== Advanced Configuration ==<br />
The main configuration file is '''<tt>/usr/lib/pm-utils/defaults</tt>'''. You ''should not edit this file'', since after a package update it might be overwritten with the default settings. Put your config file into '''<tt>/etc/pm/config.d/</tt>''' instead.<br />
You can just put a simple text file with<br />
SUSPEND_MODULES="button uhci_hcd"<br />
named "modules" or "config" into <tt>/etc/pm/config.d</tt> and it will override the settings in the system wide configuration file.<br />
<br />
=== Available Variables for use in config files ===<br />
SUSPEND_MODULES="button" # the list of modules to be unloaded before suspend<br />
SLEEP_MODULE="tuxonice uswsusp kernel" # The default sleep/wake systems to try<br />
HIBERNATE_MODE="shutdown" # forces the system to shutdown rather than reboot<br />
<br />
=== Disabling a hook ===<br />
If a hook is run which you do not like or which you think is not useful or even harmful, we'd appreciate a bugreport for that.<br />
You can however easily disable hooks by just creating an empty file corresponding to the hook in <tt>/etc/pm/sleep.d/</tt>. Say you want to disable the hook <tt>/usr/lib/pm-utils/sleep.d/45pcmcia</tt>, you can do this easily by calling<br />
# touch /etc/pm/sleep.d/45pcmcia<br />
Do not set the executable bit on that dummy-hook.<br />
<br />
=== Creating your own hooks ===<br />
If you want to do something specific to your setup during suspend / hibernate, then you can easily put your own hook into <tt>/etc/pm/sleep.d</tt>. The hooks in this directory will be called in alphabetic order during suspend (that's the reason their names all start with 2 digits, to make the ordering explicit) and in the reverse order during resume.<br />
<br />
I'm showing a pretty useless demonstration hook here, that will just put some informative lines into your logfile:<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
echo "Hey guy, we are going to suspend to disk!"<br />
;;<br />
suspend)<br />
echo "Oh, this time we're doing a suspend to RAM. Cool!"<br />
;;<br />
thaw)<br />
echo "oh, suspend to disk is over, we are resuming..."<br />
;;<br />
resume)<br />
echo "hey, the suspend to RAM seems to be over..."<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
Put this into /etc/pm/sleep.d/66dummy, do a <tt>chmod +x /etc/pm/sleep.d/66dummy</tt> and it will spew some useless lines during suspend / resume.<br />
<br />
'''''Warning:''' All the hooks run as user root. This means that you need to be careful when creating temporary files, check that the PATH variable is set correctly etc. to avoid security problems.''<br />
<br />
== How it Works ==<br />
The concept is quite easy: the main script (<tt>pm-action</tt>, called via symlinks as either <tt>pm-suspend</tt>, <tt>pm-hibernate</tt> or <tt>pm-suspend-hybrid</tt>) executes so-called "hooks", executable scripts, in the alphabetical sorted order with the parameter <tt>suspend</tt> (suspend to RAM) or <tt>hibernate</tt> (suspend to disk).<br />
Once all hooks are done, it puts the machine to sleep. After the machine has woken up again, all those hooks are executed in reverse order with the parameter <tt>resume</tt> (resume from RAM) or <tt>thaw</tt> (resume from disk).<br />
The hooks do various stuff, for example preparing the bootloader, stopping the bluetooth subsystem or unloading of critical modules.<br />
<br />
Both pm-suspend and pm-hibernate are usually called from HAL, initiated by desktop applets as gnome-power-manager or kpowersave.<br />
<br />
{{Box Note|<tt>suspend-hybrid</tt> is a placeholder right now, it is not completely implemented.}}<br />
<br />
There is also the possibility to set the machine into high-power and low-power mode, the command <tt>pm-powersave</tt> is used with an additional parameter of <tt>true</tt> or <tt>false</tt>. It works basically the same as the suspend framework.<br />
<br />
The hooks for suspend are placed in<br />
* <tt>/usr/lib/pm-utils/sleep.d</tt> (distribution / package provided hooks)<br />
* <tt>/etc/pm/sleep.d</tt> (hooks added by the system administrator)<br />
<br />
The hooks for the power state are placed in <br />
* <tt>/usr/lib/pm-utils/power.d</tt> (distribution / package provided hooks)<br />
* <tt>/etc/pm/power.d</tt> (hooks added by the system administrator)<br />
<br />
Hooks in <tt>/etc/pm/</tt> take precedence over those in <tt>/usr/lib/pm-utils/</tt>, so the system administrator can override the defaults provided by the distribution.<br />
<br />
== Troubleshooting ==<br />
If suspend or hibernate did not work correctly, you will probably find some information in the logfile '''<tt>/var/log/pm-suspend.log</tt>''', for example which hooks were run and what the output of them was.<br />
<br />
=== Resume Hook ===<br />
<br />
It has been suggested that some systems, including those using [[LVM]], require the <tt>resume</tt> hook be added to the initrd image, otherwise the kernel will '''not''' resume. To do so, edit <tt>/etc/mkinitcpio.conf</tt> as root and add <tt>resume</tt> to the HOOKS array:<br />
HOOKS="base udev autodetect ide scsi sata lvm2 '''''resume''''' filesystems "<br />
<br />
Note that this is an example, and your HOOKS array may look different.<br />
<br />
<tt>resume</tt> must be placed ''after'' 'ide', 'scsi', 'sata' and/or 'lvm2', but before 'filesystems'. Of course there has to be an appropriate 'resume' file in /lib/initcpio/hooks, it should already be there, as it is part of the package 'mkinitcpio'.<br />
<br />
Finally, you must rebuild the initrd image for these changes to take effect:<br />
<br />
# mkinitcpio -p kernel26<br />
<br />
{{Box Note|If you use a custom kernel then you might have to change the value of the '-p' option.}}<br />
<br />
=== Set UUID === <br />
<br />
If you experience segmentation faults that might result in an unresponsive system and missing keys then try to set the UUID in the resume-path in '''/boot/grub/menu.lst''' as explained [[http://wiki.archlinux.org/index.php/Pm-utils#Hibernation_.28suspend2disk.29 above]].<br />
<br />
== Tips and Tricks / FAQ ==<br />
=== Triggering suspend manually ===<br />
If you want to trigger suspend manually for debugging, without using HAL and other frameworks, call '''<tt>pm-suspend</tt>''' or '''<tt>pm-hibernate</tt>''' as root.<br />
=== Automatically deactivate kwin compositing before suspend===<br />
<br />
at the moment pm-suspend fails to resume with garbled screen when you resume from suspend with active AIGLX clients, such as kwin compositing (only ati-catalyst?).<br />
To automatically deactivate kwin compositing add a new hook under /etc/pm/sleep.d/00togglecompositing with this content:<br />
<br />
#!/bin/bash<br />
USER=`finger|grep '*:0'|grep -o '^\w*'`<br />
DBUS_SESSION_BUS_ADDRESS=`grep -o 'DBUS_SESSION_BUS_ADDRESS=.*' /home/$USER/.dbus/session-bus/*|sed s/DBUS_SESSION_BUS_ADDRESS=//`<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
if `sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin compositingActive`;<br />
then<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
sleep 1<br />
fi<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
sudo -u $USER -i DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS qdbus org.kde.kwin /KWin toggleCompositing;<br />
;;<br />
*) echo "somebody is calling me totally wrong."<br />
;;<br />
esac<br />
<br />
I don't know if it's very secure or if it can be done simpler. Feel free to add better versions.<br />
<br />
If you are having trouble getting the above script to work, you can try my version. This version removes the use of finger, and fixes the DBUS_SESSION_BUS_ADDRESS resolution which did not work for me (though my solution is admittedly quite dirty). Simply replace the first three lines with:<br />
<br />
#!/bin/bash<br />
USER=`who | grep ':0' | grep -o '^\w*' | head -n1`<br />
. /home/$USER/.dbus/session-bus/*<br />
<br />
=== Using another sleep backend (like uswsusp) ===<br />
Create a file with a SLEEP_MODULE variable, like this:<br />
$ cat /etc/pm/config.d/module <br />
SLEEP_MODULE=uswsusp<br />
I don't know but you may have to <code>chmod +x</code> it. To list available modules, use:<br />
$ pacman -Ql pm-utils | grep module.d<br />
<br />
=== Having the hd power management level automatically set again on resume ===<br />
Do it like this:<br />
$ cat /etc/pm/sleep.d/50-hdparm_pm <br />
#!/bin/dash<br />
<br />
if [ -n "$1" ] && ([ "$1" = "resume" ] || [ "$1" = "thaw" ]); then<br />
hdparm -B 254 /dev/sda > /dev/null<br />
fi<br />
<br />
=== Restarting the mouse ===<br />
On some laptops the mouse will hang after an otherwise successful suspend. One way to remedy this is to force a reinit of the PS/2 driver (here <tt>i8042</tt>) through a hook in <tt>/etc/pm/hooks</tt> (see [[#Creating_your_own_hooks|hooks]])<br />
<br />
#!/bin/sh <br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/unbind<br />
echo -n "i8042" > /sys/bus/platform/drivers/i8042/bind<br />
<br />
=== It seems to not do anything / where is the logfile ===<br />
If it seem to not do anything when called via the desktop applets, then try to call <tt>pm-suspend</tt> or <tt>pm-hibernate</tt> [[#Triggering_suspend_manually|manually from a root shell in a terminal]]. Maybe you'll already get some output that will point you to the problem.<br />
The suspend scripts also write a [[#Troubleshooting|logfile at '''<tt>/var/log/pm-suspend.log</tt>''']].<br />
<br />
=== Add sleep modes to Openbox menu ===<br />
Openbox users can add the new scripts as additional shutdown options within the Openbox menu by adding the items to a new or existing sub-menu in <tt>~/.config/openbox/menu.xml</tt>, for example:<br />
<menu id="64" label="Shutdown"><br />
<item label="Lock"> <action name="Execute"> <execute>xscreensaver-command -lock</execute> </action> </item><br />
<item label="Logout"> <action name="Exit"/> </item><br />
<item label="Reboot"> <action name="Execute"> <execute>sudo shutdown -r now</execute> </action> </item><br />
<item label="Poweroff"> <action name="Execute"> <execute>sudo shutdown -h now </execute> </action> </item><br />
'''''<item label="Hibernate"> <action name="Execute"> <execute>sudo pm-hibernate</execute> </action> </item>'''''<br />
'''''<item label="Suspend"> <action name="Execute"> <execute>sudo pm-suspend</execute> </action> </item>'''''<br />
</menu><br />
<br />
=== Blank screen issue ===<br />
Some users have reported having issues with their laptops not resuming after a suspend or hibernate. This is due to the autodetect HOOK. This can be disabled using the same method for adding the resume HOOK. Just remove autodetect from the list and follow the steps to build the new image. See [http://wiki.archlinux.org/index.php/Pm-utils#Resume_Hook Resume Hook] for more details on building the new image.<br />
<br />
=== Handling "sleep" and "power" buttons ===<br />
"Sleep" and "power" buttons are handled by acpid in /etc/acpi/handler.sh (see "button/power" and "power/sleep" entries). You may want to substitute the default actions with calls to pm-suspend and pm-hibernate.<br />
<br />
=== [[HAL]] will not recognize new devices on resume ===<br />
With the 2.6.30 kernel, HAL will on some systems bug on resume, not recognizing new USB devices. Adding the following bash script with a name like "02hal" to /etc/pm/sleep.d works around the problem by stopping HAL and starting it again after resuming.<br />
<br />
#!/bin/bash<br />
case $1 in<br />
hibernate)<br />
;;<br />
suspend)<br />
/etc/rc.d/hal stop<br />
;;<br />
thaw)<br />
;;<br />
resume)<br />
/etc/rc.d/hal start<br />
;;<br />
*)<br />
;;<br />
esac<br />
<br />
Remember to mark it executable with "chmod +x 02hal".<br />
<br />
== Other Resources ==<br />
* [https://wiki.ubuntu.com/UnderstandingSuspend Understanding Suspend] - Ubuntu article explaining how suspend-to-ram works<br />
*[[Cpufrequtils]] - CPU Frequency Scaling and CPU Power schemes<br/><br />
*[[SpeedStep]] - More information on CPU frequency scaling (some of which is obsolete)<br/><br />
*[[Acpid]] - daemon for delivering ACPI events.<br />
<br />
== Credits ==<br />
''This wiki entry was originally sourced from the [http://en.opensuse.org/Pm-utils OpenSUSE Wiki] (Licensed under GPL). A big thank you goes to the <tt>pm-utils</tt> developers and documenters for their time.''</div>Landharhttps://wiki.archlinux.org/index.php?title=Tomcat_and_Apache&diff=106800Tomcat and Apache2010-05-21T13:20:58Z<p>Landhar: /* Configure Apache */</p>
<hr />
<div>[[Category:Networking (English)]][[Category:HOWTOs (English)]]<br />
<br />
== Introduction ==<br />
This document describes the steps needed to install Apache Tomcat. It also optionally describes how to integrate Tomcat with the Apache Web Server, and how to configure MySQL to work with Tomcat Servlets and JSPs.<br />
<br />
== Installation ==<br />
Install and configure Apache as in the [[Apache, PHP, and MySQL]] tutorial. You may install PHP and MySQL at this time if you want them.<br />
<br />
Then install Tomcat:<br />
# pacman -Sy tomcat<br />
<br />
== Configuring Tomcat ==<br />
Edit <code>/etc/conf.d/tomcat</code>. Change CATALINA_USER to some user that suites your system (like "nobody")<br />
modprobe capability<br />
Now add capabilities to modules in <code>/etc/rc.conf</code>.<br />
<br />
Also you may have to edit <code>/etc/rc.d/tomcat</code> to change the java home for jsvc. In the "start" section<br />
you have change this line:<br />
-home /usr/lib/jvm/java-1.6.0-openjdk \<br />
with this one (assuming that <code>/opt/java</code> is your JAVA_HOME):<br />
-home /opt/java \<br />
<br />
== Test Tomcat ==<br />
Run in terminal (as root):<br />
# /etc/rc.d/tomcat start<br />
Notice that you can check the logs in <code>/opt/tomcat/logs/catalina.log</code>.<br />
<br />
Tomcat should be running. Test by visiting http://localhost:8080/ in a web browser. You can browse the JSP and servlet examples if you like.<br />
<br />
This is all that is needed to run Tomcat as a stand-alone server. You can add new webapp directories to the <code>/opt/tomcat/webapps</code> directory. Optionally, if you want to place webapps in a different directory, you can make <code>/opt/tomcat/webapps/</code> a symbolic link to another directory. For example, if you wanted to place your web applications in <code>/home/httpd/tomcat</code> run these commands (as root):<br />
# cd /opt/tomcat<br />
# mv webapps /home/httpd/tomcat<br />
# ln -s /home/httpd/tomcat/webapps webapps<br />
<br />
You can also place symbolic links within the webapps directory.<br />
<br />
If you wish tomcat to start on bootup: <br><br />
Edit <code>/opt/tomcat/bin/catalina.sh</code> and add this line at the top:<br />
JAVA_HOME=/opt/java<br />
<br />
This is needed because JAVA_HOME is not set when the daemons are started <br><br />
Edit <code>/etc/rc.conf</code>:<br />
DAEMONS=(some daemons now add tomcat)<br />
<br />
'''Or''' add this line to <code>rc.local</code>:<br />
/etc/rc.d/tomcat start<br />
<br />
== Configure Apache ==<br />
<br />
=== Without mod_jk ===<br />
<br />
If you have mod_proxy installed (default since Apache 2.0) you only need to include two directives in your httpd.conf file for each web application that you wish to forward to Tomcat 5. For example, to forward an application at context path /myapp: <br />
<br />
ProxyPass /myapp http://localhost:8080/myapp<br />
ProxyPassReverse /myapp http://localhost:8080/myapp<br />
<br />
'''Note''': starting from Apache 2.2 included mod_proxy supports the AJP protocol and so it's a viable alternative to mod_jk (this package). It's far easier to configure in httpd.conf or inside a <VirtualHost>:<br />
<br />
ProxyPass / ajp://127.0.0.1:8009/APPNAME<br />
ProxyPassReverse / ajp://127.0.0.1:8009/APPNAME<br />
<br />
Instead of / you can map APPNAME to an arbitrary web path. mod_jk (described below) should be used only if its advanced features are needed.<br />
<br />
=== Using mod_jk ===<br />
<br />
There are two ways to install mod_jk: from [http://aur.archlinux.org/packages.php?ID=3362 AUR] or from [http://tomcat.apache.org/download-connectors.cgi?Preferred=http%3A%2F%2Fapache.multidist.com upstream]. In the latter case you should copy it to the directory <code>/usr/lib/httpd/modules/</code>. Then rename the file to <code>mod_jk.so</code> and set it executable with<br />
<br />
# chmod a+x mod_jk.so<br />
<br />
Edit <code>/etc/httpd/conf/httpd.conf</code><br><br />
Add this line to the end of the LoadModule section:<br />
LoadModule jk_module modules/mod_jk.so<br />
<br />
Add these lines below the LoadModule section:<br />
<br />
<IfModule jk_module><br />
JkWorkersFile /etc/httpd/conf/workers.properties<br />
JkShmFile /var/run/shm.file<br />
JkShmSize 1048576<br />
</IfModule><br />
<br />
Create the file <code>/etc/httpd/conf/workers.properties</code>. It should contain the following:<br />
# Define some properties<br />
workers.apache_log=/var/log/httpd/<br />
workers.tomcat_home=/opt/tomcat<br />
workers.java_home=/opt/java<br />
ps=/<br />
worker.list=worker2<br />
# Define worker's properties<br />
worker.worker2.type=ajp13<br />
worker.worker2.host=localhost<br />
worker.worker2.port=8009<br />
worker.worker2.mount=/jsp-examples /jsp-examples/*<br />
<br />
Start Apache. Run in terminal (as root):<br />
# /etc/rc.d/httpd start<br />
<br />
Only run httpd after tomcat is started (EDIT: I'm not sure if this is true, I can restart & start tomcat and apache seperatly from eachother, I will just get a 'Service unavailable' in Apache if I request a .jsp while tomcat is restarting..)<br />
<br />
Visit http://localhost/jsp-examples The Tomcat JSP examples should be visible.<br />
<br />
If you want to have URLs other than examples map to tomcat, modify the .mount attribute like<br />
worker.worker2.mount=/jsp-examples /jsp-examples/* /someapp /someapp/* <br />
to your <code>workers.properties</code> file. The <code>someapp</code> will map http://localhost/someapp/ to <code>/opt/tomcat/webapps/someapp/</code> as interpretted by tomcat. There are more complex workers.properties configurations; search the website for more info. http://tomcat.apache.org/connectors-doc/reference/workers.html<br />
<br />
== Configure MySQL ==<br />
Do this section only if you want to connect to MySQL from within Tomcat or the Java environment in general.<br />
<br />
Review the MySQL documentation and download the driver. 3.0 is a good choice: http://www.mysql.com/products/connector-j/<br />
<br />
Untar the driver and copy =mysql-connector-java-3.0.11-stable-bin.jar into /opt/java/jre/lib/ext<br />
tar xfvz mysql-connector-java-3.0.11-stable.tar.gz<br />
cp mysql-connector-java-3.0.11-stable/mysql-connector-java-3.0.11-stable-bin.jar /opt/java/jre/lib/ext<br />
<br />
Start MySQL if it isn't already running (as root):<br />
# /etc/rc.d/mysqld start<br />
<br />
Test that the driver can be loaded: <br><br />
Save this as <code>~TestMysql.java</code><br />
<pre><br />
public class TestMysql {<br />
public static void main(String[] args) {<br />
try {<br />
Class.forName("com.mysql.jdbc.Driver").newInstance();<br />
} catch (Exception e) {<br />
System.out.println("The driver couldn't be loaded");<br />
return;<br />
}<br />
System.out.println("The driver was loaded");<br />
}<br />
}<br />
</pre><br />
<br />
Compile the file:<br />
$ javac TestMysql.java<br />
Run the file<br />
$ java -classpath :/opt/java/jre/lib/ext TestMysql<br />
<br />
It will output "The driver was loaded" if the driver is available, otherwise "The driver couldn't be loaded"<br />
<br />
You should be able to use the driver using DriverManager.getConnection() in Java programs now. It should also automatically be available to Tomcat servlets and JSPs. See The Mysql Connector/J documentation for more information.</div>Landharhttps://wiki.archlinux.org/index.php?title=Lenovo_ThinkPad_T400&diff=103101Lenovo ThinkPad T4002010-04-13T14:56:28Z<p>Landhar: /* Realtek chipset */</p>
<hr />
<div>[[Category:Lenovo (English)]]<br />
=System Sepcification=<br />
*CPU : Intel® Core™2 Duo Processor T9400 (6M Cache, 2.53 GHz, 1066 MHz FSB)<br />
*Memory : 3GB PC3-8500 DDR3<br />
*WiFi : Intel WiFi Link 5300<br />
*Hard-Drive : 160GB, 7200rpm<br />
*Optical Drive : DVD Recordable<br />
*Integrated Graphics : Intel 4500MHD<br />
*Discrete Graphics : AMD M82XT Hybrid 256 MB (ATI Mobility Radeon HD 3470)<br />
*Screen : 14.1" WXGA+ TFT with LED Backlit<br />
*Gigabit Ethernet, Modem<br />
*Express Card & PC Card Slots<br />
*Integrated Bluetooth PAN<br />
*No camera<br />
*No fingerprint reader<br />
*No Intel Turbo Memory<br />
<br />
=Network=<br />
==Ethernet Card==<br />
The kernel module to get the network card to work is '''e1000e'''. I had no problem getting it to work.<br />
<br />
==Wireless==<br />
Lenovo offers different options in paragraph wireless hardware:<br />
<br />
===Intel chipset===<br />
*Wifi link 5100 and 5300<br />
<br />
The drivers are included in the 2.6.27 kernel. However, it's important to make sure that you have the correct firmware. I installed the iwlwifi-5000-ucode. See [[Wireless#iwl3945.2C_iwl4965_and_iwl5000-series|this section]] for more details.<br />
<br />
===Realtek chipset===<br />
<br />
*Rtl8192SE<br />
11b/g/n Wireless Lan Mini-PCI Express Adapter II<br />
03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device 8172 (rev 10)<br />
<br />
See http://www.thinkwiki.org/wiki/ThinkPad_11b/g/n_Wireless_LAN_Mini-PCI_Express_Adapter_II for more details.<br />
<br />
'''Realtek r8192se_pci Driver'''<br />
<br />
Finally came the expected driver (alpha? beta?), I think it's premature but it works perfectly.<br />
<br />
Here the driver (r8192se_pci):<br />
32 bits: http://launchpadlibrarian.net/33927923/rtl8192se_linux_2.6.0010.1012.2009.tar.gz<br />
64 bits: http://launchpadlibrarian.net/34090326/rtl8192se_linux_2.6.0010.1012.2009_64bit.tar.gz<br />
<br />
untar; make; make install; reboot and enjoy it<br />
<br />
I test it with:<br />
*netcfg<br />
*standar commands:<br />
ifconfig wlan0 up<br />
iwlist wlan0 scan<br />
iwconfig wlan0 essid MySsid<br />
wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf<br />
dhcpcd wlan0<br />
<br />
There is also a package available in the AUR: http://aur.archlinux.org/packages.php?ID=34281<br />
<br />
'''Ndiswrapper option:'''<br />
If you have a 32-bit version of arch, it should be possible to get it working with ndiswrapper: <br />
<br />
*Download this .exe file: http://www.station-drivers.com/telechargement/realtek/wifi/rtl-8191se_1080.7.0520%28www.station-drivers.com%29.exe<br />
*Install the '''extra/p7zip''' package and use the included utility '''7z''' to extract the contents of the .exe:<br />
<br />
7z x rtl-8191se_1080.7.0520(www.station-drivers.com).exe<br />
<br />
*Copy the files '''net8192se.inf''' and '''rtl8192se.sys''' from the '''91_92_SE_Driver/Win2K''' directory to a location of your choosing.<br />
*Proceed with the [[Wireless_Setup#ndiswrapper|normal ndiswrapper installation procedure]].<br />
<br />
Unfortunately, if you are running a 64-bit version of arch then it seems you are '''out of luck''' currently; the WinX64 drivers included in the above package do not work.<br />
<br />
For more information, see http://ubuntuforums.org/showthread.php?t=1182457 and http://forums.lenovo.com/lnv/board/message?board.id=Special_Interest_Linux&message.id=1196 .<br />
<br />
==Modem==<br />
There is a module "hsfmodem" provided by http://www.linuxant.com/.<br />
<br />
=Graphics/Xorg Configuration=<br />
Note that it's not possible to switch the graphics adapter without restarting X. First of enable Integrated, Discrete or both graphics cards in your BIOS. This setting is under "Config->Display". If you choose both/switchable you must set the "BusID"-tag for each card in yor "xorg.conf" (see [[#Hotplugging]]).<br />
<br />
Note that I enabled the '''testing''' repository, which gave me access to :<br />
*xorg-server version 1.5.3<br />
*xf86-video-intel version 2.4.3<br />
*xf86-video-ati version 6.10.0<br />
*xf86-video-radeonhd 1.2.4<br />
*catalyst version 8.12<br />
<br />
==Integrated Graphics==<br />
After installing [[Xorg#Installing_Xorg|xorg]], I installed the [[Intel|xf86-video-intel drivers]]. As root, I then ran '''X -configure'''. The generated xorg.conf worked fine. I did apply the [[Intel#2D|2D]] and [[Intel#3D|3D]] optimization, and performances in compositing window managers (like compiz or kwin) seem to have increased. I have not made any scientific measurements though.<br />
<br />
'''Note : '''Some people have encountered problems with 3D on 2.6.28 kernels and xf86-video-intel version 2.4.3. <br />
<br />
The following xorg.conf file was tested on a T400 with an integrated card with the 1280x800 resolution provided by the default Intel Integrated Intel GMA 4500MHD (I included the Input devices for reference)<br />
<br />
Section "InputDevice"<br />
Identifier "Generic Keyboard"<br />
Driver "kbd"<br />
Option "XkbRules" "xorg"<br />
Option "XkbModel" "pc104"<br />
Option "XkbLayout" "us"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Configured Mouse"<br />
Driver "mouse"<br />
Option "SendCoreEvents"<br />
Option "Device" "/dev/input/mice"<br />
Option "Emulate3Buttons" "true"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Synaptics Touchpad"<br />
Driver "synaptics"<br />
Option "CorePointer"<br />
Option "Device" "/dev/psaux"<br />
Option "Protocol" "auto-dev"<br />
Option "Emulate3Buttons" "true"<br />
Option "HorizScrollDelta" "0"<br />
Option "Emulate3Buttons" "true"<br />
Option "LeftEdge" "1700"<br />
Option "RightEdge" "5300"<br />
Option "TopEdge" "1700"<br />
Option "BottomEdge" "4200"<br />
Option "FingerLow" "25"<br />
Option "FingerHigh" "30"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "220"<br />
Option "VertScrollDelta" "100"<br />
Option "MinSpeed" "0.06"<br />
Option "MaxSpeed" "0.10"<br />
Option "AccelFactor" "0.0010"<br />
#Option "SHMConfig" "1"<br />
Option "UpDownScrolling" "1"<br />
Option "CircularScrolling" "0"<br />
Option "LockedDrags" "0"<br />
Option "TouchpadOff" "0"<br />
#Option "Repeater" "/dev/ps2mouse"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "Configured Monitor"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "HDMI-1"<br />
Option "Ignore" "True"<br />
EndSection<br />
<br />
Section "Monitor"<br />
Identifier "HDMI-2"<br />
Option "Ignore" "True"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Configured Video Device"<br />
Driver "intel"<br />
Option "monitor-HDMI-1" "HDMI-1"<br />
Option "monitor-HDMI-2" "HDMI-2"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Default Screen"<br />
Monitor "Configured Monitor"<br />
Device "Configured Video Device"<br />
DefaultDepth 24<br />
SubSection "Display"<br />
Modes "1280x800"<br />
EndSubSection<br />
EndSection<br />
<br />
Section "ServerLayout"<br />
Identifier "Default Layout"<br />
Screen "Default Screen"<br />
InputDevice "Synaptics Touchpad"<br />
InputDevice "Configured Mouse"<br />
EndSection<br />
<br />
'''NB''' Installing extra/libdrm and forcing discrete graphics in the bios fixed hanging problems when X quit.<br />
<br />
Here is a minimal xorg.conf in which the Virtual screen size is specified, so that one enables support for dual monitor.<br />
<br />
Section "Monitor"<br />
Identifier "Configured Monitor"<br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Default Screen"<br />
Monitor "Configured Monitor"<br />
Device "Configured Video Device"<br />
SubSection "Display"<br />
Virtual 2464 1500<br />
EndSubSection<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Configured Video Device"<br />
EndSection<br />
<br />
==Discrete Graphics==<br />
All 3 ATI drivers worked. That is both [[ATI#Open-Source_ATI_Drivers|open-source drivers]] (<code>xf86-video-ati</code> and <code>xf86-video-radeonhd</code>) and [[ATI#ATI_Catalyst_proprietary_driver|fglrx]] (the <code>catalyst</code> proprietary drivers).<br />
<br />
I could not get the <code>xf86-video-radeonhd</code> drivers to detect my external monitor, but <code>xf86-video-ati</code> worked fine. Remember to remove <code>catalyst</code> and <code>catalyst-utils</code> before using an [[ATI#Open-Source_ATI_Drivers|open source ATI drivers]]. ATI uses its own OpenGL library in its proprietary drivers, which is included in <code>catalyst-utils</code> and conflicts with libgl. As it did with the integrated graphics, running '''X -configure''' generated a working xorg.conf.<br />
<br />
To get the [[ATI#ATI_Catalyst_proprietary_driver|catalyst drivers]] working, you do have to [[ATI#Configuration|configure]] your xorg.conf properly. I used '''aticonfig --initial''' to generate a working xorg.conf. I did encounter a problem that I have not been able to solve yet : resizing a window in a compositing window manager takes 1-2 seconds. This makes the drivers pretty much unusable.<br />
<br />
== Synaptic, UltraNav ==<br />
If you want to be able to use horizontal and vertical scroll with your touchpad add this lines to your xorg.conf<br />
<br />
Section "Module"<br />
......<br />
Load "synaptics"<br />
EndSection<br />
<br />
Section "InputDevice"<br />
Identifier "Touchpad"<br />
Driver "synaptics"<br />
Option "AlwaysCore"<br />
Option "Device" "/dev/input/mouse1"<br />
Option "Protocol" "auto-dev"<br />
Option "SendCoreEvents" "true"<br />
Option "LeftEdge" "1632"<br />
Option "RightEdge" "5312"<br />
Option "TopEdge" "1575"<br />
Option "BottomEdge" "4281"<br />
Option "FingerLow" "25"<br />
Option "FingerHigh" "30"<br />
Option "MaxTapTime" "180"<br />
Option "MaxTapMove" "220"<br />
Option "VertScrollDelta" "100"<br />
Option "MinSpeed" "0.06"<br />
Option "MaxSpeed" "0.12"<br />
Option "AccelFactor" "0.0010"<br />
Option "VertEdgeScroll" "on"<br />
Option "HorizEdgeScroll" "on"<br />
# Option HorizScrollDelta""0" <br />
Option "SHMConfig" "on"<br />
EndSection <br />
<br />
for trakpoint with third button paste & scroll add this few lines to xorg.conf too<br />
<br />
Section "InputDevice"<br />
Identifier "Trackpoint"<br />
Driver "mouse"<br />
Option "CorePointer"<br />
Option "Device" "/dev/input/mice"<br />
Option "Protocol" "Auto"<br />
Option "Emulate3Buttons"<br />
Option "Emulate3Timeout" "50"<br />
Option "EmulateWheel" "on"<br />
Option "EmulateWheelTimeout" "200" # adjust third button paste timeout. <br />
Option "EmulateWheelButton" "2"<br />
Option "YAxisMapping" "4 5"<br />
Option "XAxisMapping" "6 7"<br />
Option "YAxisMapping" "4 5"<br />
EndSection<br />
<br />
finally update your layout<br />
<br />
Section "ServerLayout"<br />
InputDevice "Trackpoint" "CorePointer"<br />
InputDevice "Touchpad"<br />
InputDevice "Keyboard0" "CoreKeyboard"<br />
EndSection<br />
<br />
==Hotplugging==<br />
If you want to enable [[Xorg_input_hotplugging|hotplugging]] you may end up with an xorg-file like the one just below.<br />
Notis that all the mouse/keyboard configuration is taken care of by [[HAL]]. Remeber to run:<br />
lspci | grep -i vga<br />
to find your PCI BusIDs<br />
<br />
Section "ServerLayout" <br />
Identifier "Xorg Configured" <br />
Screen 0 "Screen0" 0 0 <br />
EndSection <br />
<br />
Section "ServerFlags"<br />
Option "DontZap" "false" # enable ctrl-alt-backspace<br />
Option "AutoAddDevices" "true" # enable hotplugging <br />
Option "AllowMouseOpenFail" "true" # Do we need this?<br />
EndSection <br />
<br />
Section "Files"<br />
ModulePath "/usr/lib/xorg/modules"<br />
FontPath "/usr/share/fonts/misc:unscaled"<br />
FontPath "/usr/share/fonts/misc" <br />
FontPath "/usr/share/fonts/75dpi:unscaled"<br />
FontPath "/usr/share/fonts/75dpi" <br />
FontPath "/usr/share/fonts/100dpi:unscaled"<br />
FontPath "/usr/share/fonts/100dpi" <br />
FontPath "/usr/share/fonts/PEX" <br />
# Additional fonts: Locale, Gimp, TTF... <br />
FontPath "/usr/share/fonts/cyrillic" <br />
#FontPath "/usr/share/lib/X11/fonts/latin2/75dpi"<br />
#FontPath "/usr/share/lib/X11/fonts/latin2/100dpi"<br />
# True type and type1 fonts are also handled via xftlib, see /etc/X11/XftConfig!<br />
FontPath "/usr/share/fonts/Type1" <br />
FontPath "/usr/share/fonts/ttf/western" <br />
FontPath "/usr/share/fonts/ttf/decoratives" <br />
FontPath "/usr/share/fonts/truetype" <br />
FontPath "/usr/share/fonts/truetype/openoffice" <br />
FontPath "/usr/share/fonts/truetype/ttf-bitstream-vera" <br />
FontPath "/usr/share/fonts/latex-ttf-fonts" <br />
FontPath "/usr/share/fonts/defoma/CID" <br />
FontPath "/usr/share/fonts/defoma/TrueType" <br />
EndSection <br />
<br />
Section "Module"<br />
Load "ddc" # ddc probing of monitor<br />
Load "dbe" <br />
Load "dri" <br />
Load "extmod" <br />
Load "glx" <br />
Load "drm" <br />
Load "bitmap" # bitmap-fonts <br />
#Load "type1" <br />
#Load "freetype" <br />
Load "record" <br />
Load "synaptics" # pacman -S xf86-input-synaptics <br />
EndSection <br />
<br />
Section "Device"<br />
Identifier "Integrated"<br />
Driver "intel" # pacman -S xf86-video-intel<br />
VendorName "Intel Corporation"<br />
BoardName "Mobile 4 Series Chipset Integrated Graphics Controller"<br />
BusID "PCI:0:2:0" # To get your intel/ati busIDs run: "lspci | grep -i vga"<br />
EndSection<br />
<br />
Section "Device"<br />
Identifier "Discrete"<br />
Driver "radeonhd" # pacman -S xf86-video-radeonhd<br />
#Driver "ati" # pacman -S xf86-video-ati <br />
VendorName "ATI Technologies Inc"<br />
BoardName "Mobility Radeon HD 3400 Series"<br />
BusID "PCI:1:0:0" <br />
EndSection<br />
<br />
Section "Screen"<br />
Identifier "Screen0"<br />
Device "Integrated" # Switch between Integrated and Discrete graphics here,<br />
#Device "Discrete" # then restart X-server (ctrl-alt-backspace).<br />
Monitor "Monitor0"<br />
DefaultColorDepth 24<br />
SubSection "Display"<br />
Depth 24<br />
Modes "1440x900"<br />
EndSubSection<br />
EndSection<br />
<br />
You will then also need some config files in "/etc/hal/fdi/policy/"<br />
For instant "mouse-wheel.fdi" to enable TrackPoint-scrolling:<br />
<br />
<match key="info.product" string="TPPS/2 IBM TrackPoint"><br />
<merge key="input.x11_options.EmulateWheel" type="string">true</merge><br />
<merge key="input.x11_options.EmulateWheelButton" type="string">2</merge><br />
<merge key="input.x11_options.YAxisMapping" type="string">4 5</merge><br />
<merge key="input.x11_options.XAxisMapping" type="string">6 7</merge><br />
<merge key="input.x11_options.Emulate3Buttons" type="string">true</merge><br />
<merge key="input.x11_options.EmulateWheelTimeout" type="string">200</merge><br />
</match><br />
<br />
More information in the TrackPoint can be found here: http://www.thinkwiki.org/wiki/How_to_configure_the_TrackPoint.<br />
The Keyboard layout is controlled by "/etc/hal/fdi/policy/10-keymap.fdi" Modify it like [[Xorg_input_hotplugging#Modifying_hal_configuration|this]] to<br />
change your layout. If you have any more questions on hotplugging (like how to enable [[Touchpad_Synaptics#Configuration_via_HAL_policies_.28hotplugging_enabled.29|tapping]]), take a look at it's [[Xorg_input_hotplugging|wiki page]].<br />
<br />
<br />
=Audio=<br />
Once you have [[ALSA]] installed, fire up alsamixer and make sure that sound is not muted. You might also want to press the Volume Up or Volume Down button. It seems than the Mute button mutes everything, even system beeps. Pressing the Volume Up or Volume Down button can unmute, but not pressing the Mute button again.<br />
<br />
Here's the modules I have loaded that are relevant to sound :<br />
$ lsmod | grep snd<br />
snd_seq_oss 35584 0<br />
snd_seq_midi_event 9344 1 snd_seq_oss<br />
snd_seq 58336 4 snd_seq_oss,snd_seq_midi_event<br />
snd_seq_device 9364 2 snd_seq_oss,snd_seq<br />
snd_hda_intel 474672 2<br />
snd_hwdep 10632 1 snd_hda_intel<br />
snd_pcm_oss 45568 0<br />
snd_pcm 82440 2 snd_hda_intel,snd_pcm_oss<br />
snd_timer 24720 2 snd_seq,snd_pcm<br />
snd_page_alloc 10640 2 snd_hda_intel,snd_pcm<br />
snd_mixer_oss 18944 1 snd_pcm_oss<br />
snd 64840 16 snd_seq_oss,snd_seq,snd_seq_device,snd_hda_intel,snd_hwdep,snd_pcm_oss,snd_pcm,snd_timer,snd_mixer_oss<br />
soundcore 9632 1 snd<br />
<br />
Additionally, there is a patch for the audio driver for conexant's chipsets provided by http://www.linuxant.com which can be downloaded at http://www.linuxant.com/alsa-driver/.<br />
<br />
<br />
=Multimedia Keys=<br />
The screen brightness controls and the flashlight work without any tweaking. The other keys can be mapped using [[Extra_Keyboard_Keys#Using_xev|xev]] and xbindkeys. By following [http://wiki.linuxquestions.org/wiki/Configuring_keyboards#Enabling_Keyboard_Multimedia_Keys this guide] you should be able to get everything working, but here's summary :<br />
<br />
*First, open a terminal and type <code>xev</code>. This starts the "Event tester".<br />
*Place your cursor on the "Event tester" window.<br />
*When you press a key on your keyboard or move your mouse, it should get displayed in a terminal. For instance, this is what shows up if you press Fn+F2 <br />
KeyRelease event, serial 33, synthetic NO, window 0x3000001,<br />
root 0x86, subw 0x0, time 5537544, (76,110), root:(81,938),<br />
state 0x0, '''keycode 146''' (keysym 0x0, '''NoSymbol'''), same_screen YES,<br />
XLookupString gives 0 bytes:<br />
XFilterEvent returns: False<br />
It basically says that '''keycode 146''' is not bound ('''NoSymbol''').<br />
Here are all the keycodes of all multimedia buttons:<br />
<br />
Volume Down : keycode 174<br />
Volume Up : keycode 176<br />
Fn+F2 : keycode 146<br />
Fn+F3 : keycode 241<br />
Fn+F4 : keycode 223<br />
Fn+F5 : Not responding to events ??<br />
Fn+F7 : keycode 214<br />
Fn+F8 : keycode 249<br />
Fn+F9 : keycode 207<br />
Fn+F12 : keycode 165<br />
Fn+Up : keycode 164<br />
Fn+Down : keycode 162<br />
Fn+Left : keycode 144<br />
Fn+Right : keycode 153<br />
Fn+Home : keycode 212<br />
Fn+End : keycode 101<br />
*Type <code>xmodmap -pke > ~/.Xmodmap</code> in a terminal. This creates a file, <code>.Xmodmap</code>, containing your current keyboard mapping.<br />
*Now open the file with a text editor and find the keycodes you're interested in. You can map any keycode with a symbol from [http://wiki.linuxquestions.org/wiki/XF86_keyboard_symbols this list].<br />
*To get your new <code>.Xmodmap</code> loaded when you start X, just add <code>xmodmap ~/.Xmodmap</code> to your .xinitrc.<br />
*To get your new <code>.Xmodmap</code> loaded immediately, type <code>xmodmap ~/.Xmodmap</code> in a terminal.<br />
<br />
You can now assign functions to your newly bound keys by using [[Extra_Keyboard_Keys_in_Xorg#Using_your_Desktop_Environment_tools|facilities provided by your window desktop environment]] or by using <code>xbindkeys</code>.<br />
<br />
To use <code>xbindkeys</code>,<br />
*Start by installing it<br />
pacman -S xbindkeys<br />
*Then add <code>xbindkeys &</code> to your .xinitrc.<br />
*And finally, in your home directory, create a file called <code>.xbindkeysrc.scm</code> with content that would look something like <br />
(xbindkey '("XF86Standby") "sudo killall dhcpcd && sudo pm-suspend")<br />
(xbindkey '("XF86AudioRaiseVolume") "amixer set Master 2dB+ unmute")<br />
(xbindkey '("XF86AudioLowerVolume") "amixer set Master 2dB- unmute")<br />
<br />
==Mute==<br />
<br />
To get the mute button to work, it is necessary to pass the string <code>acpi_osi="Linux"</code> to the kernel as a boot parameter. In GRUB2, add it to the "linux" line. See [http://www.thinkwiki.org/wiki/Mute_button here] for more details.<br />
<br />
With the 3.1 bios, it seems that the mute button works normally (set it up the same as the volume buttons with, for instance, "amixer set Master toggle").<br />
<br />
=ACPI=<br />
To enable the fan speed control, it's necessary to load the thinkpad_acpi with option fan_control=1. After the thinkpad_acpi module is loaded with this option, you can monitor and adjust the fan speed via /proc/acpi/ibm/fan.<br />
<br />
=SUSPEND-RESUME=<br />
People have been having issues with suspend resume with the current intel xf86-video-intel 2.4.3.1 drivers in combination with the 4500mhd chipset. This is apparently an issue with concurrency as adding the following script (with mod 755) in /etc/pm/sleep.d fixes things. to some extent...<br />
<br />
#!/bin/sh<br />
# Workaround for concurrency bug in xserver-xorg-video-intel 2:2.4.1-1ubuntu10.<br />
# Save this as /etc/pm/sleep.d/00CPU <br />
<br />
. "/usr/lib/pm-utils/functions"<br />
<br />
case "$1" in<br />
hibernate|suspend)<br />
for i in /sys/devices/system/cpu/cpu*/online ; do<br />
echo 0 >$i<br />
done<br />
;;<br />
thaw|resume) <br />
sleep 10 # run with one core for 10 secs<br />
for i in /sys/devices/system/cpu/cpu*/online ; do<br />
echo 1 >$i<br />
done<br />
;;<br />
*)<br />
;;<br />
esac<br />
<br />
<br />
From http://ubuntu-virginia.ubuntuforums.org/showpost.php?p=6105510&postcount=12 petri4 on the ubuntu forums.<br />
<br />
=7-1 Media Card Reader=<br />
Tested for SD cards only. Works after loading modules sdhci and ricoh_mmc in /etc/rc.conf. Sometimes there are problems initializing the SD card (check dmesg) after inserting it. In such cases, try re-inserting it again. <br />
<br />
TODO<br />
<br />
=Bluetooth=<br />
The procedure described in the [[Bluetooth]] section of the Arch Wiki worked perfectly for me.</div>Landhar