[ltp] T30 2.6.17.8, Ububntu Dapper, /dev/hdc not created??

André Wyrwa linux-thinkpad@linux-thinkpad.org
Sat, 09 Sep 2006 11:28:30 +1000


--=-TDrLP5h7Q7r80JWvU07e
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

> Are you possibly loading the lt_hotswap module at boot time? This
> managed to remove my /dev/hdc as well on my T23. Since then i've
> refrained from using lt_hotswap and everything works fine.

I found a solution to this...or better a workaround...

It seems that lt_hotswap unregisters the whole ide1 interface when the
module is loaded. This leads to /dev/hdc missing. It is supposed to
re-register the interface, but that doesn't happen. It is the same
process as when processing eject/insert events - only that then it
works.

So the idea is to load the module on first eject attempt and thereby use
the initial ide unregistering for our first eject.

I did it like this:

1. Do not load lt_hotswap at bootup.

2. However, make sure that your system is configured like so that
lt_hotswap gets loaded with the auto_eject=3D1 option.

3. As long as lt_hotswap is not loaded, the eject request is reported by
ibm_acpi. So we need a new event file like this:

event=3Dibm/bay
action=3D/etc/acpi/lths.sh

4. Modify the beginning of lths.sh to look somewhat like this:

---snip---
#!/bin/sh

#FLOPPY_PARAMS=3D"thinkpad=3D1"

MPOINT_HDD=3D/media/ext_storage
HDD_DEVICE=3D/dev/hdc1

MPOINT_CDROM=3D/media/cdrom
CDROM_DEVICE=3D/dev/hdc

unmount_drive() {
        # try ounmounting devices
        if mount | grep $1; then
                umount $1
                if [ $? -eq 1 ]; then
                  echo 4 >/proc/acpi/ibm/beep
                  exit 1
                fi
        fi
        echo "$1 processed"
}

case "$2" in
        "MSTR")
                if test $3 =3D '00000003' ; then
                        # recieved a master eject request
                        unmount_drive $MPOINT_HDD
                        echo "HDD unmounted"
                        unmount_drive $MPOINT_CDROM
                        echo "CD-ROM unmounted"
                        if [ -e /proc/acpi/lths ]; then
                          echo "hotswapping support already loaded -
ejecting"
                          echo -n "$2 eject" > /proc/acpi/lths
                        else
                          echo "loading hotswap support and ejecting"
                          /sbin/modprobe lt_hotswap
                          echo -n "$2 eject" > /proc/acpi/lths
                        fi
                elif test $3 =3D '00000001' ; then
                        if test $4 =3D '00000001' ; then
                                hdparm -d 1 -u 1 -c 1 /dev/hdc
                                if [ -b $HDD_DEVICE ]; then
                                  mount $HDD_DEVICE
                                  echo $mounted
                                elif [ -b $CDROM_DEVICE ]; then
                                  mount $CDROM_DEVICE
                                  echo mounted
                                fi
                        fi
                fi
                ;;
---snip---

The rest stays the same.

This also includes some improvements to the mount/unmount handling.

Andr=E9.


--=-TDrLP5h7Q7r80JWvU07e
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQBFAhi+EOp8fsnyxsQRAlzwAKDZQZVFhbSa70etwFgzk8eSJRHLVQCff0z/
CikKl3p7lhHyaDuTNi7OVA8=
=eaTX
-----END PGP SIGNATURE-----

--=-TDrLP5h7Q7r80JWvU07e--