1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Will FreeBSD mount my iPhone?

Discussion in 'Peripheral Hardware' started by Anthie, May 16, 2013.

  1. Anthie

    Anthie New Member

    Messages:
    32
    Likes Received:
    0
    Will be there a driver for iPhone?
     
  2. drhowarddrfine

    drhowarddrfine Member

    Messages:
    1,046
    Likes Received:
    4
    Don't you need to ask Apple this?
     
  3. fonz

    fonz Moderator Staff Member Moderator

    Messages:
    2,443
    Likes Received:
    7
    If your iPhone has an SD card you can probably insert that into any card reader and mount it. Also, chances are that when you connect your iPhone to your computer using a USB cable, the entire phone is actually recognised as a USB drive, but I wouldn't know for sure because the only [Aa]pples I ever touch are the ones you can actually eat.
     
  4. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,011
    Likes Received:
    7
    Yes. Is possible. Install from ports sysutils/fusefs-ifuse and then run sudo ifuse -o allow_other <the folder path were you want to be mounted>. Worked for me and copied all my pictures from iPhone to my FreeBSD :)
     
  5. ccc

    ccc New Member

    Messages:
    609
    Likes Received:
    0
    I've installed sysutils/fusefs-ifuse from ports and now if I try to mount an iPhone 5 connecting via USB on my FreeBSD 8.3, then I get this error:
    Code:
    [CMD]# usbconfig[/CMD]
    ugen0.1: <UHCI root HUB VIA> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen1.1: <UHCI root HUB VIA> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen2.1: <UHCI root HUB VIA> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen3.1: <UHCI root HUB VIA> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen4.1: <EHCI root HUB VIA> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
    ugen0.2: <USB Multimedia Keyboard LITEON Technology> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
    ugen0.3: <Optical USB Mouse Logitech> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
    [HIGHLIGHT]ugen4.2: <iPhone Apple Inc.> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON[/HIGHLIGHT]
    
    [cmd]# ifuse -o allow_other /mnt/ipod[/cmd]
    [HIGHLIGHT]usbmuxd_get_device_list: error opening socket![/HIGHLIGHT]
    No device found, is it connected?
    If it is make sure that your user has permissions to access the raw usb device.
    If you're still having issues try unplugging the device and reconnecting it.
     
  6. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,011
    Likes Received:
    7
    Try as root or using sudo.
     
  7. ccc

    ccc New Member

    Messages:
    609
    Likes Received:
    0
    As root:
    Code:
    /root # ifuse -o allow_other /mnt/ipod
    fuse: failed to open fuse device: No such file or directory
    
    /root # ifuse -o allow_root /mnt/ipod
    fuse: failed to open fuse device: No such file or directory
    
     
  8. sk8harddiefast

    sk8harddiefast Member

    Messages:
    2,011
    Likes Received:
    7
    I'm not sure, but I think that when you do all this process, the iPhone must be unlocked. Try this and if it does not work even like this, tomorrow I will search to find out what happens.
     
  9. ccc

    ccc New Member

    Messages:
    609
    Likes Received:
    0
    Yep, I still get this problem:

    Code:
    /root # usbconfig
    ugen0.1: <UHCI root HUB VIA> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen1.1: <UHCI root HUB VIA> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen2.1: <UHCI root HUB VIA> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen3.1: <UHCI root HUB VIA> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen4.1: <EHCI root HUB VIA> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE
    ugen0.2: <USB Multimedia Keyboard LITEON Technology> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
    ugen0.3: <Optical USB Mouse Logitech> at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
    [HIGHLIGHT]ugen4.2: <iPhone Apple Inc.> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON[/HIGHLIGHT]
    
    /root # idevicepair unpair && idevicepair pair
    usbmuxd_get_device_list: error opening socket!
    No device found, is it plugged in?
    /root #
    
     
  10. ccc

    ccc New Member

    Messages:
    609
    Likes Received:
    0
    I've tried to mount an iPhone 5 on Linux (Debian/Wheezy) and it works well:
    Code:
    root@wheezy:~# ifuse /media/ipod
    root@wheezy:~# ls /media/ipod
    AirFair  Books	Downloads	PhotoData	  Purchases   Safari
    Airlock  DCIM	iTunes_Control	PhotoStreamsData  Recordings
    but I still cannot find a solution for FreeBSD.
     
  11. wblock@

    wblock@ Administrator Staff Member Administrator Moderator Developer

    Messages:
    11,245
    Likes Received:
    24
    Have you enabled FUSE in /etc/rc.conf, or at least loaded the kernel module?
     
  12. ccc

    ccc New Member

    Messages:
    609
    Likes Received:
    0
    I have already
    Code:
    fusefs_enable="YES"
    in /etc/rc.confand fuse.ko is loaded:

    Code:
    /root # kldstat
    Id Refs Address    Size     Name
     1   26 0xc0400000 c68d94   kernel
     2    1 0xc1069000 8190     snd_via8233.ko
     3    2 0xc1072000 57908    sound.ko
     4    1 0xc5ebb000 8000     linprocfs.ko
     5    1 0xc5ec3000 28000    linux.ko
     6    1 0xc6267000 e000     [HIGHLIGHT]fuse.ko[/HIGHLIGHT]
     7    1 0xc6388000 68000    radeon.ko
     8    1 0xc63f1000 14000    drm.ko
    but still it doesn't work.
     
  13. KNOStic

    KNOStic New Member

    Messages:
    77
    Likes Received:
    0
    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
    Code:
    fusefs_enable="YES"
    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! :)