[ltp] Re: What are people using for Dock/Undocking scripts for
their X60/61's?
Theodore Tso
linux-thinkpad@linux-thinkpad.org
Sat, 7 Mar 2009 09:44:01 -0500
On Sat, Mar 07, 2009 at 09:28:18AM +0100, Thomas Hood wrote:
>
> That is, pressing the undock button causes immediate (electronic)
> disconnection. And this causes an immediate hang in the kernel.
At least with a 2.6.29-rc7 kernel, and using LVM, it doesn't cause a
hang for me. LVM does complain a lot if I don't unmount the
filesystem and run "vgchange -an <vgname>" first, though.
> Assuming we want undocking to be as effortless as possible there
> are two solutions.
>
> 1. Change Linux so that it does not hang when the Ultrabay Slim
> drive disappears without warning.
It doesn't for me; what filesystem did you have mounted, and what were
you accessing at the time?
> or
>
> 2. Avoid using the "undock" button on the UltraBase; instead hook
> a hotkey such as Fn-F9 to do something like:
>
> echo 1 > /sys/class/scsi_device/1:0:0:0/device/delete
> echo eject > /proc/acpi/ibm/bay
> echo 1 > /sys/devices/platform/dock.0/undock
There are older Ultrabay scripts out there which unmount the
filesystem first, but yes.
It should also be possible to hook the undock button so that scripts
can be run and then the OS can either confirm the undock or refuse the
undock request. That's what Windows does, so it's definitely
possible. I'm not sure if it will require kernel changes in the
thinkpad and/or dock ACPI drivers, though. Not my area of expertise,
and I haven't had time to really drill into it.
- Ted