Driver Compilation Redhat
-
22-07-2019 - |
Question
I'm totally new to compiling drivers for linux and I got some problems !
I'm trying to compile a driver for a usb device.
Result:
[thayoz@lacalpc13 linux]$ make
for i in driver lib qrng ; do cd $i && (make all || exit ) && cd ..; done
make[1]: Entering directory /home/thayoz/Desktop/untitled folder/Quantis-USB/src/linux/driver'
make -C /usr/src/kernels/ M=/home/thayoz/Desktop/untitled folder/Quantis-USB/src/linux/driver V=1 modules
make[2]: Entering directory
/usr/src/kernels'
make[2]: * No rule to make target folder/Quantis-USB/src/linux/driver'. Stop.
make[2]: Leaving directory
/usr/src/kernels'
make[1]: * [all] Error 2
make[1]: Leaving directory `/home/thayoz/Desktop/untitled folder/Quantis-USB/src/linux/driver'
/bin/sh: line 0: cd: lib: No such file or directory
/bin/sh: line 0: cd: qrng: No such file or directory
make: *** [all] Error 1
I don't know what's wrong ???
Solution
Typically something like:
make -C <directory to kernel source> M=<directory to module/driver source> modules
make -C <directory to kernel source> M=<directory to module/driver source> modules_install
is sufficient.
Did your driver come with a makefile? Are you compiling against the proper kernel sources, the right version, for instance?
OTHER TIPS
I think that space in the path to your build directory might be causing the problem.
/home/thayoz/Desktop/untitled folder/Quantis-USB...
Notice the space in 'untitled folder'.
It looks like make is taking the module directory as:
/home/thayoz/Desktop/untitled
And:
folder/Quantis-USB/src/linux/driver
is getting passed to make as an additional argument (probably a target to be built).
Try renaming '/home/thayoz/Desktop/untitled folder' to '/home/thayoz/Desktop/untitledfolder' and see what happens.
My understanding of the general procedure for building a piece of software packaged using the GNU build system is:
- Run the .configure script. This script checks the build environment on your system, ensuring all the required executables, libraries etc are available and creates a working Makefile.
- Run make. This uses the Makefile generated in step 1 to build the binary.
- Run make install. This installs the binary into the correct location on the system.
Have you run the .configure script that came with the driver package?