udisks2 to the rescue.
basic usage i suppose.
here's my rule
/etc/udev/rules.d/99-mount-sd-card.rules
SUBSYSTEM=="block", ACTION=="remove", RUN+="/bin/sh -c 
'/home/scripts/sdunmounted'"
SUBSYSTEM=="block", ACTION=="add", RUN+="/bin/sh -c 
'/home/scripts/sdmounted'"

/home/scripts/sdmounted
mount -v /dev/mmcblk0p1 /media/sd-card

it is a closed, headless, embedded system. i believe the card should always 
appear as mmcblk0p1

my software detects a functioning card on boot,
but i guess it will notice it's not there during operation by failing.
or i could send a signal into my c code program that alerts it to it's 
removal? or insertion?
not sure how that would work without the c code polling something.

Thanks!
ciao,


On Friday, May 5, 2017 at 8:18:08 AM UTC-7, michael c wrote:
>
> Right, thanks. Knowing that, I should have remembered to mention it's on a 
> headless embedded system. Personal camera type, where the card can be 
> ripped in and out as people tend to do...
> Right now I search for a device with a uuid looking like xxxx-xxxx, and 
> then I can mount that I guess.
> There can never be any other device getting connected.
> But still concerned about detecting it's removal before a failure reveals 
> it.
> Set up a periodic polling function to check on its existence?
> Thanks,
> Michael
>
> On Fri, May 5, 2017, 7:47 AM Robert Nelson <[email protected]> 
> wrote:
>
>> On Thu, May 4, 2017 at 4:04 PM, michael c <[email protected]> wrote:
>> > I'm surprised to not see this addressed adequately anywhere, maybe it's
>> > unique to me, but i have never seen my BBB (4.4.62-ti-r99) with Ubuntu 
>> 16.04
>> > automount my sd-card. it mounts fine on boot when i execute.
>> > mount -v /dev/mmcblk0p1 /media/sd-card
>> > same FAT cards always work flawlessly on my notebook U16.04.
>> > i'm using eMMC for booting.
>> > and since this is a camera type product a UUID on the sd-card won't 
>> work.
>> > any card could be plugged, and un-plugged at any time.
>> >
>> > im reading about fstab and autofs but don't see a clear path to dynamic 
>> plug
>> > and play sd-card mounting/unmounting.
>> >
>> > thanks, i must be missing something, still looking.
>>
>> "auto-mounting" is normally done by the window gui (gnome/kde/lxqt).
>>
>> Regards,
>>
>> --
>> Robert Nelson
>> https://rcn-ee.com/
>>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/cd0fb612-5b43-43a5-923a-7229ba3b5f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to