How to auto run program in U disk when it plug in

Dear Sir,
I use Tx2 with Jetpack3.2 , I want to auto run the program in U disk when plug in. But I can’t know how to detect
U disk status when it plug in, I find both udev and mdev are not support in the system. How does ubuntu system detect and mount U disk? Is there any shell to do U disk mounting action? Thanks!

I am not familiar with udisk, but udev is supported. The problem is that most likely udev must be told to add a rule for your specific hardware (e.g., a USB device can be renamed to some specific name for a particular driver, but the rule must have been added).

Embedded systems rarely add all of the optional drivers a desktop PC adds. Odds are good that if your PC supports the device, then the addition of a package would support the device on a Jetson. In the case of your PC you probably have drivers for all kinds of network cards and graphics adapters and sound cards which you don’t have, and the extra disk space use doesn’t matter. Embedded systems will not typically have things which are not expected to be used (e.g., would you want drivers for Intel and AMD graphics cards?).

I recommend finding out what packages are used in desktop Ubuntu for this case. Then those can probably be added with a simple apt-get command.

Dear Linuxdev,
I had been porting mdev sucess in embedded linux without ubuntu system, But in tx2,I tried to add udev rules in /etc/udev/rules.d directory for udisk, but it can not work.

I have not set this up myself, but if you follow this and give details when something fails it can probably be debugged:
[url]Basic usage of udisks - Ask Ubuntu

Failure messages at any step along the way might indicate if the issue is driver, user space software, udev, so on. If you don’t have “/usr/bin/udisksctl”, then you’ll need to add package “udisks2”.

Hi Linuxdev,
Thanks!