#3 ✓resolved
Matt Colyer

Make automounting work through hal/gnome-mount

Reported by Matt Colyer | March 24th, 2009 @ 03:21 AM | in 1.0 Release

So I attempted to do this before. The trick is that you need the iPhone to enumerate in configuration 3 otherwise it will confuse gnome-mount when you change configuration as it is trying to mount the device.

I had a brief email exchange with Greg KH who suggested:

There is a sysfs file that you can write to to change the config, right? So, from a udev rule, run a script that writes to that file.

Instead of my silly iphone-module solution (a kernel driver which just forces the device to configuration 3)

Comments and changes to this ticket

  • Matt Colyer

    Matt Colyer March 24th, 2009 @ 03:38 PM

    echo 3 > /sys/devices/pci0000:00/0000:00:1d.7/usb8/8-3/bConfigurationValue

    Seems to do the trick (as root)

  • Paul Sladen

    Paul Sladen March 24th, 2009 @ 04:53 PM

    I have a udev for usbmuxd starting/stopping that I was about to transfer across to doing this.

    It turns out that as libusb uses RAW usb socket access, if the configuration is changed then the kernel sysfs and udev tree because out of sync.

    ATTR{bConfigurationValue}=3

    should be what's necessary from udev. Then a second rule can match on the appearance of endpoints 4/85 and start usbmuxd, then (to be worked out), ifuse needs to start on the basis of /var/run/usbmuxd appearing.

  • Paul Sladen

    Paul Sladen March 24th, 2009 @ 05:01 PM

    For reference, the Launchpad bug regarding the out-of-syncness:

    "sync libusb usb_set_configuration() + sysfs .../bConfigurationValue" http://launchpad.net/bugs/347405

  • Matt Colyer

    Matt Colyer March 24th, 2009 @ 05:02 PM

    My first stab at this, the FDI file now needs to be modified to match this.

    http://github.com/MattColyer/lib...

  • Matt Colyer

    Matt Colyer March 24th, 2009 @ 05:04 PM

    Ohh I like your solution much better Paul.

    I didn't see it until I committed, I'll go ahead and back out the script and use your command instead. It will probably be later though.

  • Paul Sladen

    Paul Sladen March 25th, 2009 @ 01:20 AM

    ATTR{idVendor}!="05ac", GOTO="usbmuxd_rules_end"
    
    # If it's plug insertion, flip it into dual "PTP + Apple Mobile Device" configuration
    # This allows another application to switch it later without it getting switched back (hopefully)
    # TODO: check iPod Touch/3G
    SUBSYSTEM=="usb", ACTION=="add", ATTR{product}=="iPhone", ATTR{bConfigurationValue}!="3", ATTR{bConfigurationValue}="3", GOTO="usbmuxd_rules_end"
    ...
    LABEL="usbmuxd_rules_end"
    

    Is what I currently have here. The rest loads/unloads usbmuxd etc.

    Gah, bug tracker, why will it not just display text as normal fixed with text.

  • Matt Colyer

    Matt Colyer March 26th, 2009 @ 04:37 AM

    Committed the fix for using udev instead of the script. I am thinking that iFuse should still be set to automount through the gnome-mount stuff (through hal).

    When usbmux is integrated, ifuse can poll to see if the daemon is up or start it if it isn't running.

  • Matt Colyer

    Matt Colyer March 26th, 2009 @ 04:21 PM

    • State changed from “new” to “resolved”

    I just committed a fully working implementation of automounting. However the github integration was broken from changing urls. That should be fixed up now.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

A project around supporting the iPhone in Linux.

See http://libimobiledevice.org

People watching this ticket

Tags

Referenced by

Pages