[Udpcast] Ejecting the CD-ROM before broadcast
Alain Knaff
alain at knaff.lu
Thu Jun 22 09:41:05 CEST 2006
Yannick Gingras wrote:
> 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 ?
>
In the current version, by default, CD-Rom drivers are not installed
(not needed, because the loading of the OS is performed via the BIOS).
So, it's currently not possible to do this miniject
Regards,
Alain
More information about the Udpcast
mailing list