Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Make automounting work through hal/gnome-mount

#3

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)

Reported by Matt Colyer · March 24th, 2009 @ 03:21 AM

State: resolved
Milestone: 1.0 Release
Assigned to: nobody

Activity

  1. Matt Colyer
    Matt Colyer

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

    Seems to do the trick (as root)

    March 24th, 2009 @ 03:38 PM

  2. Paul Sladen
    Paul Sladen

    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.

    March 24th, 2009 @ 04:53 PM

  3. Paul Sladen
    Paul Sladen

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

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

    March 24th, 2009 @ 05:01 PM

  4. Matt Colyer
    Matt Colyer

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

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

    March 24th, 2009 @ 05:02 PM

  5. Matt Colyer
    Matt Colyer

    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.

    March 24th, 2009 @ 05:04 PM

  6. Paul Sladen
    Paul Sladen
    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.

    March 25th, 2009 @ 01:20 AM

  7. Matt Colyer
    Matt Colyer

    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.

    March 26th, 2009 @ 04:37 AM

  8. Matt Colyer
    Matt Colyer
    • 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.

    March 26th, 2009 @ 04:21 PM

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.