[ltp] How does /proc/acpi/ibm/bay work

Tony Whitmore linux-thinkpad@linux-thinkpad.org
Wed, 30 Mar 2005 19:09:34 +0100


Tino Keitel wrote:
> On Tue, Mar 29, 2005 at 18:39:56 -0500, Nate wrote:
> 
>>I think what might help would be to provide the code inside the scripts, 
>>if it's not too much trouble.
> 
> 
> Well, here are the scripts from the 0.10 release, which I use. The
> idectl calls result in hdparm -U and hdparm -R calls for the
> corresponding IDE interface.

Thanks Tino,

I've had a look at the code, and got the latest source from the ibm-acpi 
project. From the contents of idectl and eject.sh and rescan.sh it looks 
as if idectl is being called by "idectl 1 rescan". If you look at the 
contents of idectl, you can see that

USE_IDE_DEV_1=/dev/hda
...
eval "USE_IDE_DEV=\$USE_IDE_DEV_$IDE_NR"

are called, so I think you've been trying to eject your hard drive!

On my R40 the CD-RW drive is IO 0x170 though, so trying changing the 
following lines in idectl and see what happens:

USE_IDE_DEV_0=/dev/hdc
USE_IDE_DEV_1=/dev/hda

to

USE_IDE_DEV_0=/dev/hda
USE_IDE_DEV_1=/dev/hdc

HTH,

Tony