Forum Topic - mcd .insert and .eject from Makefile: (1 Item)
   
mcd .insert and .eject from Makefile  
I currently have a makefile that creates partitions on a CF card and uses unmount and mount  on the card surrounding the
 partition creation.  I would like to use mcd so that the makefile won't need root privileges.

devb-umass is started with:
   devb-umass cam pnp &
mcd is started with:
   mcd -I .insert -E .eject /etc/mcd.conf


USB attached CF card shows up as /dev/hd1

I have the following lines in mcd.conf:
   [/dev/hd[1-9]*]
   Callout = PATH_MEDIA_PROCMGR
   Argument = /proc/mount
   Priority = 11,10
   Start Rule = MOUNT
   Stop Rule = UNMOUNT

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

   [UNMOUNT]
   Callout = UNMOUNT_FSYS

And the following lines in mcd.mnt
   /dev/hd[1-9]*  /  enum
   /dev/hd[1-9]*t77  /fs/hd%#t77  qnx4  normv
   /dev/hd[1-9]*t78  /fs/hd%#t78  qnx4  normv
   /dev/hd[1-9]*t79  /fs/hd%#t79  qnx4  normv


when the USB CF card reader is plugged in everything mounts as expected, when unplugged everything umounts as expected.

however with the makefile I would like to leave the reader plugged in, trigger an eject if the partitions are mounted, rewrite the partitions and then trigger an insert and have the partitions mounted.

according to this page:
http://www.qnx.com/developers/docs/6.4.1/neutrino/utilities/m/mcd.html

I should be able to write the path of the device to /dev/mcd/.insert and have it trigger an insert action or write the path to /dev/mcd/.eject to trigger an eject.  
I've tried using:
echo "/dev/hd2t77" >> /dev/mcd/.eject

but it remains mounted
likewise 
echo "/dev/hd2t77" >> /dev/mcd/.insert
doesn't seem to trigget an insert event

I've searched around but couldn't find much info regarding the use of .insert and .eject.  Any help would be greatly 
appreciated.
Thanks,
Michael