WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [solved]Udev in Tinycore4.1 can't hundle ACTION=="change" rules?  (Read 5709 times)

Offline littlebat

  • Newbie
  • *
  • Posts: 25
[solved]Udev in Tinycore4.1 can't hundle ACTION=="change" rules?
« on: December 24, 2011, 08: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:
Quote
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.
« Last Edit: December 28, 2011, 01:07:10 AM by littlebat »

Offline littlebat

  • Newbie
  • *
  • Posts: 25
Re: Why the udev in Tinycore4.1 can't hundle ACTION=="change" rules and how?
« Reply #1 on: December 28, 2011, 01:00:13 AM »
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.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14796
Re: [solved]Udev in Tinycore4.1 can't hundle ACTION=="change" rules?
« Reply #2 on: December 28, 2011, 01:11:36 AM »
Ref: https://wiki.archlinux.org/index.php/HAL

Quote
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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: [solved]Udev in Tinycore4.1 can't hundle ACTION=="change" rules?
« Reply #3 on: December 29, 2011, 11:46:17 AM »
Plus, HAL polls for the cd IIRC. That is both an ugly solution and an ugly daemon :P
The only barriers that can stop you are the ones you create yourself.

Offline littlebat

  • Newbie
  • *
  • Posts: 25
Re: [solved]Udev in Tinycore4.1 can't hundle ACTION=="change" rules?
« Reply #4 on: January 07, 2012, 08:19:20 AM »
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:
Quote
       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