LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-16-2015, 06:48 PM   #1
dan12343
LQ Newbie
 
Registered: Mar 2015
Posts: 23

Rep: Reputation: Disabled
Question Compiling kernel source build modules in ubuntu 14.04


Decided to just make a new thread. Forgive me if im breaking the rules.
Im trying to install some drivers. the .deb installed fine but after install i have to run dgcconfig to build the modules. It asks for the build at /usr/src/(linux)/build then fails and says to setup the kernel using make menuconfig in the kernel directory. But i'm not sure what to configure in the menu.

Help in getting my kernel build modules setup so ubuntu will install the driver and detect the modem as a modem? Listed in lsusb but gnomeppp wont detect a modem connected. I used apt-get install kernel-source but im not sure how to compile or configure.

Help is appreciated i've been trying to get these drivers working for awhile
Thanks
 
Old 03-17-2015, 01:35 AM   #2
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
1. Make sure, what hardware is in your computer
2. Help is available to every kernel option.

The kernel can be compiled by make -j(number of cpu cores).

It might be a good idea to read this here: http://kernelnewbies.org/
 
Old 03-17-2015, 09:42 AM   #3
dan12343
LQ Newbie
 
Registered: Mar 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
So in other words "make -j 2" would be the command i'd enter for dual core and allow me to install the driver modules after? Am i doing this for the kernel header directory or kernel source directory?

Running virtual machine with 1gb ram, 64mb video, and the cpu isnt emulated i think so pentium dualcore 3ghz

Console output when dgcconfig was run:
Code:
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$ sudo dgcconfig
Conexant DGC USB modem driver, version 1.13

If you need assistance or more information, please go to:
    http://www.linuxant.com/

When reporting a problem for the first time, please send
us the file generated by "dgcconfig --dumpdiag".

No pre-built modules for: Ubuntu-14.04.2 linux-3.16.0-30-generic i686-SMP

Trying to automatically build the driver modules...
(this requires a C compiler and proper kernel sources to be installed)

Where is the linux source build directory that matches your running kernel?
[/lib/modules/3.16.0-30-generic/build]

WARNING: missing file /lib/modules/3.16.0-30-generic/build/include/linux/version.h
The cause of this is usually a missing or unconfigured
kernel source tree (and sometimes an incorrect directory or symbolic link).

However, proper /boot/config-3.16.0-30-generic was found.
Would you like to try using it (in a temporary kernel tree)? [yes]

Unable to prepare temporary kernel tree

First, ensure that the proper kernel source and compiler packages
from your distribution vendor and/or the community are installed.

The Linux kernel can then be reconfigured by running "make menuconfig"
under the kernel source directory (usually /usr/src/linux).

Verify that the proper options for your system are selected.

Then compile and install your new kernel (for more information about
this procedure, see the README file under the kernel source directory),
reboot the system using the new kernel, and re-run "dgcconfig".
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$

Last edited by dan12343; 03-17-2015 at 09:47 AM.
 
Old 03-17-2015, 11:15 AM   #4
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
1. To configure the kernel, you can use make config, make menuconfig, make xconfig,...
2. make -j2 in the kernel base directory: /usr/src/linux
 
Old 03-17-2015, 11:54 AM   #5
dan12343
LQ Newbie
 
Registered: Mar 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
Ran make -j2 in running kernel header dir and output:
Code:
dan@dan-VirtualBox:~$ cd /usr/src/linux-headers-3.16.0-30
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$ make -j2
scripts/kconfig/conf --silentoldconfig Kconfig
***
*** Configuration file ".config" not found!
***
*** Please run some configurator (e.g. "make oldconfig" or
*** "make menuconfig" or "make xconfig").
***
make[2]: *** [silentoldconfig] Error 1
make[1]: *** [silentoldconfig] Error 2
make[1]: *** No rule to make target `arch/x86/syscalls/syscall_32.tbl', needed by `arch/x86/syscalls/../include/generated/asm/syscalls_32.h'.  Stop.
make: *** [archheaders] Error 2
make: INTERNAL: Exiting with 3 jobserver tokens available; should be 2!
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$
I run sudo make oldconfig in running header dir, works, output:
Code:
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$ sudo make oldconfig
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$
run dgcconfig, output same:
Code:
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$ sudo dgcconfig
Conexant DGC USB modem driver, version 1.13

If you need assistance or more information, please go to:
	http://www.linuxant.com/

When reporting a problem for the first time, please send
us the file generated by "dgcconfig --dumpdiag".

No pre-built modules for: Ubuntu-14.04.2 linux-3.16.0-30-generic i686-SMP

Trying to automatically build the driver modules...
(this requires a C compiler and proper kernel sources to be installed)

Where is the linux source build directory that matches your running kernel?
[/lib/modules/3.16.0-30-generic/build] 

