Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

opi3 sdcard hotplug via udev, but fail. Why?

Featured Replies

I have move system to emmc, and want to use sdcard to storage videos from camera. So I want to sdcard can automount/umount after hotplug.

I have try to use udev to fulfill it. But it seems not work.

I add a rules for udev at /etc/udev/rules.d:

ACTION=="add",KERNEL=="mmcblk2p1",RUN+="/etc/udev/sdcard_hotplug.sh add /home/opi/Videos/sdcard %k"
ACTION=="remove",KERNEL=="mmcblk2p1",RUN+="/etc/udev/sdcard_hotplug.sh remove /home/opi/Videos/sdcard %k"

And add a shell file at /etc/udev/sdcard_hotplug.sh

#!/bin/bash
case $1 in
	add)
		mkdir -p $2
		mount -t exfat -o iocharset=utf8,rw,sync,umask=0000,dmask=0000,fmask=0000 /dev/$3 $2
		;;
	remove)
		umount $2
		rm -rf $2
		;;
esac

Add chmod a+x for it. Test it ok.

 

But udev seems not work!

I have use udev monitor to test if remove and insert sdcard can generate event. It works. 

And use udevadm test, and it also ok.

 

Anybody can help me?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.