Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Feb 2012 16:26:36 +0100
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        vermaden <vermaden@interia.pl>
Cc:        fidaj@ukr.net, freebsd-stable@freebsd.org, lars.engels@0x20.net, Hans Petter Selasky <hselasky@c2i.net>, smithi@nimnet.asn.au
Subject:   Re: devd based AUTOMOUNTER
Message-ID:  <20120228162636.Horde.JgORKJjmRSRPTPIsGKfo0uA@webmail.leidinger.net>
In-Reply-To: <kovckjfzfftyzqjrypqv@khtj>
References:  <hkubftdrahxmtuzcfqzh@ziad> <4F3EE186.4020801@gmail.com> <uhhupehcnrebtwjfedhg@xlkc> <201202181409.08859.hselasky@c2i.net> <evbvqmovseenzzafkvdy@cufm> <dusvifyxcdqegubftcgz@lvhf> <20120226203949.H89643@sola.nimnet.asn.au> <CAN6yY1uYMfWqkbXLHXuS-bTKes7T=YMS%2BfBX8_%2BXtx9-rBFmyw@mail.gmail.com> <ztlcngurasjmdlkymcau@dovo> <CAN6yY1sfFH%2B4pBmmSmREG5xO1nF8iCzPwXKuXAOG3rBrsO62bg@mail.gmail.com> <kovckjfzfftyzqjrypqv@khtj>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting vermaden <vermaden@interia.pl> (from Mon, 27 Feb 2012 21:36:46 +0100):

>> Unfortunately, I spent a few days that would
>> have to understand how it is possible to
>> detect the inserted CD-ROM with devd; but
>> alas - the only thing that detects changes
>> in the drive CD-ROM - a :sysctl kern.geom.conftxt
>>
>> before inserting the disc:
>> kern.geom.conftxt: 0 DISK cd0 0 2048 hd 0 sc 0
>> ...
>>
>> after inserting the disc:
>> kern.geom.conftxt: 0 DISK cd0 4700372992 2048 hd 0 sc 0
>
> Thanks, at least we have 'something' we can cepend on.
>
> I can create an 'active wait' daemon for that, like the skel below:
>
> while sleep 3
> do
>   case $( sysctl -n kern.geom.conftxt ) in
>     (0 DISK cd0 0 2048 hd 0 sc 0)
>       echo "No CD in the drive ..."
>       # umount procedure ...
>       ;;
>     (0 DISK cd0 * * hd 0 sc 0)
>       echo "We have CD here!"
>       # do something about it lile mount_cd9660
>       ;;
>   esac
> done
>
> But a devd(8) event would be far better, maybe some somple commit to  
> devd(8) would help here? My knowledge does not allow me to add these  
> bits to devd(8).

The kernel does not poll for CD changes, and the people guarding the  
relevant CD code where against something like this in the kernel  
everytime this came up in the past. So no devd event for this.

Bye,
Alexander.

-- 
Back when I was a boy, it was 40 miles to everywhere,
uphill both ways and it was always snowing.

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120228162636.Horde.JgORKJjmRSRPTPIsGKfo0uA>