WARNING: missing file /lib/modules/3.16.0-30-generic/build/include/linux/version.h
The cause of this is usually a missing or unconfigured
kernel source tree (and sometimes an incorrect directory or symbolic link).

However, proper /boot/config-3.16.0-30-generic was found.
Would you like to try using it (in a temporary kernel tree)? [yes] 

Unable to prepare temporary kernel tree

First, ensure that the proper kernel source and compiler packages
from your distribution vendor and/or the community are installed.

The Linux kernel can then be reconfigured by running "make menuconfig"
under the kernel source directory (usually /usr/src/linux).

Verify that the proper options for your system are selected.

Then compile and install your new kernel (for more information about
this procedure, see the README file under the kernel source directory),
reboot the system using the new kernel, and re-run "dgcconfig".
dan@dan-VirtualBox:/usr/src/linux-headers-3.16.0-30$
I did the same in the latest header directory (3.16.0-31) with the same result
Ill restart the machine and edit this post the result
 
Old 03-17-2015, 12:37 PM   #6
dan12343
LQ Newbie
 
Registered: Mar 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
Restarted, ran make config in 3.16.0-30 dir, then dgcconfig same result, restarted again, ran in make config in 3.16.0-30 then dgcconfig and same result again
Stumped
 
Old 03-17-2015, 01:28 PM   #7
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
You are in the linux-headers directory.

You must execute make in /usr/src/linux-<version>.
The kernel source must be installed.
 
Old 03-19-2015, 02:36 PM   #8
dan12343
LQ Newbie
 
Registered: Mar 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
Reinstalled ubuntu
installed kernel-headers kernel-devel build-essential kernel-source
apt-get install kernel-source gives me tar.bz2 with two folders debian and debian.master in usr/src/linux-source-3.13.0/
run tar xjf linux-source-3.13.0.tar.bz2
extracts to usr/src/linux-source-3.13.0/linux-source-3.13.0
run sudo make -j2 in that directory
Says to run oldconfig
run sudo oldconfig
writes .config file
Instal dgcmodem driver
installs
runs dgcconfig
Same output as above (missing version.h, cannot make a build tree/temporary tree?, Cannot build modules run make config restart and rerun dgcconfig)

Stumped, not sure how to properly install kernel-source or configure kernel so the modules will build. Help
 
Old 03-19-2015, 02:40 PM   #9
dan12343
LQ Newbie
 
Registered: Mar 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
Quote:
You must execute make in /usr/src/linux-<version>
Not sure what to install to get that directory. folders in /usr/src/ are linux-headers-(version) and linux-source-(version)
 
Old 03-19-2015, 03:02 PM   #10
dan12343
LQ Newbie
 
Registered: Mar 2015
Posts: 23

