Hi,
We are developing an application on a Toradex iMX7D SoM running TorizonCore with Weston, using Visual Studio Code with the Torizon IDE. Our application operates inside a Docker container.
Currently, we are focusing on USB device management (utilizing three USB ports), and our goal is to automatically mount USB devices to specific mount points. According to the Toradex documentation, all USB mass storage devices are mounted in /var/rootdirs/media/
with their respective UUID or LABEL in the directory name.
We have added this path /var/rootdirs/media/
to the volumes in order to access it through the container. However, we face a challenge: we cannot access directories beyond this path, which prevents us from reading or writing files to the USB devices.
We attempted to update the fstab
file with specific mount points, but this approach has not yielded the desired results due to the multiple connections of USB devices, which create numerous mount points (e.g., /dev/sda1
, /dev/sdb1
, /dev/sdc1
, …, /dev/sdh1
).
Additionally, we tried updating the udev rules to handle the addition and removal of USB devices by using systemd-mount
. However, this script creates duplicate mounting directories such as /media/usb0
, /media/usb1
, /media/usb2
, etc. Furthermore, it fails to identify the mount points for removing the directories after unmounting, resulting in errors.
Our Query…
- Is there a direct option to overwrite the rules for USB mounting so that the mount points are named sequentially (i.e.,
usb0
,usb1
,usb2
, …) instead of using UUID or LABEL? - Is there any way for the container to access any directory of the USB mount to read and write data?
Our main requirement is to access the three USB ports with their respective mount points effectively.
Software summary
Bootloader: U-Boot
Kernel version: 6.1.71-6.5.0+git.38fb82ecd144 #1-TorizonCore SMP Tue Dec 19 14:52:07 UTC 2023
Kernel command line: root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/b9a2dcf7fbf43a6103fa51110ba4e2541289013d869f8e87182cf862a2f2bedb/0 console=null
Distro name: NAME=“TorizonCore Upstream”
Distro version: VERSION_ID=6.5.0-build.8
Distro variant: VARIANT=“Docker”
Hostname: colibri-imx7-emmc-14952875
Hardware info
HW model: Toradex Colibri iMX7D 1GB (eMMC) on Colibri Evaluation Board V3
Toradex version: 0039 V1.1B
Serial number: 14952875
Processor arch: armv7l
Regards,
Saikrishna