Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: littlebat on December 24, 2011, 05:33:17 AM
-
I use "sudo udevadm --debug monitor" or "sudo udevd --debug" to check if the udev can hundle "change"(insert disc into or eject it from the dvd driver ) actions when use DVD driver on four Linux OS.
Both Debian 6.0 and CDlinux 0.9.6.1 can recognize insert and eject action, but, both tinycore 3.7.1 and tinycore 4.1 and Debian 5.0 can't recognize this "change" action.
For example, tinycore can't execute the rule below:
ACTION=="change", SUBSYSTEM=="block", RUN+="/bin/touch /home/myhome/udev.flg"
udev version:
Debian 6.0: 164, kernel 2.6.32
CDlinux 0.9.6: 142, kernel 2.6.33
Tinycore 4.1: 173, kernel 3.0.3
Tinycore 3.7.1: 151, kernel 2.6.33.3
Debian 5.0: 125, kernel 2.6.26
My question is: Why the udev in Tinycore4.1 can't hundle ACTION=="change" rules and how to make Tinycore udev support "change" action? Do I need recompile the kernel with adding some special options? Do I need install some extra packages?
Thanks.
-
For 4.1, install hal.tcz is ok;
For 3.7.1, need recompile kernel, cancel "CONFIG_IDE=y" and all IDE options, install hal.tcz, write some udev rules for it, copy "60-cdrom_id.rules" and "60-persistent-storage.rules" from tinycore4.1 seems ok.
It seems cancel IDE support from the kernel config then kernel will recognize all the IDE hard disks and cdrom drivers as SCSI device. And, only the SCSI CDROM's "change" action can be detected by HAL, then HAL can send the "change" action to UDEV.
-
Ref: https://wiki.archlinux.org/index.php/HAL
HAL has become deprecated in favor of udev, udisks, upower, etc. and is no longer developed. Currently, a small number of programs still rely on and use HAL, though development is heading toward utilizing udev as a replacement.
-
Plus, HAL polls for the cd IIRC. That is both an ugly solution and an ugly daemon :P
-
I have tested on "hal" and "udisks", for the SCSI cdrom and IDE cdrom in vmware, both "hal" and "udisks" can only detect its status by polling them:
udisks: udisks --poll-for-media /dev/<devicename>
hal: hal-disable-polling --device /dev/cdrom --enable-polling
This is the restriction of hardware, not the design of software. I read "man hal-disable-polling", it says:
Despite the existence of support for asynchronous media change notifiā
cation in recent MMC (Multi-Media Commands) specifications, virtually
no optical drives are compliant with the specification. Fortunately
newer SATA ATAPI hardware seems to support Asynchronous Notification
(AN) and at this time of writing (March 2007) work is underway to make
both the Linux operating system kernel and HAL take advantage of this.
But, I haven't a CDROM support "Asynchronous Notification" to test whether "hal" and "udisks" can detect the status without polling the CDROM.
And, "udisks" needs much more dependencies than "hal". For a mini linux, it seems "hal" is a better choice.
And, for detect the cdrom disc insertition and mount it automatically. I wrote a script to do this job. see:
A simple script for mounting cdrom disc automatically when insert disc http://forum.tinycorelinux.net/index.php/topic,12288.0.html (http://forum.tinycorelinux.net/index.php/topic,12288.0.html)