WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Unable to build driver module.  (Read 5159 times)

Offline ferite

  • Newbie
  • *
  • Posts: 22
Unable to build driver module.
« on: November 09, 2013, 02:47:47 PM »
Hello.

I am relatively new to Linux, and completely new at TC.

I am trying to build the driver for a optical device. I have built it for some distros before. It is just about downloading kernel source package, set the kernel's path in the module's makefile and run make, and the driver should be built.

Now, working on TC, I have downloaded linux-3.8.10-sources-env.tcz, and set the module's kernel source path to "/usr/src/linux-3.8.10", but when I run make, I am getting the follow message:

root@box:/somepath/Driver# make
make[1]: Entering directory `/usr/src/linux-3.8.10'
Makefile:323: /usr/src/linux-3.8.10/scripts/Kbuild.include: No such file or directory
Makefile:578: /usr/src/linux-3.8.10/arch/x86/Makefile: No such file or directory
/bin/bash: /usr/src/linux-3.8.10/scripts/gcc-goto.sh: No such file or directory
make[1]: *** No rule to make target `/usr/src/linux-3.8.10/arch/x86/Makefile'.  Stop.
make[1]: Leaving directory `/usr/src/linux-3.8.10'
make: *** [all] Error 2

I hope that someone can help me on what else should I do, in order to build the module successfully.

Thanks.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Unable to build driver module.
« Reply #1 on: November 09, 2013, 03:02:59 PM »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11623
Re: Unable to build driver module.
« Reply #2 on: November 09, 2013, 04:43:27 PM »
Hi ferite
Quote
... I have downloaded linux-3.8.10-sources-env.tcz ...
You need to run one of the scripts in that extension to get the actual sources. The scripts in that extension are:
Code: [Select]
usr/local/bin/linux-3.8.10-sources-basic-env.sh
usr/local/bin/linux-3.8.10-sources-env.sh
I think the one you need to run is:
Code: [Select]
linux-3.8.10-sources-env.shIt should be the larger of the two according to the info file.
.

Offline ferite

  • Newbie
  • *
  • Posts: 22
Re: Unable to build driver module.
« Reply #3 on: November 11, 2013, 02:32:30 PM »
There is plenty of information in the wiki and forum.
http://wiki.tinycorelinux.net/wiki:custom_kernel
http://tinycorelinux.net/5.x/x86/release/src/kernel/

Excuse me, I'm very new to Linux. I don't understand how to build a module against the standard TC kernel source, relates to build a custom kernel.

Hi ferite
Quote
... I have downloaded linux-3.8.10-sources-env.tcz ...
You need to run one of the scripts in that extension to get the actual sources. The scripts in that extension are:
Code: [Select]
usr/local/bin/linux-3.8.10-sources-basic-env.sh
usr/local/bin/linux-3.8.10-sources-env.sh
I think the one you need to run is:
Code: [Select]
linux-3.8.10-sources-env.shIt should be the larger of the two according to the info file.
.


Hi Rich. Thanks for your response. Actually I ran usr/local/bin/linux-3.8.10-sources-env.sh. Without running this script, the directory "/usr/src/linux-3.8.10" is not even existent. The problem seems to be that only running the script, does not generate all the directories/files that the make process of my module expects to find in the kernel source directory.

Thanks.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Unable to build driver module.
« Reply #4 on: November 11, 2013, 07:54:21 PM »
linux-3.8.10-sources-env.sh

Needs an internet connection to download sources and deps required to prepare only the kernel sources to build against,  the src directory is created during this process.
you will also need compiletc extension with all its deps.  Also you may need any deps required by the module/application you're intending to build.

The kernel path would not need to be set as the above script creates all necessary symlinks to the src dir.

Good luck

Sent from my iPad using Tapatalk HD
« Last Edit: November 12, 2013, 09:48:53 PM by coreplayer2 »

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11623
Re: Unable to build driver module.
« Reply #5 on: November 11, 2013, 10:12:00 PM »
Hi ferite
I just downloaded the source package and unpacked it. It does contain  scripts/Kbuild.include, arch/x86/Makefile, and
scripts/gcc-goto.sh. Check the directory structure and make sure it's correct.
Code: [Select]
cd /usr/src/linux-3.8.10
ls -l
Check that a  scripts  and an  arch  directory show up in the listing.

Offline ferite

  • Newbie
  • *
  • Posts: 22
Re: Unable to build driver module.
« Reply #6 on: November 12, 2013, 09:16:04 PM »
Thanks to Rich and coreplayer2. Finally I was able to build the module.

Aparently at the first attempts to run the script, all the files were not downloaded. Last time, all the files were downloaded and all worked well.

I think TC is a great distribution to base dedicated systems like mine.

Thanks.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Unable to build driver module.
« Reply #7 on: November 12, 2013, 10:11:43 PM »
Am glad you were able to resolve your build issues.     While more detailed information would have helped determine the cause I feel sure some extra dep download checking is require, will work on this asap along with some other improvements we've had waiting in the background to introduce.

Thanks for using the scripts, and now that your module has bee built how about finishing the job, create an extension and submit to the repo for others to possibly benefit from ?

It's not so hard, and there is much help in the wiki
« Last Edit: November 12, 2013, 10:14:05 PM by coreplayer2 »

Offline ferite

  • Newbie
  • *
  • Posts: 22
Re: Unable to build driver module.
« Reply #8 on: November 13, 2013, 07:35:07 PM »
Hi coreplayer2.

The driver is for a vascular infrared sensor. As the source code is part of a $comercial$ SDK, I am going to ask to the SDK provider if is there a concern to publish the extension freely available. If not, I am going to generate the extension.

By the way, by now I am working on this http://www.gizmosphere.org/why-gizmo/