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

USBIP 0.1.7 running on NAS200

Discussion in 'Cisco/Linksys Network Storage Devices' started by jackito, Jul 22, 2010.

  1. jackito

    jackito LI Guru Member

    Yesterday I was able to compile USBIP 0.1.7 for the NAS200.
    Right now, the kernel modules are loading and the usbip daemon also without any errors.
    I was able to export USB devices connected to the NAS200 successfully.
    The problem is that trying to import any device from a Windows machine (using USBIP Windows driver, tried with Windows XP and Vista) seems to be ok, the new usb device appears in the Device Manager, BUT when the OS try to load the drivers for that device (I ran the tests with a storage device and a Canon scanner) it fails and the device remains with an exclamation mark next to it in the Device Manager.

    Compilation details

    From USBIP sources README file:

    My compilation enviroment:

    - kernel = 2.6.19
    - gcc = 3.3.4
    - libglib2.0 = 2.2.3
    - automake = 1.8.2
    - autoconf = 2.59
    - libsysfs = 2.0.1

    As you can see automake, gcc and libglib are older than what the package claims as needed. Even doe kernel modules compiled and loaded in the NAS200 successfully.
    The problem came when I tried to compile the user-space tools (usbipd, usbip and bind_driver).
    While running the autogen.sh script to create the configure script I got a few warnings but still the scripts were created successfully. I guess this is because the automake version I used was older than expected.
    Of course, while running the configure script (with the --without-tcp-wrappers parameter since I wanted to go as simple as possible), the script ended while checking glib version. Expected 2.6.0, found 2.2.3.
    I edited the configure script to expect glib version 2.2.3 and ran it again, with successfull results.
    After that I ran make which failed while trying to compile bind_driver.c because of an undefined function g_debug. I googled for it and found that this function is in charge of writing debug messages and is available since glib 2.6.0 so I decided to comment out this "debug code" and try to compile again. This time the compilation was successfull. And I installed the modules, libraries and binaries in the NAS200.

    Now the problem is that since is not working for me and I don´t get any error messages in the usbipd log or the kernel log, I´m not sure if it´s because there are no errors or I don´t get them because the 3 debug code lines I commented out in the sources.

    Also I must say that I only tried to connect with the Windows client since I don´t have any GNU/Linux machine to try it. Maybe it´s only a Windows client issue and not a server side issue. Who knows...

    If somebody wants to give it a try I can supply a tarball with the binaries, kernel modules and libraries needed.

    Let me know if somebody wants to help on get this runnning.
    Thanks,

    jackito
     
  2. morgan_greywolf

    morgan_greywolf Addicted to LI Member

    Wow. That was fast, jackito. ;) Just write your own replacement for g_debug. Here's the spec from the GNOME libraries. In the absolute worst case, just take whatever messages the 3 debug lines were logging and write a function that logs them to a text file somewhere or to stderr or stdout. (hint: the formatted message is the only parameter passed to g_debug.)
     
  3. jackito

    jackito LI Guru Member

    About the link, that´s the paper I found yesterday and helped me to understand what this function is doing and encourage me to comment the lines. :)
    Thanks for the tip morgan but the problem is that my knowledge of C is null and I don´t have time to learn right now.
     
  4. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I'm traveling at this time but I will look into what's needed to get USBIP running on JAC4 when I get back next week. When I worked on another USB over IP program I think one of the problems was that the USB file system was missing. You may have to reconfigure the kernel to make it work...

    Apart from that, if you need a mechanism to run a program that needs an updated libc you may just want to take a look at the scripts I included with the JungleDisk Server download: basically the trick is to directly run ldlinux.so.2 with the correct parameters...

    ===Jac
     
  5. jac_goudsmit

    jac_goudsmit Super Moderator Staff Member Member

    I forgot to mention there's another potential pitfall: /sys is not mounted by the stock firmware or by my firmware although it is supported by the kernel. I think many USB programs use sysfs to determine what devices are on the USB bus.

    ===Jac
     
  6. jackito

    jackito LI Guru Member

    I mounted /sys for my tests jac. :)
    USBIP is detecting new devices and exporting them "correctly".
    But then when you try to connect at least the windows client is not working correctly (detects the new exported device but when it tries to initialize it, it fails) altrough maybe the GNU/Linux client will work, I´m not sure and I don´t have a GNU/Linux PC to test it (I´m using VMs to compile and so on).
    Anyway probably I´m missing something else in the kernel as you said.

    jackito
     
  7. jackito

    jackito LI Guru Member

    This afternoon I compiled a new kernel with USBFS support and USB debugging enabled.
    SYSFS mounted, USBFS mounted.
    Result: Same behavior (not working, no errors, anywhere). :frown:
     

Share This Page