Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Help regarding linux-headers

  1. #1
    Join Date
    Sep 2013
    Location
    Chennai, India
    Beans
    15
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question Help regarding linux-headers

    I`m trying to compile some code, as per the instructions I need to have the linux headers on my machine, so I ran this code

    Code:
    vm001@vm001-VirtualBox:~$ uname -r
    3.2.0-29-generic-pae
    vm001@vm001-VirtualBox:~$ sudo apt-get install linux-headers-$(uname -r)
    [sudo] password for vm001: 
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    linux-headers-3.2.0-29-generic-pae is already the newest version.
    linux-headers-3.2.0-29-generic-pae set to manually installed.
    The following packages were automatically installed and are no longer required:
      ruby1.8 ruby libruby1.8 libreadline5
    Use 'apt-get autoremove' to remove them.
    0 upgraded, 0 newly installed, 0 to remove and 455 not upgraded.

    I hope this means all my headers are already available, Isn`t it ?

    As the next step I tried to compile the code

    Code:
    vm001@vm001-VirtualBox:~/Downloads/aodv-uu-0.9.6$ make
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o main.o main.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o list.o list.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o debug.o debug.c
    debug.c: In function ‘print_rt_table’:
    debug.c:349:13: warning: variable ‘written’ set but not used [-Wunused-but-set-variable]
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o timer_queue.o timer_queue.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_socket.o aodv_socket.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_hello.o aodv_hello.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_neighbor.o aodv_neighbor.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_timeout.o aodv_timeout.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o routing_table.o routing_table.c
    routing_table.c: In function ‘rt_table_insert’:
    routing_table.c:92:17: warning: variable ‘nm’ set but not used [-Wunused-but-set-variable]
    routing_table.c: In function ‘rt_table_update’:
    routing_table.c:196:17: warning: variable ‘nm’ set but not used [-Wunused-but-set-variable]
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o seek_list.o seek_list.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_rreq.o aodv_rreq.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_rrep.o aodv_rrep.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o aodv_rerr.o aodv_rerr.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o nl.o nl.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -c -o locality.o locality.c
    gcc -Wall -O3 -g -DDEBUG -DCONFIG_GATEWAY  -DDEBUG -o aodvd main.o list.o debug.o timer_queue.o aodv_socket.o aodv_hello.o aodv_neighbor.o aodv_timeout.o routing_table.o seek_list.o aodv_rreq.o aodv_rrep.o aodv_rerr.o nl.o locality.o 
    make -C /home/vm001/Downloads/aodv-uu-0.9.6/lnx KERNEL_DIR=/lib/modules/3.2.0-29-generic-pae/build KCC=gcc XDEFS=-DDEBUG
    make[1]: Entering directory `/home/vm001/Downloads/aodv-uu-0.9.6/lnx'
    gcc -Wall -Wno-strict-aliasing -O2 -D__KERNEL__ -DMODULE -nostdinc -DMODVERSIONS -include /lib/modules/3.2.0-29-generic-pae/build/include/linux/modversions.h -I /usr/lib/gcc/i686-linux-gnu/4.6/include -I/lib/modules/3.2.0-29-generic-pae/build/include -DDEBUG -c -o kaodv-mod.o kaodv-mod.c
    cc1: fatal error: /lib/modules/3.2.0-29-generic-pae/build/include/linux/modversions.h: No such file or directory
    compilation terminated.
    make[1]: *** [kaodv-mod.o] Error 1
    make[1]: Leaving directory `/home/vm001/Downloads/aodv-uu-0.9.6/lnx'
    make: *** [kaodv] Error 2
    Ignoring the warnings, leaves me with just one error (the one that I have highlighted above).
    I`m not able to fix it, pls help me.

    Thanks in advance.

    P.S: If you want to know what code I`m trying to compile pls look at this link http://sourceforge.net/projects/aodvuu/

  2. #2
    Join Date
    Aug 2013
    Beans
    86
    Distro
    Xubuntu

    Re: Help regarding linux-headers

    To run make from Debian/Ubuntu, you still need the "build-essential" package. So, make sure you have that installed.

  3. #3
    Join Date
    Sep 2013
    Location
    Chennai, India
    Beans
    15
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help regarding linux-headers

    Quote Originally Posted by rai_shu2 View Post
    To run make from Debian/Ubuntu, you still need the "build-essential" package. So, make sure you have that installed.
    I have installed the "build-essential" package but still got the same error

    Code:
    vm001@vm001-VirtualBox:~/Downloads/aodv-uu-0.9.6$ make
    make -C /home/vm001/Downloads/aodv-uu-0.9.6/lnx KERNEL_DIR=/lib/modules/3.2.0-29-generic-pae/build KCC=gcc XDEFS=-DDEBUG
    grep: /lib/modules/3.2.0-29-generic-pae/build/Makefile: No such file or directory
    make[1]: Entering directory `/home/vm001/Downloads/aodv-uu-0.9.6/lnx'
    gcc -Wall -Wno-strict-aliasing -O2 -D__KERNEL__ -DMODULE -nostdinc -DMODVERSIONS -include /lib/modules/3.2.0-29-generic-pae/build/include/linux/modversions.h -I /usr/lib/gcc/i686-linux-gnu/4.6/include -I/lib/modules/3.2.0-29-generic-pae/build/include -DDEBUG -c -o kaodv-mod.o kaodv-mod.c
    cc1: fatal error: /lib/modules/3.2.0-29-generic-pae/build/include/linux/modversions.h: No such file or directory
    compilation terminated.
    make[1]: *** [kaodv-mod.o] Error 1
    make[1]: Leaving directory `/home/vm001/Downloads/aodv-uu-0.9.6/lnx'
    make: *** [kaodv] Error 2

  4. #4
    Join Date
    Aug 2013
    Beans
    86
    Distro
    Xubuntu

    Re: Help regarding linux-headers

    I guess you need the source code for the kernel.

    Code:
    sudo apt-get source linux-image-$(uname -r)

  5. #5
    Join Date
    Sep 2013
    Location
    Chennai, India
    Beans
    15
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help regarding linux-headers

    Thanks for your interest in helping me @rai_shu2.

    I`m going to try it now and I`ll get back to you with the results

  6. #6
    Join Date
    Sep 2013
    Location
    Chennai, India
    Beans
    15
    Distro
    Ubuntu 12.04 Precise Pangolin

    Unhappy Re: Help regarding linux-headers

    Quote Originally Posted by rai_shu2 View Post
    I guess you need the source code for the kernel.

    Code:
    sudo apt-get source linux-image-$(uname -r)
    Tried what you said but still there is no change. Same error and no change

    Code:
    vm001@vm001-VirtualBox:~/Downloads/aodv-uu-0.9.6$ make
    make -C /home/vm001/Downloads/aodv-uu-0.9.6/lnx KERNEL_DIR=/lib/modules/3.2.0-29-generic-pae/build KCC=gcc XDEFS=-DDEBUG
    make[1]: Entering directory `/home/vm001/Downloads/aodv-uu-0.9.6/lnx'
    gcc -Wall -Wno-strict-aliasing -O2 -D__KERNEL__ -DMODULE -nostdinc -DMODVERSIONS -include /lib/modules/3.2.0-29-generic-pae/build/include/linux/modversions.h -I /usr/lib/gcc/i686-linux-gnu/4.6/include -I/lib/modules/3.2.0-29-generic-pae/build/include -DDEBUG -c -o kaodv-mod.o kaodv-mod.c
    cc1: fatal error: /lib/modules/3.2.0-29-generic-pae/build/include/linux/modversions.h: No such file or directory
    compilation terminated.
    make[1]: *** [kaodv-mod.o] Error 1
    make[1]: Leaving directory `/home/vm001/Downloads/aodv-uu-0.9.6/lnx'
    make: *** [kaodv] Error 2
    Pls help me, I`m so desperate and I need to get it working.....

  7. #7
    Join Date
    Sep 2013
    Location
    Chennai, India
    Beans
    15
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help regarding linux-headers

    I tried the following..

    I ran a search on the file modversions.h Copied the file to the location.

    Code:
    vm001@vm001-VirtualBox:/aodv-uu-0.9.6$ sudo find / -name modversions.h
    /usr/src/linux-headers-3.2.0-29-generic-pae/include/config/modversions.h
    vm001@vm001-VirtualBox:/usr/src/linux-headers-3.2.0-29-generic-pae/include/config$ sudo cp modversions.h /lib/modules/3.2.0-29-generic-pae/build/include/linux/
    Now a getting new errors.

    Code:
    vm001@vm001-VirtualBox:/aodv-uu-0.9.6$ make
    make -C /aodv-uu-0.9.6/lnx KERNEL_DIR=/lib/modules/3.2.0-29-generic-pae/build KCC=gcc XDEFS=-DDEBUG
    make[1]: Entering directory `/aodv-uu-0.9.6/lnx'
    gcc -Wall -Wno-strict-aliasing -O2 -D__KERNEL__ -DMODULE -nostdinc -DMODVERSIONS -include /lib/modules/3.2.0-29-generic-pae/build/include/linux/modversions.h -I /usr/lib/gcc/i686-linux-gnu/4.6/include -I/lib/modules/3.2.0-29-generic-pae/build/include -DDEBUG -c -o kaodv-mod.o kaodv-mod.c
    In file included from /lib/modules/3.2.0-29-generic-pae/build/include/linux/list.h:4:0,
                     from /lib/modules/3.2.0-29-generic-pae/build/include/linux/module.h:9,
                     from kaodv-mod.c:29:
    /lib/modules/3.2.0-29-generic-pae/build/include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
    compilation terminated.
    make[1]: *** [kaodv-mod.o] Error 1
    make[1]: Leaving directory `/aodv-uu-0.9.6/lnx'
    make: *** [kaodv] Error 2
    Need some help to get this fixed.

  8. #8
    Join Date
    Apr 2012
    Beans
    6,949

    Re: Help regarding linux-headers

    I think your fundamental problem is that the source code is from 2010 and is explicitly configured to build on a 2.x kernel - you're basically going to have to re-write the lnx/Makefile to reflect new locations of various header files - you've found the new location of modversions.h but all the arch-dependent types.h files are now in /usr/src/linux-headers-$(uname -r)/arch for example. I don't know of a 'quick fix' - sorry.

  9. #9
    Join Date
    Sep 2013
    Location
    Chennai, India
    Beans
    15
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Help regarding linux-headers

    Quote Originally Posted by steeldriver View Post
    I think your fundamental problem is that the source code is from 2010 and is explicitly configured to build on a 2.x kernel - you're basically going to have to re-write the lnx/Makefile to reflect new locations of various header files - you've found the new location of modversions.h but all the arch-dependent types.h files are now in /usr/src/linux-headers-$(uname -r)/arch for example. I don't know of a 'quick fix' - sorry.
    I`m going to try it now. I shall get back to you when I have an update.

    I really appreciate the help.

  10. #10
    Join Date
    Aug 2013
    Beans
    86
    Distro
    Xubuntu

    Re: Help regarding linux-headers

    That's just line 12 of Makefile, right?

    Code:
    KERNEL_DIR=/lib/modules/$(KERNEL)/build
    So, change that to:

    Code:
    KERNEL_DIR=/usr/src/linux-headers-$(KERNEL)

Page 1 of 2 12 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •