Re: CD changers

Charlie Brady (charlieb@budge.apana.org.au)
Wed, 11 Mar 1998 22:40:24 +1100 (EST)


On 6 Mar 1998, Jeanette Pauline Middelink wrote:

> On Fri, Mar 06, 1998 at 12:43:29PM -0700, Robert L Harris wrote:
> > How about something similar to a soft-automounter implementation? If another
> > slot isn't in use, have the code unmount the current one and then mount
> > the desired slot?
>
> I did such a beast for automount, it's a small additional something
> to automount, which starts by reading the numbers of slots of the cd
> and allowing chdir()'s into imaginary directories 0..slots-1.
> Whenever you enter a directory, it changes to it. However this
> horrible fails if something is still busy on another disk, since
> the umount will fail and.. and...

If you use autofs, an executable map a little like this works:

#! /bin/sh

if grep -q /dev/hdb /proc/mounts
then
umount /dev/hdb || exit
fi
if ! eject -c `expr $1 - 1` /dev/hdb
then
exit
fi
echo -fstype=iso9660,ro,nodev,nosuid :/dev/hdb

Charlie
// must find that old .sig

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu