#76 ✓resolved
Paulo Arruda

Error compiling libiphone

Reported by Paulo Arruda | September 27th, 2009 @ 05:51 PM

Hello! I have an iphone 3gs (3.1) and i was trying to mount it, but the ifuse from PPA repo doesnt work here, i cant mount the root filesystem. When i use the --afc2 option, it still mounts the MEDIA partition. But i found so many users saying that it works like a charm, then i decided to compile the project from source to see if it works.
Note: I use Ubuntu 9.04

I've followed the README to install libiphone, but im getting this error:

make

make all-recursive
make[1]: Entering directory /root/libiphone'<br/> Making all in src<br/> make[2]: Entering directory/root/libiphone/src'
/bin/bash ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -g -O2 -MT iphone.lo -MD -MP -MF .deps/iphone.Tpo -c -o iphone.lo iphone.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../include -Wall -Wextra -Wmissing-declarations -Wredundant-decls -Wshadow -Wpointer-arith -Wwrite-strings -Wswitch-default -Wno-unused-parameter -I/usr/local/include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -pthread -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/local/include -I/usr/include/libxml2 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -g -O2 -MT iphone.lo -MD -MP -MF .deps/iphone.Tpo -c iphone.c -fPIC -DPIC -o .libs/iphone.o
In file included from iphone.c:27:
/usr/local/include/usbmuxd.h:64: error: expected declaration specifiers or ‘...’ before ‘uint32_t’ /usr/local/include/usbmuxd.h:64: error: expected declaration specifiers or ‘...’ before ‘uint32_t’ /usr/local/include/usbmuxd.h:77: error: expected declaration specifiers or ‘...’ before ‘uint32_t’ /usr/local/include/usbmuxd.h:77: error: expected declaration specifiers or ‘...’ before ‘uint32_t’ /usr/local/include/usbmuxd.h:89: error: expected declaration specifiers or ‘...’ before ‘uint32_t’ /usr/local/include/usbmuxd.h:89: error: expected declaration specifiers or ‘...’ before ‘uint32_t’ iphone.c:33: warning: type defaults to ‘int’ in declaration of ‘usbmuxd_event_t’
iphone.c:33: error: expected ‘;’, ‘,’ or ‘)’ before ‘’ token
iphone.c: In function ‘iphone_event_subscribe’:
iphone.c:59: warning: implicit declaration of function ‘usbmuxd_subscribe’
iphone.c:59: error: ‘usbmux_event_cb’ undeclared (first use in this function)
iphone.c:59: error: (Each undeclared identifier is reported only once
iphone.c:59: error: for each function it appears in.)
iphone.c: In function ‘iphone_event_unsubscribe’:
iphone.c:77: warning: implicit declaration of function ‘usbmuxd_unsubscribe’
iphone.c: In function ‘iphone_get_device_list’:
iphone.c:96: error: ‘usbmuxd_device_info_t’ undeclared (first use in this function)
iphone.c:96: error: ‘dev_list’ undeclared (first use in this function)
iphone.c:101: warning: implicit declaration of function ‘usbmuxd_get_device_list’
iphone.c:114: warning: implicit declaration of function ‘usbmuxd_device_list_free’
iphone.c: In function ‘iphone_device_new’:
iphone.c:158: error: ‘usbmuxd_device_info_t’ undeclared (first use in this function)
iphone.c:158: error: expected ‘;’ before ‘muxdev’
iphone.c:159: warning: implicit declaration of function ‘usbmuxd_get_device_by_uuid’
iphone.c:159: error: ‘muxdev’ undeclared (first use in this function)
iphone.c: In function ‘iphone_device_send’:
iphone.c:274: error: too many arguments to function ‘usbmuxd_send’
iphone.c: In function ‘iphone_device_recv_timeout’:
iphone.c:308: error: too many arguments to function ‘usbmuxd_recv_timeout’
iphone.c: In function ‘iphone_device_recv’:
iphone.c:340: error: too many arguments to function ‘usbmuxd_recv’
make[2]:
[iphone.lo] Error 1
make[2]: Leaving directory /root/libiphone/src'<br/> make[1]: *** [all-recursive] Error 1<br/> make[1]: Leaving directory/root/libiphone'
make:
* [all] Error 2

Comments and changes to this ticket

  • Martin S.

    Martin S. October 8th, 2009 @ 08:52 AM

    • State changed from “new” to “open”
    • Tag set to api, build, gcc, libiphone
    • Assigned user set to “Martin S.”

    Which repositories did you clone from?

    I updated the sources on the "Home" page to the latest now http://libiphone.lighthouseapp.com/projects/27916/home

    Looks like your libusbmuxd is old.

  • Paulo Arruda

    Paulo Arruda October 9th, 2009 @ 09:30 PM

    Ok, i've downloaded again and i could compile everything... but now it doesnt detect my iphone...
    i compiled libiphone, usbmux, libplist and ifuse from the home page. I've ran ./iphonesync.py

    here is the output:

    root@pauloarruda:~/src/python-iphonesync# ./iphonesync.py
    Traceback (most recent call last):
    File "./iphonesync.py", line 3, in

    from libplist.PList import *
    

    ImportError: No module named libplist.PList
    root@pauloarruda:~/src/python-iphonesync#

    root@pauloarruda:/usr/lib# iphonesyslog
    usbmuxd_get_device_list: error opening socket!
    No device found, is it plugged in?
    root@pauloarruda:/usr/lib#

    It is plugged in!

    Thanks in advance

  • Martin S.

    Martin S. October 10th, 2009 @ 09:20 AM

    Check output of lsusb and post the usb vendor:product ids for the iPhone here (e.g. 05ac:1294).
    Then replug your device. We only spawn the usbmuxd daemon on hotplug/device-added events.

    "usbmuxd_get_device_list: error opening socket!" clearly shows that the usbmuxd daemon is not running and has not created the /var/run/usbmuxd socket.

    Regarding iphonesync, you must have the libplist and libiphone Python bindings installed. It appears those have not been built. Check your configure for those packages if the bindings were built and verify you have Python development packages installed.

    Do you have any security code set on the iPhone (parental or access)?
    If you test, try running "iphone_id -l". It lists connected devices.

  • Paulo Arruda

    Paulo Arruda October 10th, 2009 @ 02:18 PM

    Can you pass me the instructions to build libiphone and libplist with the python bindings?
    Yes, I do have python-dev package installed.
    I dont have the parental control activated.

    Is there a correct order to complile this packages?
    Im doing first usbmux, then libplist, then libiphone then ifuse.

    I will try again, cos im not familiar to this usbmux, i didnt know i had to start the daemon =/

  • Paulo Arruda

    Paulo Arruda October 10th, 2009 @ 03:38 PM

    Ok its working, i can use iphonesyslog and iphonesync.py
    Now, how do i get the hostID?
    I know i can find it as a file stored in /var/root/Library/Lockdown/pair_records/1A93D78F-00D655E22EE040367F.plist
    In that case 1A93D78F-00D655E22EE040367F would be the host id. I need it in order to put the usb ethernet driver to work! (ipheth)

    Just one more question, how do i mount the root filesystem? I found a how to saying that i should run /usr/local/bin/libiphone-initconf to generate some keys required to connect with the iPhone over USB, but i couldnt find this file... maybe this tutorial is old.

    root@paulo-laptop:~/src/ipheth/ipheth-pair# mount none -t fuse.ifuse /mnt/iPhone
    mount: wrong fs type, bad option, bad superblock on none,

       missing codepage or helper program, or other error
       (for several filesystems (e.g. nfs, cifs) you might
       need a /sbin/mount.<type> helper program)
       In some cases useful info is found in syslog - try
       dmesg | tail  or so
    

    Thanks!

  • Martin S.

    Martin S. October 10th, 2009 @ 04:46 PM

    Check ~/.config/libiphone/libiphonerc for the host id.
    I would be nice if you could report if ipheth works for you. I think it has some usb ids missing.

    The keys are now generated on the fly and one does not have to run libiphone-initconf anymore (that tool does not exist anymore).

    iFuse has now also been changed and you use it like other userspace FUSE filesystem drivers.
    As written in the README try "ifuse MOUNTPOINT". The method using regular mount command is no longer available (however can be emulated using a script or symlink). To mount the root filesystem use "ifuse --root MOUNTPOINT".

  • Paulo Arruda

    Paulo Arruda October 10th, 2009 @ 06:25 PM

    Thank you Martin! :D
    I'm posting using my iphone tethered :)
    I was trying to figure out this ID, it was the missing part!
    it wooorks :D
    ipheth project has a script called ipheth-pair.py that needs a variable to be set:

    host_id = "xxxxxxxxxx"

    im not a programmer, and i dont know anything about python stuff, but i found a function unused in the script called get_host_id that try to "guess" the host ID randomically. This is the part that is missing in order to the driver work OTB. Someone has to rewrite it to get the host id from the phone right?

    i will try to mount now and post here the results.

  • Paulo Arruda

    Paulo Arruda October 10th, 2009 @ 06:39 PM

    root@paulo-laptop:~# ifuse --root /mnt
    GNUTLS ERROR: A TLS packet with unexpected length was received.
    Failed to connect to lockdownd service on the device.
    Try again. If it still fails try rebooting your device.
    root@paulo-laptop:~#

    Even after reboot the phone!

    And nothing works anymore =/

    Do you think that i could have made a mess with this lib compling stuff?

  • Martin S.

    Martin S. October 10th, 2009 @ 11:23 PM

    ipheth-pair.py actually pairs the device with the host computer. The code is almost an exact rewrite of what happens within libiphone if it pairs a device with your computer.
    This is done once you execute any libiphone tool like iphoneinfo or iphonesyslog for example.
    Thus running ipheth-pair.py is no longer required and might actually mix things up.

    The host id is simply generated by libiphone if needed, not supplied by the iphone.
    It is saved in ~/.config/libiphone/libiphonerc by libiphone during the internal pairing process and stays the same.

    Regarding the GNUTLS error, replug the device and please post the output of "ifuse --debug --root /mnt".
    Mind that you should run everything as regular user now, no need to be root.

  • Martin S.

    Martin S. November 3rd, 2009 @ 11:23 AM

    • State changed from “open” to “resolved”

    Closing this one as resolved. Please try the latest sources.
    There are now also packages available for the latest releases.

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

Pages