Apparently the device will only be rescanned ("retasted") when a write request is issued to the device, so a manual workaround is to issue the following command after the phone has switched to "Memory card access" mode:
dd count=0 if=/dev/null of=/dev/da0
To automate this, I created a small shell script that executes this "fake" write after a short delay, and added a devd rule to invoke this script when the usb device is detected:
/opt/DefySD.sh
#!/bin/sh ( /bin/sleep 3 && /bin/dd count=0 if=/dev/null of=/dev/$1 >/dev/null 2>/dev/null ) &
/usr/local/etc/devd/DefySD.conf
notify 200 { match "cdev" "da[0-9]+$"; match "system" "DEVFS"; match "subsystem" "CDEV"; match "type" "CREATE"; action "/opt/DefySD.sh $cdev"; };
After restarting devd, I could auto-mount my SD card from KDE like any other "normal" USB stick.
No comments:
Post a Comment