Skip to contentSkip to conversation

udev problems

DISCUSSION Michal Čihař 6 participants 23 messages Mar 7, 2004 – Apr 19, 2005

lore
Share & tools
lore
#0 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I finally decided to give udev a try, but it was not as good as I hoped. I have Apacer Mega Steno card reader (as well as other usb storage device) and I wanted to have permanent name for it. Okay, lets create some rule in udev.rules and script that will generate it. Sometimes the name was generated correctly and sometimes not. Afer some experiments I got three rules, that seem to work (with line numbers):

21: BUS="scsi", SYSFS{vendor}="Apacer ", SYSFS{model}="Mega Steno ",
PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"
22: BUS="scsi", SYSFS{vendor}="Apacer ", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"
23: BUS="scsi", SYSFS{vendor}="Apacer", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

related udev log:

configured rule in '/etc/udev/udev.rules' at line 21 applied, added symlink '%k %c{2} %c{3}'
configured rule in '/etc/udev/udev.rules' at line 21 applied, 'sda' becomes '%c{1}'
creating device node '/dev/scsi/host28/bus0/target0/lun0/disc' configured rule in '/etc/udev/udev.rules' at line 21 applied, added symlink '%k %c{2} %c{3}'
configured rule in '/etc/udev/udev.rules' at line 21 applied, 'sdc' becomes '%c{1}'
creating device node '/dev/scsi/host28/bus0/target0/lun2/disc' configured rule in '/etc/udev/udev.rules' at line 22 applied, added symlink '%k %c{2} %c{3}'
configured rule in '/etc/udev/udev.rules' at line 22 applied, 'sdb' becomes '%c{1}'
creating device node '/dev/scsi/host28/bus0/target0/lun1/disc' configured rule in '/etc/udev/udev.rules' at line 23 applied, added symlink '%k %c{2} %c{3}'
configured rule in '/etc/udev/udev.rules' at line 23 applied, 'sda1' becomes '%c{1}'
creating device node '/dev/scsi/host28/bus0/target0/lun0/part1'

Why does every time match another rule?

Using udev 021 (from Debian unstable) and kernel 2.6.3.

Another topic is that device does not automatically report partitions, so man has to read appropriate device to get partitions.

- --
Regards
Michal ÄŒihaÅ™
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASxJG3DVS6DbnVgQRAjb1AKDXvj6ChkdblRraH0vkidN3uQfERACgkHu3 BoXQrnBG57RSh81OJ9skwdw=Y4Pt
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw
Quoted 12 lines · Michal Èihaø

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi

I finally decided to give udev a try, but it was not as good as I hoped. I have Apacer Mega Steno card reader (as well as other usb storage device) and I wanted to have permanent name for it. Okay, lets create some rule in udev.rules and script that will generate it. Sometimes the name was generated correctly and sometimes not. Afer some experiments I got three rules, that seem to work (with line numbers):

Quoted 3 lines

21: BUS="scsi", SYSFS{vendor}="Apacer ", SYSFS{model}="Mega Steno ",
PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

What is this "apacer.sh" for? What's in there?

Quoted 2 lines

Another topic is that device does not automatically report partitions, so man has to read appropriate device to get partitions.

Most removable media devices are unable to report media changes, you have to poll the device, but thats not a udev task.
So your choice is to dis-/reconnect for partition update or create all partitions if the main device is connected with NAME{all_partitions}=.

thanks,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No need to cc me, I'm subsribed.

Quoted 1 line · Kay Sievers

What is this "apacer.sh" for? What's in there?

See attachment, it just generates device name.

Quoted 2 lines

Most removable media devices are unable to report media changes, you have to poll the device, but thats not a udev task.

Okay, this problem is solvable.

Quoted 1 line

So your choice is to dis-/reconnect for partition update

This doesn't work, it doesn't report partiotions even if card inserted while connecting.

Quoted 2 lines

