[OpenWrt-Devel] detecting USB sd card removal ("block info")

Karl Palsson karlp at tweak.net.au
Thu Jan 28 04:31:14 EST 2016


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Given that OpenWrt doesn't have a daemon like udisks to
mount/umount things automatically, I was trying to build it
myself by something like "block info" in a crontab.

"block info" correctly identifies when I insert an sd card into
slot on a fixed USB card reader on my device, and creates device
nodes, and if I remove the card, "block info" correctly notes
that the card is gone and removes the device nodes.

However, after "block mount" has mounted the sdcard (based on
config in /etc/config/fstab) "block info" now no longer notices
if the card has been removed. As far as I have been able to find,
the only way to make anything update is to explicitly "block
umount" which works correctly if the card _has_ been removed, but
if the card hasn't been removed, I've now unmounted for no reason
at all.

Should "block info" actually be detecting this properly? Is there
some other tool that is meant to be used for this?

This was with "block" from fstools version
2016-01-10-96415afecef35766332067f4205ef3b2c7561d21

Cheers,
Karl P

- -- 
Sent using Mailpile, Free Software from www.mailpile.is

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBAgAGBQJWqd/iAAoJEBmotQ/U1cr22jEP/2px3k1zmiuYtgfLqfTpRO03
gG59k5aQgSDEqGVmS3V+9EFIGZqFGzu3fbqD/1EucZH4U55DTZgIcS/g/yJA+zbF
kvAlvSjucj7bgWwTvNLFM3H3GQEFiduCCfQV3naYMLi/9oVW5rRh/0WNdWqq9wFS
HAgRknbSMzkEub/0AKzezzKUaoMJ9qC7o5wSizz7onXf0Kh4BtTvv6AozuKNtFkm
4EgMbAv9XM3a/1YOEUKoHpmMACocUef0Rjlv11WB18iC+3RtVnP6ylaHdwdRoJDS
P90wuHAQPYx8fVFP1XIHcsKvkP6so5jeRWUGJDMbM/gOo21M7HW9E0Xvc33tah41
oPuwZQeeioeDFeg44wvEwJJBU444bfQw8y4rIM+tPPCHzShggxMt52UBiaXTuOxC
UCv7/uH9o2+lT6btb/NMIsZMbwwbrDrnYkGh0xqxAbClel7/t+a/xG5Q08eGvdOk
LIUmRLe25BcajBFjectGYmjUmDrY4XPyiAcUHSt+ZKvRYy4vqX/p4DvwRvQrjKJ4
LRv14oRLZ0Kb8RUQvhGNhT4PMFDbVLEioEn3IzXziAgL1EAWEuqH1gt48q4y5AZl
UwIUOjaxEEeS74rvWQUsXA8y14TnezvlAkDuBJQZDEjkpbq6IkSItrOQmOexk9y2
ghNGDfSmWxGIU2ZDc0W7
=s6VP
-----END PGP SIGNATURE-----
-------------- next part --------------
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list