linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cold-plugged usb flash drive not handled correctly in embedded
@ 2010-08-20 14:42 Wolfgang Wegner
  2010-08-20 14:51 ` cold-plugged usb flash drive not handled correctly in embedded system Kay Sievers
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Wolfgang Wegner @ 2010-08-20 14:42 UTC (permalink / raw)
  To: linux-hotplug

Hi list,

I am having a problem with udev on an embedded system and
am asking for advice on how to track this down. The system is
an ARM (kirkwood) platform with a busybox-based init. I cross-
compiled udev-161, made a simple udev start script (basically
ripped off from debian and stripped from most of the config
stuff) and a very basic rules file in
/etc/udev/rules.d/50-udev.rules:
ACTION="add", KERNEL="sd[a-z][0-9]", RUN+="/bin/mount -t auto -o rw,noauto,flush,quiet,nodev,nosuid,exec,noatime,dmask\00,fmask\x111 /dev/%k /mnt/usbdisk", OPTIONS="last_rule"
ACTION="remove", KERNEL="sd[a-z][0-9]", RUN+="/bin/umount -l /mnt/usbdisk"

It does not matter if I leave the standard rules in
/libexec/rules.d/ or if I remove them altogether, in either
case the USB flash drive is correctly mounted when plugged
into the running system but not when it is already present when
the system boots up.

I enabled debugging in udev, but have to admit I am a bit
overwhelmed by all the logging then. Here some parts which
seem to show that I did not make an obvious mistake:

udev reads correct rules file:
7.953380 [578] parse_file: reading '/etc/udev/rules.d/50-udev.rules' as rules file

Triggered by udevadm trigger, the device is correctly enumerated:
18.530148 [586] udev_device_new_from_syspath: device 0x40770 has devpath '/devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0/block/sda/sda1'
18.530268 [586] udev_rules_apply_to_event: LINK 'block/8:1' //libexec/rules.d/50-udev-default.rules:3
18.530343 [586] udev_rules_apply_to_event: GROUP 0 //libexec/rules.d/50-udev-default.rules:72
18.530490 [586] udev_device_new_from_syspath: device 0x3eb40 has devpath '/devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0/block/sda'
18.530894 [586] udev_device_read_db: device 0x3eb40 filled with db file data

But the mount is not executed.


When checking what would have to be done for this device manually,
the actions are correctly shown:

udevadm_test: DEVPATH=/devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/host2/target2:0:0/2:0:0:0/block/sda/sda1
[...]
udevadm_test: /dev/sda1: UUID\b56-17AE
udevadm_test: run: '/bin/mount -t auto -o rw,noauto,flush,quiet,nodev,nosuid,exec,noatime,dmask\00,fmask\x111 /dev/sda1 /mnt/usbdisk'


And removing the device also triggers the unmount:

405.042924 [623] udev_device_read_db: device 0x2b068 filled with db file data
405.043050 [623] udev_rules_apply_to_event: RUN '/bin/umount -l /mnt/usbdisk' /etc/udev/rules.d/50-udev.rules:8

while re-inserting finally also runs the mount:

417.490164 [623] udev_device_new_from_syspath: device 0x30148 has devpath '/devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/host3/target3:0:0/3:0:0:0/block/sda/sda1'
417.490282 [623] udev_rules_apply_to_event: LINK 'block/8:1' //libexec/rules.d/50-udev-default.rules:3
417.490358 [623] udev_rules_apply_to_event: GROUP 0 //libexec/rules.d/50-udev-default.rules:72
417.490408 [623] udev_rules_apply_to_event: RUN '/bin/mount -t auto -o rw,noauto,flush,quiet,nodev,nosuid,exec,noatime,dmask\00,fmask\x111 /dev/%k /mnt/usbdisk' /etc/udev/rules.d/50-udev.rules:6
417.490554 [623] udev_device_new_from_syspath: device 0x304a0 has devpath '/devices/platform/orion-ehci.0/usb1/1-1/1-1:1.0/host3/target3:0:0/3:0:0:0/block/sda'
417.490987 [623] udev_device_read_db: device 0x304a0 filled with db file data

Can anybody point me to where I have to look for the problem?
Which additional information is needed - if any - to give a
hint?

Thank you and best regards,
Wolfgang


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-23  7:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-20 14:42 cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-20 14:51 ` cold-plugged usb flash drive not handled correctly in embedded system Kay Sievers
2010-08-20 15:00 ` cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-20 15:19 ` Wolfgang Wegner
2010-08-20 15:29 ` Greg KH
2010-08-20 15:31 ` cold-plugged usb flash drive not handled correctly in embedded system Kay Sievers
2010-08-20 16:02 ` cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-20 16:12 ` Wolfgang Wegner
2010-08-20 16:25 ` Karl O. Pinc
2010-08-20 16:32 ` cold-plugged usb flash drive not handled correctly in embedded system Bryan Kadzban
2010-08-23  7:20 ` cold-plugged usb flash drive not handled correctly in embedded Wolfgang Wegner
2010-08-23  7:24 ` Wolfgang Wegner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).