Difference between revisions of "ThinkPad X6 UltraBase"
m (Linux support info, dock/undock code added, some minor changes) |
m (added newer distros info) |
||
Line 31: | Line 31: | ||
The UltraBay Slim slot in this dock is a full featured one and supports hot swapping with all UltraBay Slim drives. You can also feed it with the UltraBay Slim battery pack to extend the overall battery life time. | The UltraBay Slim slot in this dock is a full featured one and supports hot swapping with all UltraBay Slim drives. You can also feed it with the UltraBay Slim battery pack to extend the overall battery life time. | ||
− | == UltraBase X6 under Linux == | + | == UltraBase X6 under Linux (older style) == |
The docking stations are (at least in openSUSE) supported by the [http://en.opensuse.org/Dockutils Dockutils] project. The dockutils are formed by a set of simple bash scripts that handle docking and undocking of the computer. When the user chooses to undock the laptop, it does some system calls and when properly configured, it could disconnect the DVD drive in UltraBase or internal display resolution. | The docking stations are (at least in openSUSE) supported by the [http://en.opensuse.org/Dockutils Dockutils] project. The dockutils are formed by a set of simple bash scripts that handle docking and undocking of the computer. When the user chooses to undock the laptop, it does some system calls and when properly configured, it could disconnect the DVD drive in UltraBase or internal display resolution. | ||
Line 49: | Line 49: | ||
if [ "$1" = "dock" ]; then | if [ "$1" = "dock" ]; then | ||
echo "X61 dock" | echo "X61 dock" | ||
− | # non-present dvd drive workaround | + | # non-present dvd drive workaround, not required in newer distros |
/bin/rescan-scsi-bus.sh --hosts=1 --channels=0 --ids=0 --luns=0 --forceremove & | /bin/rescan-scsi-bus.sh --hosts=1 --channels=0 --ids=0 --luns=0 --forceremove & | ||
Line 82: | Line 82: | ||
Now, you should be able to undock your PC using the keyboard keys and the dock button. | Now, you should be able to undock your PC using the keyboard keys and the dock button. | ||
{{NOTE|[[Thinkpad-acpi|thinkpad_acpi]] and <code>acpid</code> must be installed and running for this to work}} | {{NOTE|[[Thinkpad-acpi|thinkpad_acpi]] and <code>acpid</code> must be installed and running for this to work}} | ||
+ | |||
+ | == UltraBase X6 under Linux (newer style) == | ||
+ | Since in recent distributions (like openSUSE 11.1), there is no generated ACPI event for undocking the notebook (Alt+F9 still works the same), you need to use udev in order to be able detect the undocking event. You can use the same ACPI hook as in the "older style" docking setting but you need to put this code into your udev rules: | ||
+ | |||
+ | {{cmdroot|cat /etc/udev/rules.d/10-docking}} | ||
+ | <pre>ENV{EVENT}=="undock", KERNEL=="dock.0", SUBSYSTEM=="platform", RUN+="/usr/lib/dockutils/hooks/thinkpad/70x61 undock" | ||
+ | ENV{EVENT}=="dock", KERNEL=="dock.0", SUBSYSTEM=="platform", RUN+="/usr/lib/dockutils/hooks/thinkpad/70x61 dock"</pre> | ||
+ | After this change, the notebook will change it's resolution automatically after you remove it from the UltraBase. |
Revision as of 16:41, 27 December 2008
Contents |
Lenovo UltraBase X6The IBM UltraBase X6 is a portable dock for the 6-series ThinkPads providing extra ports as well as a bay for an optical drive and a set of stereo speakers. Containing a full featured UltraBay Slim slot, it provides flexibility in drive choice as well as the option of a secondary battery for extended working time on the road. Features
Pros & Cons |
UltraBay Slim
The UltraBay Slim slot in this dock is a full featured one and supports hot swapping with all UltraBay Slim drives. You can also feed it with the UltraBay Slim battery pack to extend the overall battery life time.
UltraBase X6 under Linux (older style)
The docking stations are (at least in openSUSE) supported by the Dockutils project. The dockutils are formed by a set of simple bash scripts that handle docking and undocking of the computer. When the user chooses to undock the laptop, it does some system calls and when properly configured, it could disconnect the DVD drive in UltraBase or internal display resolution.
Overally, the UltraBase works pretty same way as under Windows (it only has more configuration possibilites), the user only needs to press key on the dock to undock the PC. Docking is handled automatically.
The following code has been tested on OpenSUSE 10.3 (Linux 2.6.22) with ThinkPad X61 but should work on all dockable ThinkPads with recent kernel and the required software installed.
Dockutils hook
In order to have the docking handled automatically, we need to create a hook in Dockutils directory(/usr/lib/dockutils). We will put our hook in hooks/thinkpad/ directory.
# cat /usr/lib/dockutils/hooks/thinkpad/70x61
#!/bin/bash # dock/undock script for Thinkpad X61 export DISPLAY=:0 if [ "$1" = "dock" ]; then echo "X61 dock" # non-present dvd drive workaround, not required in newer distros /bin/rescan-scsi-bus.sh --hosts=1 --channels=0 --ids=0 --luns=0 --forceremove & # set external display resolution & dpi /usr/bin/xrandr --output VGA --auto /usr/bin/xrandr --screen 0 -s 1920x1200 /usr/bin/xrandr --screen 0 --dpi 96x96 elif [ "$1" = "undock" ]; then echo "X61 undock" # turn external display off, internal on and set res /usr/bin/xrandr --screen 0 -s 1024x768 /usr/bin/xrandr --output LVDS --auto /usr/bin/xrandr --output VGA --off /usr/bin/xrandr --screen 0 --dpi 96x96 fi
/usr/bin/xrandr
lines from the scriptThe # xhost +local:root
command has to be in /etc/X11/xinit/xinitrc.d/<script name> to get xrandr
working from the root account.
ACPI event handlers
You can always run the Dockutils using # docker dock
or # docker undock
command, but this is not comfortable. We will use the ACPI subsystem to bind FnF8, FnF9 keys and blue button on the docking station to the Dockutils. This could be performed using the following code:
# cat /etc/acpi/events/dock
event=(ibm/dock GDCK 00000000 00000003|ibm/hotkey HKEY 00000080 00001008) action=/usr/sbin/docker dock
and
# cat /etc/acpi/events/undock
event=(ibm/dock GDCK 00000003 00000001|ibm/hotkey HKEY 00000080 00001009) action=/usr/sbin/docker undock
Now, you should be able to undock your PC using the keyboard keys and the dock button.
acpid
must be installed and running for this to workUltraBase X6 under Linux (newer style)
Since in recent distributions (like openSUSE 11.1), there is no generated ACPI event for undocking the notebook (Alt+F9 still works the same), you need to use udev in order to be able detect the undocking event. You can use the same ACPI hook as in the "older style" docking setting but you need to put this code into your udev rules:
# cat /etc/udev/rules.d/10-docking
ENV{EVENT}=="undock", KERNEL=="dock.0", SUBSYSTEM=="platform", RUN+="/usr/lib/dockutils/hooks/thinkpad/70x61 undock" ENV{EVENT}=="dock", KERNEL=="dock.0", SUBSYSTEM=="platform", RUN+="/usr/lib/dockutils/hooks/thinkpad/70x61 dock"
After this change, the notebook will change it's resolution automatically after you remove it from the UltraBase.