or create all partitions if the main device is connected with NAME{all_partitions}=.

Probably best solution.

- --
Regards
Michal Čihař
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASxno3DVS6DbnVgQRAiVOAJ9v4U30sNDYEHpS34h5dab/vQgRzgCggEmF +xtXrJ6qwjJe8h2L+LjR3kI=
=3+K8
-----END PGP SIGNATURE-----

#3 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Kay Sievers

So your choice is to dis-/reconnect for partition update or create all partitions if the main device is connected with NAME{all_partitions}=.

Is there way to make this work with symlinks?

- --
Regards
Michal Èihaø
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASx9N3DVS6DbnVgQRAtPGAJ9mn1/aP+YTvLtCgSi1qlhcGNeCVQCeJ2ra 8Jf3NEOThCHjcTDKn8tIc8M=kazo
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#4 lore raw
In reply to Michal Čihař
Quoted 4 lines · Michal Èihaø

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

No need to cc me, I'm subsribed.

Yes, but it's quite common.
I just reply to all and do not edit the mail header. The list needs several hours to deliver some days, so this isn't a option anyway.
And you receive your own mail too, right? :)

Quoted 4 lines · Kay Sievers
Quoted 1 line

What is this "apacer.sh" for? What's in there?

See attachment, it just generates device name.

I'll take a look.

Quoted 9 lines
Quoted 2 lines

Most removable media devices are unable to report media changes, you have to poll the device, but thats not a udev task.

Okay, this problem is solvable.

Quoted 1 line

So your choice is to dis-/reconnect for partition update

This doesn't work, it doesn't report partiotions even if card inserted while connecting.

Are the partitons in /sys ?
Something like /sys/block/sda/sda1/ ?

Quoted 4 lines
Quoted 2 lines

or create all partitions if the main device is connected with NAME{all_partitions}=.

Probably best solution.

Yes, but no symlinks.

Kay

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#5 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 1 line · Kay Sievers

I just reply to all and do not edit the mail header.

I just reply to list :-)

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

So your choice is to dis-/reconnect for partition update

This doesn't work, it doesn't report partiotions even if card inserted while connecting.

Are the partitons in /sys ?
Something like /sys/block/sda/sda1/ ?

No they're not there until I read from /dev/sda*

- --
Regards
Michal Èihaø
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASyiA3DVS6DbnVgQRAs05AJ0fshLjTy2Ou529/Vs7ndTNbTMOWwCfYckj SvbEHJgXNG2UCY5HMAEmqwI=N8d4
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#6 lore raw
In reply to Michal Čihař
Quoted 10 lines · Michal Èihaø

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 1 line · Kay Sievers

I just reply to all and do not edit the mail header.

I just reply to list :-)

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

So your choice is to dis-/reconnect for partition update

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

This doesn't work, it doesn't report partiotions even if card inserted while connecting.

Are the partitons in /sys ?
Something like /sys/block/sda/sda1/ ?

No they're not there until I read from /dev/sda*

No idea. My partitions are found.
Whats in dmesg? I have the following for my cheap 4slot-reader:

USB Mass Storage device found at 3
usb 1-3: USB disconnect, address 3
usb 1-3: new high speed USB device using address 4
scsi2 : SCSI emulation for USB Mass Storage devices
Vendor: Zynet Model: USB Storage-SMC Rev: I03A
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi2, channel 0, id 0, lun 0 Attached scsi generic sg0 at scsi2, channel 0, id 0, lun 0, type 0
Vendor: Zynet Model: USB Storage-CFC Rev: I03A
Type: Direct-Access ANSI SCSI revision: 02
sdb: Spinning up disk....ready
SCSI device sdb: 31360 512-byte hdwr sectors (16 MB)
sdb: assuming Write Enabled
sdb: assuming drive cache: write through
sdb: sdb1 sdb2 sdb3 sdb4
Attached scsi removable disk sdb at scsi2, channel 0, id 0, lun 1 Attached scsi generic sg1 at scsi2, channel 0, id 0, lun 1, type 0
Vendor: Zynet Model: USB Storage-MMC Rev: I03A
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdc at scsi2, channel 0, id 0, lun 2 Attached scsi generic sg2 at scsi2, channel 0, id 0, lun 2, type 0
Vendor: Zynet Model: USB Storage-MSC Rev: I03A
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdd at scsi2, channel 0, id 0, lun 3 Attached scsi generic sg3 at scsi2, channel 0, id 0, lun 3, type 0
WARNING: USB Mass Storage data integrity not assured
USB Mass Storage device found at 4

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#7 lore raw
In reply to Michal Čihař
Quoted 5 lines · Michal Èihaø

