LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Puppy (https://www.linuxquestions.org/questions/puppy-71/)
-   -   need kernel headers to install fxload, no /linux directory (https://www.linuxquestions.org/questions/puppy-71/need-kernel-headers-to-install-fxload-no-linux-directory-741332/)

lp rob1 07-20-2009 03:20 AM

need kernel headers to install fxload, no /linux directory
 
i have been trying to install fxload-2008_10_13 for midisport firmware, which requires it. the make command results in the following:

# make
cc -c -O -Wall ezusb.c -o ezusb.o
ezusb.c:33:29: error: linux/usb/ch9.h No such file or directory
ezusb.c: In function 'ezusb_read':
ezusb.c:198: error: 'USB_DIR_IN' undeclared (first use in this function)
ezusb.c:198: error: (Each undeclared identifier is reported only once
ezusb.c:198: error: for each function it appears in.)
ezusb.c:198: error: 'USB_TYPE_VENDOR' undeclared (first use in this function)
ezusb.c:198: error: 'USB_RECIP_DEVICE' undeclared (first use in this function)
ezusb.c: In function 'ezusb_write':
ezusb.c:226: error: 'USB_DIR_OUT' undeclared (first use in this function)
ezusb.c:226: error: 'USB_TYPE_VENDOR' undeclared (first use in this function)
ezusb.c:226: error: 'USB_RECIP_DEVICE' undeclared (first use in this function)
ezusb.c: In function 'ezusb_cpucs':
ezusb.c:253: error: 'USB_DIR_OUT' undeclared (first use in this function)
ezusb.c:253: error: 'USB_TYPE_VENDOR' undeclared (first use in this function)
ezusb.c:253: error: 'USB_RECIP_DEVICE' undeclared (first use in this function)
make: *** [ezusb.o] Error 1

there is no such directory as /linux, so what do i do? i have found out that i need kernel headers, from where? i am confused :confused:

colucix 07-21-2009 02:26 AM

I never tried Puppy, but I found a link where it explains how to install the kernel sources. All the related download links work. Here it is: http://puppy.cnbits.com/node/129 (see the section Prepare the kernel source).

lp rob1 07-21-2009 09:36 AM

fixed
 
yes!!! i installed the source as you suggested, but that didnt help. after changing the directory of ch9.h from /linux/include/linux/usb/ to /linux/usb/, i then modified ezusb.c in fxload to point to /linux/usb/ch9.h, not linux/usb/ch9.h. thanks colucix! oh, and i also searched for ch9.h, it appeared as /usr/include/linux/usb_ch9.h

so, if anyone out there wants to install fxload onto puppy linux, here is what you do:

1. download the fxload source (how else would you install it?)
2. extract the files into your installation directory. i recommend /usr/lib/fxload. here is how you do it through terminal. i will make some assumptions, you downloaded the file fxload-2008_10_13.tar.gz into /root/downloads/:
# mkdir /usr/lib/fxload
# cd /root/downloads
# tar -C /usr/lib/fxload -zxvf fxload-2008_10_13.tar.gz

this will create a directory called fxload-2008_10_13.
3. get ch9.h and put it into /linux/usb/:
# mkdir /linux
# mkdir /linux/usb
# cd /linux/usb
# cp /usr/include/linux/usb_ch9.h /linux/usb
# rename usb_ch9.h ch9.h

you now have /linux/usb/ch9.h
4. go to /usr/lib/fxload/fxload-2008_10_13, then right-click on ezusb.c with a text editor. search for 'ch9.h' you will see something like this:
# include <linux/version.h>
# include <linux/usb/ch9.h>
# include <linux/usbdevice_fs.h>

change the middle line to read this:
# include <linux/version.h>
# include </linux/usb/ch9.h>
# include <linux/usbdevice_fs.h>

5. back in the terminal window, we need to compile fxload:
# cd /usr/lib/fxload/fxload-2008_10_13
# make

if all goes well, you should see no errors, maybe one warning but as long as there are no errors, everything is ok.
6. last step. we need to install fxload.
# make install

so, fxload should be installed!
btw, colucix should take some of the credit, what for, im not sure. but still

colucix 07-21-2009 09:43 AM

Quote:

Originally Posted by lp rob1 (Post 3615254)
btw, colucix should take some of the credit, what for, im not sure. but still

He he he... I'm not sure, too... thanks anyway! Glad to see it works now! :)

Berwyn 06-03-2010 10:03 PM

Easier way
 
Hi lp_rob,

That's complicated (but it does work, thanks!).

An easier way is to simply untar the fxload tgz and simply replace the following line of ezusb.c
Code:

include <linux/usb/ch9.h>
with
Code:

include </usr/include/linux/usb_ch9.h>
then "make install"


All times are GMT -5. The time now is 03:34 PM.