-   Linux - Newbie (
-   -   building usbip on CentOS (

ratcateme 04-24-2010 06:47 PM

building usbip on CentOS
I have been try for a while now to build this and I am not getting very far.
I have download the usbip-0.1.7.tar.gz from
I then followed to get a full kernel source.
then went to usbip-0.1.7/drivers/2.6.18 and issued the command


make KSOURCE=~/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.i686
but it failed with:

/home/scott/usbip-0.1.7/drivers/2.6.18/stub_rx.c:377: error: redefinition of 'usb_endpoint_xfer_bulk'
include/linux/usb.h:496: error: previous definition of 'usb_endpoint_xfer_bulk' was here
/home/scott/usbip-0.1.7/drivers/2.6.18/stub_rx.c:383: error: redefinition of 'usb_endpoint_xfer_control'
include/linux/usb.h:508: error: previous definition of 'usb_endpoint_xfer_control' was here
/home/scott/usbip-0.1.7/drivers/2.6.18/stub_rx.c:389: error: redefinition of 'usb_endpoint_xfer_int'
include/linux/usb.h:521: error: previous definition of 'usb_endpoint_xfer_int' was here
/home/scott/usbip-0.1.7/drivers/2.6.18/stub_rx.c:395: error: redefinition of 'usb_endpoint_xfer_isoc'
include/linux/usb.h:534: error: previous definition of 'usb_endpoint_xfer_isoc' was here
make[2]: *** [/home/scott/usbip-0.1.7/drivers/2.6.18/stub_rx.o] Error 1
make[1]: *** [_module_/home/scott/usbip-0.1.7/drivers/2.6.18] Error 2
make[1]: Leaving directory `/home/scott/rpmbuild/BUILD/kernel-2.6.18/linux-2.6.18.i686'
make: *** [default] Error 2

I have no clue where I have gone wrong I haven't compiled many things from source so I don't really know where to start looking for the problems.
Thanks Scott.

knudfl 04-26-2010 09:13 AM

The following worked ...
((A guess: 2.6.xx/ folders are for older than 2.6.18, head/ for 2.6.26 etc.)
( The head/ files works for !)) So 2.6.18 will be a combination :

cd usbip-0.1.7/drivers/2.6.21/
tar xvf linux-2.6.18.tar.bz2
(you can also use the hcd.h hub.h, you have in your source.)

# cp linux-2.6.18/drivers/usb/core/{hcd.h,hub.h} \

mkdir backup && mv stub_rx.c backup/ && cp ../head/stub_rx.c .
..... where the last period ( . ) means the current directory.

mkdir headers
cp linux-2.6.18/drivers/usb/core/{hcd.h,hub.h} headers/

make KSOURCE=/usr/src/kernels/2.6.18-128.1.14.el5-i686/
And ... usbip_common_mod.ko , usbip.ko , vhci-hcd.ko are created.

( Replace "-128.1.14.el5-i686" with your actual version
of the installed package 'kernel-devel' ).
Good luck ! .. :)

P.S. : The latest source : usbip/linux/trunk .....
svn co usbip
( Same procedure as in all the above. (headers/ folder can be omitted.))

PPS.: Updating usbip-0.1.7 to usbip-0.1.7-3 :
> usbip_0.1.7-3.diff.gz
cd usbip-0.1.7/ && patch -p1 < usbip_0.1.7-3.diff
.. And again, the same procedure.

All times are GMT -5. The time now is 01:58 PM.