As I wrote yesterday, I’ve started working on an universal eject command for Linux, FreeBSD and OSX, using libcdio to issue MMC commands to the cd readers.
The first try, with just linux support, is here, and works fine to eject and load drives under Linux. Obviously it’s not complete, it’s just the work of 40 minutes of coding with getopt manpage open (because I never used it before).
To compile use this commandline: gcc –std=c99 unieject-DATE.c -o unieject -lcdio .
Unfortunately it doesn’t work on FreeBSD… why that? because libcdio doesn’t seems to work too well, either. The default access method requires SCSI emulation support, the ioctl support which would work on ATAPI cdroms doesn’t work either as it doesn’t fill the capabilities of the drive.
What I can do now is just improve libcdio so that it will work with ATAPI drives on FreeBSD, if I really want to have an universal eject.
P.S.: about the mail I talked about yesterday… the letter was received in time (after 6 days from the sending) but the return receipt hanged for 9 days at my local post office… and I still haven’t seen the money for the job :/