I've been trying to get automounting of USB devices working using the udev-extraconf recipe available in yocto. It appears to work in the mount.sh script, as I can read the contents of the drive. However, when I try to do so in a command shell, the folder is empty and the drive doesn't show as mounted. Also, even though it isn't mounted, if I remove the drive and connect it to a windows PC or any other machine, it claims that the file system is "dirty" and needs to be scanned.
In short, it is the *exact* same issue that's happening in this thread, but there isn't a resolution: https://lists.yoctoproject.org/pipermail/yocto/2015-September/026563.html I've attached the following files: automount.rules - udev automounting rules journalctl_output.txt - what the journalctl shows after an insertion mount.sh - my modified mount.sh script with the printfs mount.sh.log - output of the mount.sh script for an insertion and removal event udevadm.test.txt - output from the test output of what would be run for an insertion event udevadm_monitor.txt - live output of the monitor when inserting a usb stick. Any help would be greatly appreciated! ________________________________ This message (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. If you are not the intended recipient of this message, you are hereby notified that you must delete the message without disseminating, copying or taking any action in reliance upon it. If you have received this message in error, please notify the sender via return e-mail. Thank you.
mount.sh
Description: mount.sh
mount.sh.log
Description: mount.sh.log
root# udevadm test /sys/block/sda/sda1
calling: test
version 229
hwdb.bin does not exist, please run udevadm hwdb --update
Load module index
timestamp of '/etc/systemd/network' changed
timestamp of '/lib/systemd/network' changed
Parsed configuration file /lib/systemd/network/99-default.link
Created link configuration context.
timestamp of '/etc/udev/rules.d' changed
Reading rules file: /lib/udev/rules.d/50-firmware.rules
Reading rules file: /lib/udev/rules.d/50-udev-default.rules
Reading rules file: /lib/udev/rules.d/60-block.rules
Reading rules file: /lib/udev/rules.d/60-cdrom_id.rules
Reading rules file: /lib/udev/rules.d/60-drm.rules
Reading rules file: /lib/udev/rules.d/60-evdev.rules
Reading rules file: /lib/udev/rules.d/60-persistent-alsa.rules
Reading rules file: /lib/udev/rules.d/60-persistent-input.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage-tape.rules
Reading rules file: /lib/udev/rules.d/60-persistent-storage.rules
Reading rules file: /lib/udev/rules.d/60-persistent-v4l.rules
Reading rules file: /lib/udev/rules.d/60-serial.rules
Reading rules file: /lib/udev/rules.d/64-btrfs.rules
Reading rules file: /lib/udev/rules.d/70-mouse.rules
Reading rules file: /lib/udev/rules.d/70-power-switch.rules
Reading rules file: /lib/udev/rules.d/70-uaccess.rules
Reading rules file: /lib/udev/rules.d/71-seat.rules
Reading rules file: /lib/udev/rules.d/73-seat-late.rules
RUN{builtin}: 'uaccess' unknown /lib/udev/rules.d/73-seat-late.rules:15
Reading rules file: /lib/udev/rules.d/75-net-description.rules
Reading rules file: /lib/udev/rules.d/75-probe_mtd.rules
Reading rules file: /lib/udev/rules.d/78-sound-card.rules
Reading rules file: /lib/udev/rules.d/80-drivers.rules
Reading rules file: /lib/udev/rules.d/80-net-setup-link.rules
Reading rules file: /lib/udev/rules.d/90-vconsole.rules
Reading rules file: /lib/udev/rules.d/99-systemd.rules
Reading rules file: /etc/udev/rules.d/automount.rules
Reading rules file: /etc/udev/rules.d/autonet.rules
Reading rules file: /etc/udev/rules.d/localextra.rules
Reading rules file: /lib/udev/rules.d/res-touchscreen.rules
Reading rules file: /etc/udev/rules.d/touchscreen.rules
rules contain 24576 bytes tokens (2048 * 12 bytes), 10224 bytes strings
1301 strings (15744 bytes), 758 de-duplicated (6064 bytes), 544 trie nodes used
GROUP 6 /lib/udev/rules.d/50-udev-default.rules:55
LINK 'disk/by-id/usb-HP_v100w_UTa21142000465-0:0-part1'
/lib/udev/rules.d/60-persistent-storage.rules:37
LINK 'disk/by-path/platform-musb-hdrc.0.auto-usb-0:1:1.0-scsi-0:0:0:0-part1'
/lib/udev/rules.d/60-persistent-storage.rules:56
IMPORT builtin 'blkid' /lib/udev/rules.d/60-persistent-storage.rules:66
probe /dev/sda1 raid offset=0
LINK 'disk/by-uuid/0F1C-3842' /lib/udev/rules.d/60-persistent-storage.rules:69
LINK 'disk/by-label/UUI' /lib/udev/rules.d/60-persistent-storage.rules:70
RUN '/etc/udev/scripts/mount.sh' /etc/udev/rules.d/automount.rules:17
handling device node '/dev/sda1', devnum=b8:1, mode=0660, uid=0, gid=6
preserve permissions /dev/sda1, 060660, uid=0, gid=6
preserve already existing symlink '/dev/block/8:1' to '../sda1'
found 'b8:1' claiming
'/run/udev/links/\x2fdisk\x2fby-id\x2fusb-HP_v100w_UTa21142000465-0:0-part1'
creating link '/dev/disk/by-id/usb-HP_v100w_UTa21142000465-0:0-part1' to
'/dev/sda1'
preserve already existing symlink
'/dev/disk/by-id/usb-HP_v100w_UTa21142000465-0:0-part1' to '../../sda1'
found 'b8:1' claiming '/run/udev/links/\x2fdisk\x2fby-label\x2fUUI'
creating link '/dev/disk/by-label/UUI' to '/dev/sda1'
preserve already existing symlink '/dev/disk/by-label/UUI' to '../../sda1'
found 'b8:1' claiming
'/run/udev/links/\x2fdisk\x2fby-path\x2fplatform-musb-hdrc.0.auto-usb-0:1:1.0-scsi-0:0:0:0-part1'
creating link
'/dev/disk/by-path/platform-musb-hdrc.0.auto-usb-0:1:1.0-scsi-0:0:0:0-part1' to
'/dev/sda1'
preserve already existing symlink
'/dev/disk/by-path/platform-musb-hdrc.0.auto-usb-0:1:1.0-scsi-0:0:0:0-part1' to
'../../sda1'
found 'b8:1' claiming '/run/udev/links/\x2fdisk\x2fby-uuid\x2f0F1C-3842'
creating link '/dev/disk/by-uuid/0F1C-3842' to '/dev/sda1'
preserve already existing symlink '/dev/disk/by-uuid/0F1C-3842' to '../../sda1'
created db file '/run/udev/data/b8:1' for
'/devices/platform/ocp/47400000.usb/47401400.usb/musb-hdrc.0.auto/usb1/1-1/1-1:1.0/host1/target1:0:0/1:0:0:0/block/sda/sda1'
Unload module index
Unloaded link configuration context.
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
ACTION=add
DEVLINKS=/dev/disk/by-path/platform-musb-hdrc.0.auto-usb-0:1:1.0-scsi-0:0:0:0-part1
/dev/disk/by-uuid/0F1C-3842
/dev/disk/by-id/usb-HP_v100w_UTa21142000465-0:0-part1 /dev/disk/by-label/UUI
DEVNAME=/dev/sda1
DEVPATH=/devices/platform/ocp/47400000.usb/47401400.usb/musb-hdrc.0.auto/usb1/1-1/1-1:1.0/host1/target1:0:0/1:0:0:0/block/sda/sda1
DEVTYPE=partition
ID_BUS=usb
ID_FS_LABEL=UUI
ID_FS_LABEL_ENC=UUI
ID_FS_TYPE=vfat
ID_FS_USAGE=filesystem
ID_FS_UUID=0F1C-3842
ID_FS_UUID_ENC=0F1C-3842
ID_FS_VERSION=FAT32
ID_INSTANCE=0:0
ID_MODEL=v100w
ID_MODEL_ENC=v100w\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
ID_MODEL_ID=3207
ID_PART_ENTRY_DISK=8:0
ID_PART_ENTRY_FLAGS=0x80
ID_PART_ENTRY_NUMBER=1
ID_PART_ENTRY_OFFSET=128
ID_PART_ENTRY_SCHEME=dos
ID_PART_ENTRY_SIZE=7891840
ID_PART_ENTRY_TYPE=0xc
ID_PART_TABLE_TYPE=dos
ID_PATH=platform-musb-hdrc.0.auto-usb-0:1:1.0-scsi-0:0:0:0
ID_PATH_TAG=platform-musb-hdrc_0_auto-usb-0_1_1_0-scsi-0_0_0_0
ID_REVISION=0.00
ID_SERIAL=HP_v100w_UTa21142000465-0:0
ID_SERIAL_SHORT=UTa21142000465
ID_TYPE=disk
ID_USB_DRIVER=usb-storage
ID_USB_INTERFACES=:080650:
ID_USB_INTERFACE_NUM=00
ID_VENDOR=HP
ID_VENDOR_ENC=HP\x20\x20\x20\x20\x20\x20
ID_VENDOR_ID=03f0
MAJOR=8
MINOR=1
SUBSYSTEM=block
TAGS=:systemd:
USEC_INITIALIZED=555831161
run: '/etc/udev/scripts/mount.sh'
root@testbox:~# udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
[ 2990.859756] usb 2-1: new high-speed USB device number 3 using musb-hdrc
[ 2991.000977] usb 2-1: New USB device found, idVendor=03f0, idProduct=3207
[ 2991.008132] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2991.015754] usb 2-1: Product: v100w
[ 2991.019448] usb 2-1: Manufacturer: HP
[ 2991.023370] usb 2-1: SerialNumber: UTa21142000465
KERNEL[2990.964908] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1 (usb)
KERNEL[2990.9722[ 2991.042569] usb-storage 2-1:1.0: USB Mass Storage device
detected
28] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0
(usb)
[ 2991.077010] scsi host2: usb-storage 2-1:1.0
KERNEL[2991.012772] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2
(scsi)
KERNEL[2991.015094] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/scsi_host/host2
(scsi_host)
UDEV [2991.033719] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1 (usb)
UDEV [2991.042722] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0
(usb)
UDEV [2991.048431] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2
(scsi)
UDEV [2991.053243] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/scsi_host/host2
(scsi_host)
[ 2992.081516] scsi 2:0:0:0: Direct-Access HP v100w 0.00
PQ: 0 ANSI: 2
KERNEL[2992.022258] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0
(scsi)
KERNEL[2992.027169] add /devices/platform/ocp/4740[ 2992.105266] sd
2:0:0:0: [sda] 7892040 512-byte logical blocks: (4.04 GB/3.76 GiB)
0000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0
(scsi)
KERNEL[2992.029950] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/scsi_disk/2:0:0:0
(scsi_disk)[ 2992.135572] sd 2:0:0:0: [sda] Write Protect is off
KERNEL[2992.047841] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/scsi_device/2:0:0:0
(scsi_device)
UDEV [2992.063110] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/hos[
2992.165511] sd 2:0:0:0: [sda] Asking for cache data failed
t2/target2:0:0 (scsi)
UDEV [2992.079887] add [ 2992.175248] sd 2:0:0:0: [sda] Assuming drive cache:
write through
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0
(scsi)
UDEV [2992.094709] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/scsi_disk/2:0:0:0
(scsi_disk)
UDEV [2992.122963] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/scsi_device/2:0:0:0
(scsi_device)
KERNEL[2992.128014] add /devices/virtual/bdi/8:0 (bdi)
UDEV [2992.136837] add /devices/virtual/bdi/8:0 (bdi)
[ 2992.343878] sda: sda1
KERNEL[2992.277928] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0[
2992.355330] sd 2:0:0:0: [sda] Attached SCSI removable disk
/2:0:0:0/block/sda (block)
KERNEL[2992.281562] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/block/sda/sda1
(block)
UDEV [2993.042894] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/block/sda
(block)
UDEV [2993.418145] add
/devices/platform/ocp/47400000.usb/47401c00.usb/musb-hdrc.1.auto/usb2/2-1/2-1:1.0/host2/target2:0:0/2:0:0:0/block/sda/sda1
(block)
automount.rules
Description: automount.rules
Aug 01 13:45:53 testbox kernel: usb 2-1: new high-speed USB device number 2 using musb-hdrc Aug 01 13:45:53 testbox kernel: usb 2-1: New USB device found, idVendor=03f0, idProduct=3207 Aug 01 13:45:53 testbox kernel: usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Aug 01 13:45:53 testbox kernel: usb 2-1: Product: v100w Aug 01 13:45:53 testbox kernel: usb 2-1: Manufacturer: HP Aug 01 13:45:53 testbox kernel: usb 2-1: SerialNumber: UTa21142000465 Aug 01 13:45:53 testbox kernel: usb-storage 2-1:1.0: USB Mass Storage device detected Aug 01 13:45:53 testbox kernel: scsi host0: usb-storage 2-1:1.0 Aug 01 13:45:54 testbox kernel: [[0;1;39mscsi 0:0:0:0: Direct-Access HP v100w 0.00 PQ: 0 ANSI: 2[[0m Aug 01 13:45:54 testbox kernel: [[0;1;39msd 0:0:0:0: [sda] 7892040 512-byte logical blocks: (4.04 GB/3.76 GiB)[[0m Aug 01 13:45:54 testbox kernel: [[0;1;39msd 0:0:0:0: [sda] Write Protect is off[[0m Aug 01 13:45:54 testbox kernel: sd 0:0:0:0: [sda] Mode Sense: 00 00 00 00 Aug 01 13:45:54 testbox kernel: [[0;1;31msd 0:0:0:0: [sda] Asking for cache data failed[[0m Aug 01 13:45:54 testbox kernel: [[0;1;31msd 0:0:0:0: [sda] Assuming drive cache: write through[[0m Aug 01 13:45:54 testbox kernel: sda: sda1 Aug 01 13:45:54 testbox kernel: [[0;1;39msd 0:0:0:0: [sda] Attached SCSI removable disk[[0m Aug 01 13:45:55 testbox kernel: [[0;1;39mrandom: nonblocking pool is initialized[[0m Aug 01 13:45:55 testbox systemd-udevd[429]: [[0;1;39mProcess '/etc/udev/scripts/mount.sh' failed with exit code 1.[[0m Aug 01 13:45:55 testbox root[455]: [[0;1;39mmount.sh/automount Auto-mount of [/run/media/sda1] successful[[0m
-- _______________________________________________ yocto mailing list [email protected] https://lists.yoctoproject.org/listinfo/yocto
