cold-plugged usb flash drive not handled correctly in embedded system

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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=000,fmask=111 /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=0856-17AE
udevadm_test: run: '/bin/mount -t auto -o rw,noauto,flush,quiet,nodev,nosuid,exec,noatime,dmask=000,fmask=111 /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=000,fmask=111 /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

--
To unsubscribe from this list: send the line "unsubscribe linux-hotplug" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel]     [Linux DVB]     [Asterisk Internet PBX]     [DCCP]     [Netdev]     [X.org]     [Util Linux NG]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux