Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - MCD : external insertion notification doesn`t work: (2 Items)
   
MCD : external insertion notification doesn`t work  
Hello QNX Developers,

My needs perfectly described by "CD-changer controlled by external firmware" section of MCD documentation.
I need to avoid using built-in CD_MEDIA_IOBLK MCD routine and report CD insertion/ejection events externally.

However, when I do that, configured start/stop rules are NOT executed.

MCD is executed with '-vvvv' CL option.
From sloginfo, I can see that notifications are received by MCD:

Jan 01 03:03:41.632.3 00023 00 /dev/cd0 media inserted
Jan 01 03:03:52.597.3 00023 00 /dev/cd0 media ejected

Implementation is really simple and is pretty much a copy-paste from official documentation. Suppose that it is OK, as 
MCD does indicate these reports in the log (in case of insertion, "/dev/cd0" is written to /dev/mcd/.insert, in case of 
ejection, write it to /dev/mcd/.eject)

Snippet of my mcd.cfg :

[/dev/cd*]
Start Rule   = MOUNT
Stop Rule    = UNMOUNT

[MOUNT]
Callout		= MOUNT_FSYS
Argument	= /etc/mcd.mnt

[UNMOUNT]
Callout		= UNMOUNT_FSYS


Note : 
In case of I switch to built-in CD_MEDIA_IOBLK routine, MOUNT rule is executed and CD is mounted.
(To do that, I only need to add following lines to [/dev/cd*] device entry)
> Callout      = CD_MEDIA_IOBLK
> Argument     = 1000,2000
> Priority     = 11,10


Thank you!
Re: MCD : external insertion notification doesn`t work  
I'm not sure this scenario is handled by MCD. If MCD only processes the
mount/umount functions when there is a callout, you could possibly
implement your own custom callout, as described in the MCD docs. Your
callout could talk to your external device to get the insertion state, or
alternatively, maybe your callout does nothing and you keep writing the to
insert/eject files. It is possible just having a callout will allow it to
mount/unmount.

Regards,
Gilles