21: BUS="scsi", SYSFS{vendor}="Apacer ", SYSFS{model}="Mega Steno ",
PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

Why does every time match another rule?

Yeah, It's a bug in the trailin whitespace removal. We mangle the attribut evalue while we compare it and libsysfs reuses it :(

Just remove your trailing whitespace from "Apacer " and please tell me if it works. Anyway I will fix it soon.

thanks for pointing this out,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#8 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 1 line · Kay Sievers

Whats in dmesg? I have the following for my cheap 4slot-reader:

[connect reader]

USB Mass Storage device found at 21
usb 1-2: USB disconnect, address 21
usb 1-2: new full speed USB device using address 22 scsi34 : SCSI emulation for USB Mass Storage devices
Vendor: Apacer Model: Mega Steno Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi34, channel 0, id 0, lun 0
Vendor: Apacer Model: Mega Steno Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi34, channel 0, id 0, lun 1
Vendor: Apacer Model: Mega Steno Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdc at scsi34, channel 0, id 0, lun 2
WARNING: USB Mass Storage data integrity not assured

[now I read from /dev/sda]

USB Mass Storage device found at 22
SCSI device sda: 15680 512-byte hdwr sectors (8 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through SCSI device sda: 15680 512-byte hdwr sectors (8 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
sda: sda1

Quoted 1 line

sdb: Spinning up disk....ready

This doesn't happen to me. Related kernel code is in drivers/scsi/sd.c:

                /*
                 * If manual intervention is required, or this is an
                 * absent USB storage device, a spinup is meaningless.
                 */
                if (SRpnt->sr_sense_buffer[2] = NOT_READY &&
                    SRpnt->sr_sense_buffer[12] = 4 /* not ready */ &&
                    SRpnt->sr_sense_buffer[13] = 3) {
                        break;          /* manual intervention required */

                /*
                 * Issue command to spin up drive when not ready
                 */
                } else if (SRpnt->sr_sense_buffer[2] = NOT_READY) {
                        unsigned long time1;
                        if (!spintime) {
                                printk(KERN_NOTICE "%s: Spinning up disk...",
                                       diskname);
                }

- --
Regards
Michal Èihaø
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASy/H3DVS6DbnVgQRAnbcAJsHzcFoiAYs1+Vv3zBvhr18ftnlIQCgqZxv UHJPF3qYs7be1Unn8iqReQE=/Dn5
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#9 lore raw
In reply to Michal Čihař
Quoted 48 lines · Michal Èihaø

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 1 line · Kay Sievers

Whats in dmesg? I have the following for my cheap 4slot-reader:

[connect reader]

USB Mass Storage device found at 21
usb 1-2: USB disconnect, address 21
usb 1-2: new full speed USB device using address 22 scsi34 : SCSI emulation for USB Mass Storage devices
Vendor: Apacer Model: Mega Steno Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sda at scsi34, channel 0, id 0, lun 0
Vendor: Apacer Model: Mega Steno Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi34, channel 0, id 0, lun 1
Vendor: Apacer Model: Mega Steno Rev: 1.03
Type: Direct-Access ANSI SCSI revision: 02
Attached scsi removable disk sdc at scsi34, channel 0, id 0, lun 2
WARNING: USB Mass Storage data integrity not assured

[now I read from /dev/sda]

USB Mass Storage device found at 22
SCSI device sda: 15680 512-byte hdwr sectors (8 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through SCSI device sda: 15680 512-byte hdwr sectors (8 MB)
sda: assuming Write Enabled
sda: assuming drive cache: write through
sda: sda1

Quoted 1 line

sdb: Spinning up disk....ready

This doesn't happen to me. Related kernel code is in drivers/scsi/sd.c:

                /*
                 * If manual intervention is required, or this is an
                 * absent USB storage device, a spinup is meaningless.
                 */
                if (SRpnt->sr_sense_buffer[2] = NOT_READY &&
                    SRpnt->sr_sense_buffer[12] = 4 /* not ready */ &&
                    SRpnt->sr_sense_buffer[13] = 3) {
                        break;          /* manual intervention required */

                /*
Quoted 9 lines
                 * Issue command to spin up drive when not ready
                 */
                } else if (SRpnt->sr_sense_buffer[2] = NOT_READY) {
                        unsigned long time1;
                        if (!spintime) {
                                printk(KERN_NOTICE "%s: Spinning up disk...",
                                       diskname);
                }

Ah, nice to know.
You may access you device with your apacer.sh to revalidate. (?) Just create a temporary node, access and remove it.

Kay

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#10 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Kay Sievers
Quoted 4 lines · Michal Èihaø

21: BUS="scsi", SYSFS{vendor}="Apacer ", SYSFS{model}="Mega Steno ", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

Quoted 8 lines
Quoted 1 line

Why does every time match another rule?

Yeah, It's a bug in the trailin whitespace removal. We mangle the attribut evalue while we compare it and libsysfs reuses it :(

Just remove your trailing whitespace from "Apacer " and please tell me if it works. Anyway I will fix it soon.

When I leave just:

BUS="scsi", SYSFS{vendor}="Apacer", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

It still behaves very non determinantely, sometimes it catches all three slots, sometimes just one :-(. This doesn't depend whether there is another rule that will catch this device.

Same happens when I try to match it on serial number (AFAIK no trailing space):

BUS="usb", SYSFS_serial="19220DA1018B", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

- --
Regards
Michal Èihaø
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASzHy3DVS6DbnVgQRAjjdAJ9mW+G6v+3+B/8LKAaDE1kKkZG0/wCg8blT nKjlEfGFPollKnBnA53dswM=jcWO
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#11 lore raw
In reply to Michal Čihař
Quoted 27 lines · Michal Èihaø

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 5 lines · Kay Sievers
Quoted 4 lines · Michal Èihaø

21: BUS="scsi", SYSFS{vendor}="Apacer ", SYSFS{model}="Mega Steno ", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

Quoted 8 lines
Quoted 1 line

Why does every time match another rule?

Yeah, It's a bug in the trailin whitespace removal. We mangle the attribut evalue while we compare it and libsysfs reuses it :(

Just remove your trailing whitespace from "Apacer " and please tell me if it works. Anyway I will fix it soon.

When I leave just:

BUS="scsi", SYSFS{vendor}="Apacer", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

It still behaves very non determinantely, sometimes it catches all three slots, sometimes just one :-(. This doesn't depend whether there is another rule that will catch this device.

Quoted 5 lines

Same happens when I try to match it on serial number (AFAIK no trailing space):

BUS="usb", SYSFS_serial="19220DA1018B", PROGRAM="/etc/udev/apacer.sh %k %b %n", NAME="%c{1}", SYMLINK="%k %c{2} %c{3}"

If devices are missing, whats in sysfs '/sys/block/' at this time? You may use 'tree /sys/block' to look at it.

Hmm, if all devices are there, seems we need a udev version with debug enabled. Is it possible for you to build udev from the sources and run 'make DEBUG=true'?

Kay

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#12 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Michal Èihaø

It still behaves very non determinantely, sometimes it catches all three slots, sometimes just one :-(. This doesn't depend whether there is another rule that will catch this device.

And the apacer.sh script is always executed and always ends with exit 0.

- --
Regards
Michal Èihaø
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASzUu3DVS6DbnVgQRAqUhAJ9CnSaew6bLGICsAnGhil4eboX6vgCg8gpl 2Tsvorst+iMOaT8TXI5D/QU=LrlH
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#13 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Kay Sievers

Hmm, if all devices are there, seems we need a udev version with debug enabled. Is it possible for you to build udev from the sources and run 'make DEBUG=true'?

Wow, I didn't expect it is so much verbose :-)

The problem seems to be that udev thinks that program ended with nonzero. But I'm pretty sure it ends with exit 0...

- --
Regards
Michal Èihaø
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASzuW3DVS6DbnVgQRAimQAKDIjDFRzGzQgksJs9eHDBqqXZuDlwCdE2qc 6vq83vdHGI9jhuUTci6YeXQ=1PeY
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#14 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 2 lines · Michal Čihař

The problem seems to be that udev thinks that program ended with nonzero. But I'm pretty sure it ends with exit 0...

Okay, I found the solution, but not the problem - attached script works. It builds name and then echoes complete line, while the previous one echoed it by parts.

- --
Regards
Michal Čihař
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFASz+v3DVS6DbnVgQRAtA3AKCyMzcOS9iJI/cbUZ+d3O3MPf5OxwCfadKY Gcg0F1+iP+dni2b+99dBaqU=
=kr/L
-----END PGP SIGNATURE-----

#15 lore raw
In reply to Michal Čihař

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 3 lines · Michal Èihaø

Okay, I found the solution, but not the problem - attached script works. It builds name and then echoes complete line, while the previous one echoed it by parts.

execute_program in namedev.c doesn't handle correctly situation when it get line split into smaller pieces (it should IMHO concatenate it till EOF or \n), this leads to setting retval to -1, what is then returned. This doesn't happen always, as it depends when pipe buffer is read/written.

Debug log for this case:

match_rule: check PROGRAM
apply_format: format=k, string='/etc/udev/apacer.sh ', tail=' %b %n'
apply_format: substitute kernel name 'sdb'
apply_format: format=b, string='/etc/udev/apacer.sh sdb ', tail=' %n'
apply_format: substitute bus_id '57:0:0:1'
apply_format: format=n, string='/etc/udev/apacer.sh sdb 57:0:0:1 ', tail=''
execute_program: executing '/etc/udev/apacer.sh sdb 57:0:0:1 '
execute_program: execute program '/etc/udev/apacer.sh'
execute_program: result is 'cardreader-'
execute_program: result value already set
execute_program: result value already set
match_rule: PROGRAM returned nozero

- --
Regards
Michal Èihaø
http://cihar.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFAS0PJ3DVS6DbnVgQRAo0nAJ9WjVuX1G0ou3UC3LrkEGX09HNQZQCfVVPf HrihustikcY3nE+flge8/4w=BtCH
-----END PGP SIGNATURE-----

-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&opÌk
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#16 lore raw
In reply to Michal Čihař

is.

If it is legal, then I have a complaint...

This has happened to me twice now (three times if you count the twice yesterday while I was trying to dig my way out).

It would seem, that on a reboot (on the way down, on the way up, Im not sure) that udev proceeds to remove all files that were active at the time the system went down. I will assume that it created all of these files, so it thinks that it can remove them.

Now if it were doing this in a SEPARATE, isolated, file system, say /udev and not /dev, that would be fine. However doing it in /dev is disasterous. Some of these things existed before udev (re)created them.

It removed my /dev/hde? files from 0-7, just the ones I have mounted. It got /dev/console, so even if you get past the previous error, you get nailed again.
And it removed enough other files to make repair basically impossible.

Hey what ever happened to the MKNOD (?) script that used to be in UNIX systems? I dont see it in Fedora2. That would have helped in the repair.

I was able to tar over a /dev directory from a working partition on the same machine, but at this point I can bring up X11 for root, but not for myself as a user (sigh).

I had this same problem a couple of months ago, and just gave up and reinstalled the OS. I hate to do that as it may only take 30-45m to do the reinstall, but it takes another week to get everything configured back the way it was...

Needless to say, Im not going to use

        udev_root="/dev/"
        udev_db="/dev/.udev.tdb

again, anthough it sure makes life a lot simpler.

And, Im going to have to go and remove it from some machines at the lab, before disaster strikes there too.

Reg.Clemens
[email protected]

[ Side question: There is a .udev.tdb sub directory in an old /udev directory that hasnt been used since February. There is an empty .udev.tdb subdirectory in /dev . Any chance udev could have looked at /dev seen the empty subdirectory, and then looked in /udev ? GAKKK....

-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_ide95&alloc_id396&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#17 lore raw
In reply to Michal Čihař
Quoted 11 lines · On Mon, Apr 18, 2005 at 12:13:38PM -0600, [email protected] wrote:

is.

If it is legal, then I have a complaint...

This has happened to me twice now (three times if you count the twice yesterday while I was trying to dig my way out).

It would seem, that on a reboot (on the way down, on the way up, Im not sure) that udev proceeds to remove all files that were active at the time the system went down. I will assume that it created all of these files, so it thinks that it can remove them.

No, odds are /dev is mounted on a ram or tmpfs filesystem, which means the whole thing was thrown away when the machine was rebooted. udev did not remove anything on it's own.

Quoted 3 lines

Hey what ever happened to the MKNOD (?) script that used to be in UNIX systems? I dont see it in Fedora2. That would have helped in the repair.

Try asking the Fedora people, that's up to them, and how they package udev.

Quoted 4 lines

I had this same problem a couple of months ago, and just gave up and reinstalled the OS. I hate to do that as it may only take 30-45m to do the reinstall, but it takes another week to get everything configured back the way it was...

Sounds like you need to learn about backing stuff up :)

Quoted 9 lines

Needless to say, Im not going to use

        udev_root="/dev/"
        udev_db="/dev/.udev.tdb

again, anthough it sure makes life a lot simpler.

And, Im going to have to go and remove it from some machines at the lab, before disaster strikes there too.

Might I suggest a newer distro than Fedora2? Like one that actually implementes udev properly?

thanks,

greg k-h

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#18 lore raw
In reply to Michal Čihař
Quoted 2 lines · Greg KH

Might I suggest a newer distro than Fedora2? Like one that actually implementes udev properly?

Actually Fedora didn't start using udev before Fedora Core 3 IIRC.

Cheers,
David

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#19 lore raw
In reply to Michal Čihař
Quoted 5 lines · David Zeuthen
Quoted 2 lines · Greg KH

Might I suggest a newer distro than Fedora2? Like one that actually implementes udev properly?

Actually Fedora didn't start using udev before Fedora Core 3 IIRC.

My point exactly :)

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#20 lore raw
In reply to Michal Čihař
Quoted 8 lines · On Mon, Apr 18, 2005 at 12:13:38PM -0600, [email protected] wrote:
Quoted 7 lines

is.

If it is legal, then I have a complaint...

This has happened to me twice now (three times if you count the twice yesterday while I was trying to dig my way out).

Quoted 8 lines
Quoted 4 lines

It would seem, that on a reboot (on the way down, on the way up, Im not sure) that udev proceeds to remove all files that were active at the time the system went down. I will assume that it created all of these files, so it thinks that it can remove them.

No, odds are /dev is mounted on a ram or tmpfs filesystem, which means the whole thing was thrown away when the machine was rebooted. udev did not remove anything on it's own.

No, /dev is just part of the root file system. /dev/shm is on tempf, but thats irrevelant to the current problem. I had assumed that the only reason for udev to retain a database was so that it COULD do this.

As I noted, /dev/hde0-7 (which I mount) are gone, /dev/hde8-9 (which I dont) are still there. Very suspicious to me...

Quoted 8 lines
Quoted 4 lines

Hey what ever happened to the MKNOD (?) script that used to be in UNIX systems? I dont see it in Fedora2. That would have helped in the repair.

Try asking the Fedora people, that's up to them, and how they package udev.

Yes, I know, I was just asking the question.

Quoted 6 lines
Quoted 4 lines

I had this same problem a couple of months ago, and just gave up and reinstalled the OS. I hate to do that as it may only take 30-45m to do the reinstall, but it takes another week to get everything configured back the way it was...

Sounds like you need to learn about backing stuff up :)

Somehow, for the sorts of things that have happened, I wouldnt trust a backup to fix them.

Quoted 6 lines
Quoted 6 lines

Needless to say, Im not going to use

        udev_root="/dev/"
        udev_db="/dev/.udev.tdb
Quoted 8 lines
Quoted 4 lines

again, anthough it sure makes life a lot simpler.

And, Im going to have to go and remove it from some machines at the lab, before disaster strikes there too.

Might I suggest a newer distro than Fedora2? Like one that actually implementes udev properly?

OK, sorry, a few lines got truncated off my original message when I posted it. The original started with:
OK, Im having problems, and Im sure its UDEV that is doing the deed.

[Fedora 2 and the latest udev ]

First, is it legal to say

        udev_root="/dev/"
        udev_db="/dev/.udev.tdb

If not, there should be a BIG sign on the /udev.conf page saying not to do this.

If it is legal, ...

So, back to the original question. IS THIS LEGAL?

And, as I said there, Fedora2 + the most recently released udev.

Signature · 15 lines
                                        Reg.Clemens
                                        [email protected]




-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
#21 lore raw
In reply to Michal Čihař
Quoted 6 lines · On Mon, 2005-04-18 at 15:27 -0600, [email protected] wrote:
Quoted 1 line · On Mon, Apr 18, 2005 at 12:13:38PM -0600, [email protected] wrote:

OK, sorry, a few lines got truncated off my original message when I posted it. The original started with:
OK, Im having problems, and Im sure its UDEV that is doing the deed.

Quoted 6 lines

[Fedora 2 and the latest udev ]

First, is it legal to say

        udev_root="/dev/"
        udev_db="/dev/.udev.tdb

This is valid, sure. But that alone is not what you need to have it working as you expect.

Quoted 8 lines

If not, there should be a BIG sign on the /udev.conf page saying not to do this.

If it is legal, ...

So, back to the original question. IS THIS LEGAL?

And, as I said there, Fedora2 + the most recently released udev.

You may investigate how Red Hat integrates udev into its distribution
instead of making your own experiments:
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/i386/Fedora/RPMS/udev-056-2.i386.rpm

The system needs a lot of tweaking to work reliable with udev. It's not a simple download and install on an old system.

Good luck,
Kay

-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI. Version 11 adds new functionality designed to reduce time involved in creating, integrating, and deploying reporting solutions. Free runtime info, new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#22 lore raw
In reply to Michal Čihař
Quoted 4 lines

The system needs a lot of tweaking to work reliable with udev. It's not a simple download and install on an old system.

You would seem to be saying that the instructions in the udev README are not correct. Ive never seen that statement made before.

Ive been using udev since it was first released, and never had this problem till this spring.

Signature · 15 lines
                                        Reg.Clemens
                                        [email protected]




-------------------------------------------------------
This SF.Net email is sponsored by: New Crystal Reports XI.
Version 11 adds new functionality designed to reduce time involved in
creating, integrating, and deploying reporting solutions. Free runtime info,
new features, or free trial, at: http://www.businessobjects.com/devxi/728
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel