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?

I'm calling it once every 5 seconds (5 seconds is about the time required for DVD drive to settle when you insert a new disc anyway). I used patched cddetect_quick; the original one from
Barry returns 255 for anything other than "disc inserted" and that stops xargs from continuing (the patched version returns 1 instead)._________________Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.

Anyways the plugin support is requiring a major rewrite, it will take time.

I found libburn, but it is absent in lucid puppy:

Code:

# pkg-config --modversion libburn-1
Package libburn-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libburn-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libburn-1' found
#

Currently it can detect only upto audio cds, and that too I haven't tested yet. I don't have any. If ioctl reports that inserted disk is an audio cd, it should use media-cdrom-audio icon and any attempt to mount it should give an error.

Why don't you start it as a service, but indirectly, with a wrapper script to wait until X starts, but then on a restart of X you may be faced with your initial problem... _________________Puppy Linux Blog - contact me for access

Optical drives are detected by iterating over each device in /sys/block, testing each device whether it's an optical drive.

How do you do the test?

Quote:

I wonder what is the circumstance when scripts at /etc/init.d are launched.

They are launched by /etc/rc.d/rc.services, in the background, in alphabetical order. /etc/rc.d/rc.services in turn is launched by /etc/rc.d/rc.sysinit; rc.sysinit is launched by /sbin/init --- and that is as early as you get. Before /sbin/init we're talking about initramfs (ie, before the pup.sfs is loaded and executed).

But of course this depends on when the driver for the particular device is loaded - if the driver is not built into kernel (compiled as a module instead), depending on when the module gets loaded, the device may not be ready for detection in rc.sysinit. In particular, if it is loaded dynamically by udev (udev is started early in rc.sysinit), it may take a while before it appears in /sys/block (that is, after all the udev rules for it are processed). USB devices are particularly prone to this additional delay._________________Fatdog64, Slacko and Puppeee user. Puppy user since 2.13.
Contributed Fatdog64 packages thread.

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot vote in polls in this forumYou cannot attach files in this forumYou can download files in this forum