Original Poster
Rep: Reputation: Disabled
Code:
dan@dan-VirtualBox:~$ cd /usr/src/linux-source-3.13.0/linux-source-3.13.0
dan@dan-VirtualBox:/usr/src/linux-source-3.13.0/linux-source-3.13.0$ sudo make -j2
[sudo] password for dan: 
scripts/kconfig/conf --silentoldconfig Kconfig
make[1]: Nothing to be done for `all'.
  CHK     include/config/kernel.release
  WRAP    arch/x86/include/generated/asm/clkdev.h
  CHK     include/generated/uapi/linux/version.h
  UPD     include/config/kernel.release
  UPD     include/generated/uapi/linux/version.h
  HOSTCC  scripts/genksyms/genksyms.o
  SHIPPED scripts/genksyms/lex.lex.c
  SHIPPED scripts/genksyms/keywords.hash.c
  SHIPPED scripts/genksyms/parse.tab.h
  SHIPPED scripts/genksyms/parse.tab.c
  HOSTCC  scripts/genksyms/lex.lex.o
  HOSTCC  scripts/genksyms/parse.tab.o
  HOSTLD  scripts/genksyms/genksyms
  CC      scripts/mod/empty.o
  HOSTCC  scripts/mod/mk_elfconfig
  CC      scripts/mod/devicetable-offsets.s
  HOSTCC  scripts/selinux/genheaders/genheaders
  MKELF   scripts/mod/elfconfig.h
  GEN     scripts/mod/devicetable-offsets.h
  HOSTCC  scripts/mod/modpost.o
  HOSTCC  scripts/selinux/mdp/mdp
  HOSTCC  scripts/kallsyms
  HOSTCC  scripts/mod/sumversion.o
  HOSTCC  scripts/conmakehash
  HOSTCC  scripts/mod/file2alias.o
  HOSTCC  scripts/recordmcount
  HOSTLD  scripts/mod/modpost
  HOSTCC  scripts/sortextable
  HOSTCC  scripts/asn1_compiler
  HOSTCC  arch/x86/tools/relocs_32.o
  HOSTCC  arch/x86/tools/relocs_64.o
  HOSTCC  arch/x86/tools/relocs_common.o
  HOSTLD  arch/x86/tools/relocs
  CHK     include/generated/utsrelease.h
  UPD     include/generated/utsrelease.h
  CC      kernel/bounds.s
  GEN     include/generated/bounds.h
  CC      arch/x86/kernel/asm-offsets.s
In file included from include/linux/suspend.h:8:0,
                 from arch/x86/kernel/asm-offsets.c:12:
include/linux/mm.h:647:2: error: #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
 #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > BITS_PER_LONG - NR_PAGEFLAGS
  ^
make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2
make: *** Waiting for unfinished jobs....
dan@dan-VirtualBox:/usr/src/linux-source-3.13.0/linux-source-3.13.0$ sudo dgcconfig
Conexant DGC USB modem driver, version 1.13

If you need assistance or more information, please go to:
	http://www.linuxant.com/

When reporting a problem for the first time, please send
us the file generated by "dgcconfig --dumpdiag".

No pre-built modules for: Ubuntu-14.04.2 linux-3.16.0-30-generic i686-SMP

Trying to automatically build the driver modules...
(this requires a C compiler and proper kernel sources to be installed)

Where is the linux source build directory that matches your running kernel?
[/lib/modules/3.16.0-30-generic/build] 

WARNING: missing file /lib/modules/3.16.0-30-generic/build/include/linux/version.h
The cause of this is usually a missing or unconfigured
kernel source tree (and sometimes an incorrect directory or symbolic link).

However, proper /boot/config-3.16.0-30-generic was found.
Would you like to try using it (in a temporary kernel tree)? [yes] 

Unable to prepare temporary kernel tree

First, ensure that the proper kernel source and compiler packages
from your distribution vendor and/or the community are installed.

The Linux kernel can then be reconfigured by running "make menuconfig"
under the kernel source directory (usually /usr/src/linux).

Verify that the proper options for your system are selected.

Then compile and install your new kernel (for more information about
this procedure, see the README file under the kernel source directory),
reboot the system using the new kernel, and re-run "dgcconfig".
dan@dan-VirtualBox:/usr/src/linux-source-3.13.0/linux-source-3.13.0$ sudo oldconfig
sudo: oldconfig: command not found
dan@dan-VirtualBox:/usr/src/linux-source-3.13.0/linux-source-3.13.0$ sudo make oldconfig
scripts/kconfig/conf --oldconfig Kconfig
#
# configuration written to .config
#
dan@dan-VirtualBox:/usr/src/linux-source-3.13.0/linux-source-3.13.0$ sudo dgcconfig
Conexant DGC USB modem driver, version 1.13

If you need assistance or more information, please go to:
	http://www.linuxant.com/

When reporting a problem for the first time, please send
us the file generated by "dgcconfig --dumpdiag".

No pre-built modules for: Ubuntu-14.04.2 linux-3.16.0-30-generic i686-SMP

Trying to automatically build the driver modules...
(this requires a C compiler and proper kernel sources to be installed)

Where is the linux source build directory that matches your running kernel?
[/lib/modules/3.16.0-30-generic/build] 

WARNING: missing file /lib/modules/3.16.0-30-generic/build/include/linux/version.h
The cause of this is usually a missing or unconfigured
kernel source tree (and sometimes an incorrect directory or symbolic link).

However, proper /boot/config-3.16.0-30-generic was found.
Would you like to try using it (in a temporary kernel tree)? [yes] 

Unable to prepare temporary kernel tree

First, ensure that the proper kernel source and compiler packages
from your distribution vendor and/or the community are installed.

The Linux kernel can then be reconfigured by running "make menuconfig"
under the kernel source directory (usually /usr/src/linux).

Verify that the proper options for your system are selected.

Then compile and install your new kernel (for more information about
this procedure, see the README file under the kernel source directory),
reboot the system using the new kernel, and re-run "dgcconfig".
dan@dan-VirtualBox:/usr/src/linux-source-3.13.0/linux-source-3.13.0$
I've done this once and restarted before running dgcconfig but redid for console output
 
Old 03-20-2015, 03:44 PM   #11
Keruskerfuerst
Senior Member
 
Registered: Oct 2005
Location: Horgau, Germany
Distribution: Manjaro KDE, Win 10
Posts: 2,199

Rep: Reputation: 164Reputation: 164
It might be a good idea to read through the wiki of ubuntuusers.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Compiling Kernel Modules in Ubuntu 10.10 lionaneesh Linux - General 1 01-08-2011 04:57 AM
Why can't I build modules after compiling a custom kernel? macaddict01 Linux - Kernel 2 09-30-2010 08:00 PM
Unable to build kernel modules outside the kernel tree Rovalk Programming 2 01-19-2008 01:18 AM
Do I need the entire source for compiling modules? mhuman1 Linux - Newbie 4 05-23-2006 09:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration