I didn't but quickly uploaded it here:
http://distro.ibiblio.org/amigolinux/do ... orun-3.20/
Here's the command I use to start it (from Window Maker's 'autostart' script):
Code: Select all
autorun --notify-insert="/usr/bin/rox /mnt/cdrom" --cdplayer="/usr/bin/wmcdplay" --recorder="/usr/bin/simplecdrx" --interval=2000 &
There's an archive of patches there you'll want to pay attention to. If you use src2pkg, you should be able to use my autorun.src2pkg script there to build it -otherwise, have a look at it to see the commands used to build it. I created the patches to address some issues with the build (on an older system gcc-3.4.6/glibc-2.3.6), so your mileage may vary.
You could start it during the init scripts, but it is best to start it (backgrounded) after the desktop is up and running. Either way, the code may prove valuable to the OP -although it is written in C++ (Drat it!)
As I mentioned, CD/DVD hardware doesn't issue any kind of signal which would generate a kernel event -you have to poll the drive for any changes and each poll cycle has to be complete. Basicallly, you check the drive to see if there is a disk in there. If not, you go to the next polling loop. If there is a disk, then you have to determine the type -if it has a filesystem you mount it, if it is an audio disc you run the player, otherwise it is a blank disk and you run the burner. You *could* use another method where you'd eject the disk once during bootup, then close the door -that way you'd at least know if the door is open or closed before staring to poll it.
About autorun: as the name suggests, it was meant to provide the functionality provided by Windows when an autorun.inf file is present, but I don't use it for that.
I'm also interested to know what udev rule the OP is using to generate the kernel add/change events -maybe newer kernel drivers are somehow polling the drives automatically?