[Udpcast] Ejecting the CD-ROM before broadcast

Yannick Gingras ygingras at ygingras.net
Thu Jun 22 00:45:18 CEST 2006


Hi, I'd like to have my udpcast to eject its CD-ROM before a broadcast
so I can pick it and boot another box with it.  Yeah I could just push
the CD-ROM drive button but I'm a lazy bum.  cast-o-matic is a great
tool so I though I could just upload eject and call it.  Ok eject is
overkill, I did a smaller eject that I call miniject:

   #include <unistd.h>
   #include <stdlib.h>
   #include <stdio.h>
   #include <string.h>
   #include <fcntl.h>
   #include <limits.h>
   #include <sys/ioctl.h>
   #include <linux/cdrom.h>
   
   #define DEF_CDROM "/dev/cdrom"
   
   int main(int argc, char **argv)
   {
     int fd;
     if (argc > 1)
       fd = open(argv[1], O_RDONLY|O_NONBLOCK);
     else
       fd = open(DEF_CDROM, O_RDONLY|O_NONBLOCK);    
     ioctl(fd, CDROMEJECT);
   }
   
But unfortunatly I can't find the cdrom device in /dev.  Are there any
modules that I should add to the image in order to have the cdrom
device created in /dev ?

-- 
Yannick Gingras



More information about the Udpcast mailing list