I can help here, I've even written a script for it as well as a
devd configuration file for all sorts of iDevices to load automagically. But before I do, just ensure that you have
/usr/local/sbin/usbmuxd loading in your
rc.local file - that needs to load first, then you need to also have
in your
rc.conf.
The
ifuse library wants to run as user rather than root as well as I discovered the hard way when you make those calls, but it is absolutely necessary to have the device unlocked first before you connect it to the USB port. With these measures, it should work for you as it does reliably for me.
If anyone is interested in the
fruits.conf file that I wrote up to notify a script to run to automount as well as configure the
ue0 Ethernet device within is here:
Code:
#
# $FreeBSD: release/9.1.0/etc/devd/fruits.conf 000044 2013-03-19 07:06:00Z kmcaleavey $
#
# Discover, mount, unmount newer iFruit products. Adds to usb.conf. Requires iphone script from KNOS Project
#
notify 20 {
match "system" "USB";
match "subsystem" "DEVICE";
match "type" "ATTACH";
match "vendor" "0x05ac";
match "product" "(0x1290|0x1292|0x1294|0x1297|0x129c|0x12a0|0x12a8|0x1291|0x1293|0x1299|0x129e|0x129a|0x129f|0x12a2|0x12a3|0x12a4|0x12a5|0x12a6|0x12a7|0x12a9|0x12ad)";
action "su -m KNOS -c 'bash /var/home/KNOS/iphone'";
};
notify 20 {
match "system" "USB";
match "subsystem" "DEVICE";
match "type" "DETACH";
match "vendor" "0x05ac";
match "product" "(0x1290|0x1292|0x1294|0x1297|0x129c|0x12a0|0x12a8|0x1291|0x1293|0x1299|0x129e|0x129a|0x129f|0x12a2|0x12a3|0x12a4|0x12a5|0x12a6|0x12a7|0x12a9|0x12ad)";
action ""su -m KNOS -c 'bash /var/home/KNOS/iphone umount'";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
match "product" "0x129c";
match "intclass" "0xff";
match "intsubclass" "0xfd";
match "intprotocol" "0x01";
action "kldload -n if_ipheth";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
match "product" "0x12a0";
match "intclass" "0xff";
match "intsubclass" "0xfd";
match "intprotocol" "0x01";
action "kldload -n if_ipheth";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
match "product" "0x12a8";
match "intclass" "0xff";
match "intsubclass" "0xfd";
match "intprotocol" "0x01";
action "kldload -n if_ipheth";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
match "product" "0x12a2";
match "intclass" "0xff";
match "intsubclass" "0xfd";
match "intprotocol" "0x01";
action "kldload -n if_ipheth";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
match "product" "0x12a3";
match "intclass" "0xff";
match "intsubclass" "0xfd";
match "intprotocol" "0x01";
action "kldload -n if_ipheth";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
match "product" "0x12a5";
match "intclass" "0xff";
match "intsubclass" "0xfd";
match "intprotocol" "0x01";
action "kldload -n if_ipheth";
};
nomatch 32 {
match "bus" "uhub[0-9]+";
match "mode" "host";
match "vendor" "0x05ac";
match "product" "0x12a6";
match "intclass" "0xff";
match "intsubclass" "0xfd";
match "intprotocol" "0x01";
action "kldload -n if_ipheth";
};
Simply place this
fruits.conf into your
/etc/devd directory and it will control mounting and unmounting automagically for you by calling a script which you will need to write (shown below) for it to call.
PLEASE NOTE: The script called "
/var/home/KNOS/iphone" above needs to be replaced with YOUR script to do the calls.
My
iphone script (called by the above) is as follows:
Code:
#!/bin/sh
#
# Copyright (c) Kevin McAleavey 2007, 2009 - 2013
#
DISCONNECT="$1"
if [ "$DISCONNECT" = "umount" ] ; then
umount -f /media/AppleDevice
sleep 5
su -m root -c "rm -fd /media/AppleDevice"
logger "AppleDevice removed ..."
exit 0
else
logger "AppleDevice called here ..."
su -m root -c "mkdir -p /media/AppleDevice"
idevicepair unpair && idevicepair pair && idevicepair validate
if [ "$?" = "1" ] ; then
zenity --error --title "AppleDevice loader" --text="Device mount FAILED!!!\n\nCheck to be sure that the device is unlocked and turned on.\nPlease unplug it, wait 5 seconds, and try plugging it in again."
fi
su -m root -c 'chown KNOS /media/AppleDevice'
logger "AppleDevice call done ..."
sleep 2
ifuse /media/AppleDevice
if [ "$?" = "1" ] ; then
zenity --error --title "AppleDevice loader" --text="Device mount FAILED!!!\n\nCheck to be sure that the device is unlocked and turned on.\nPlease unplug it, wait 5 seconds, and try plugging it in again."
fi
fi
exit 0
All of this is used in the GNOME desktop on our machines and works magnificently in automounting it since the normal
gvfs system won't mount it on its own.
Hope this helps!