0

I'm about to implement AODV on ARM board SabreLite and I'm facing some problems.

So, I use the latest version of AODV located here (sourceforge.net/projects/aodvuu/). I've follow the instruction given in README file but at the end, i get the error:

kaodv-mod.c:22:27: fatal error: linux/version.h: No such file or directory #include

Since the board use 3.0.35 kernel version, i download it and I just change the kernel directory in Makefile. And, it should normally worked based on the instruction (http://w3.antd.nist.gov/wctg/aodv_kernel/kaodv_arm.html). The above error suggests that i don't have the version.h but I checked and I have all of linux header files installed, so it can't be that.

On the step number 6 of the tutorial (README file), i did not compile the kernel 3.0.35 because i'm pretty positive that it has the proper netfilter support for AODV-UU as it is a kernel young version. ( It is actually a configuration suggestion on kernel 2.4 and 2.6 but i think i should not obliged to do that here)

  • What can be the solution of this ?
  • Do i really need to compile this kernel version (3.0.35) before keep going ?
  • Do i have to change the AODV code, and if so, which files do i have to modify ?

Thanks in advance !!!


Thanks for your response, but unfortunately, i've already done that. By saying that, i mean, i've choosen the kernel source tree that matches the target kernel (linux-imx6-boundary-imx_3.0.35_4.1.0). I've also set up my cross compiler to have my environment variables ready for the cross compilation. Here is the output.

echo $CC:

arm-oe-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/usr/local/oecore-x86_64/sysroots/cortexa9hf-vfp-neon-oe-linux-gnueabi    

and some of my env variables looks like this:

ARCH=arm

CROSS_COMPILE=arm-oe-linux-gnueabi-          

CFLAGS= -O2 -pipe -g -feliminate-unused-debug-types   

RANLIB=arm-oe-linux-gnueabi-ranlib

After, all of these configurations, i still got the error. I really don't think that i have to recompile the kernel

Gordon
  • 312,688
  • 75
  • 539
  • 559
scof007
  • 415
  • 2
  • 9
  • 15

1 Answers1

1

In order to build modules, you need a kernel source tree in a state that matches the target kernel, i.e. not an untouched freshly-downloaded one. Don't confuse the presence of extra board-specific patches/drivers/etc. in a vendor kernel for configuration - to get the source tree into the right state to use, you still need to:

  • configure it correctly: make ARCH=arm <whatever>_defconfig (and/or any .config tweaks your board needs)
  • then build it: make ARCH=arm CROSS_COMPILE=<your toolchain triplet>

You need to actually build the kernel because there are many important files that don't exist yet, like the contents of include/generated (where the aforementioned version.h is created), the corresponding arch/$ARCH/include/generated, the checksums for module versioning, and probably more, which will all be different depending on which architecture and particular configuration options were chosen.


My bad for missing the mention of the crucial detail in the question, but upon downloading the linked AODV to try this myself, it became clear: the makefile is designed for the 2.4 build system which was rather different (and I'm not familiar with). Getting that one to build against a post-2.6 kernel will require writing a new makefile.

Notlikethat
  • 20,095
  • 3
  • 40
  • 77
  • Thanks for your response, but unfortunately, i've already done that. By saying that, i mean, i've choosen the kernel source tree that matches the target kernel (linux-imx6-boundary-imx_3.0.35_4.1.0). I've also set up my cross compiler to have my environment variables ready for the cross compilation. Here is the output. echo $CC: arm-oe-linux-gnueabi-gcc -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/usr/local/oecore-x86_64/sysroots/cortexa9hf-vfp-neon-oe-linux-gnueabi ARCH=arm – scof007 Aug 06 '14 at 13:28
  • 1
    @scof007 you still need to configure and build the kernel - it doesn't know whether to use the ARM code or the PowerPC code or whatever until you do. It's not like it's a big deal - cross-compiling an ARM kernel only takes a couple of minutes for me. – Notlikethat Aug 06 '14 at 15:40
  • You may be able to find the original configuration in /proc/config.gz on the device. The manufacturer should be providing it as part of their corresponding source for whatever binary kernel you have. – Chris Stratton Aug 06 '14 at 17:27
  • So,an update.,thanks for the response by the way. Actually, i configure and build the kernel, but i still get error. After config and build, i get the missing directory stated previously fixed and i also get the other directories on track such as include/generated. So i run "make arm" in aodv directory to cross compile for the arm and the error above goes away (version.h missing) but i get other "including" errors (for instance asm/rwsem.h). the asm directory generated by config and build process don't have such file. what can i do ? Has everyone already tried to cross compile aodv for arm? – scof007 Aug 08 '14 at 15:19
  • So, i get all of the include error fixed. From the start, i was not on the right kernel version, so even after configuring and building the kernel. i've still some files missing. So, i still have error but not on including anymore. So the problem stated above is resolved i think. Now, i get error along with : /usr/local/oecore-x86_64/sysroots/cortexa9hf-vfp-neon-oe-linux-gnueabi/usr/include/linux/sysinfo.h:21:3: error: unknown type name '__kernel_ulong_t' which is a problem from the cross compilation tree. I don't know yet how on earth i got this errors right now ... – scof007 Aug 09 '14 at 15:04
  • @Notlikethat thank you for your response. So, you say that i have to write another Makefile for this post 2.6 kernel version. Well, i'll try to do that, because as i stated just above, the include missing error is gone but i still have some errors that should not happen. I've never write a Makefile for AODV before but i think that it should not be so different compared to the one that already existed (kernel 2.4). Do you happen to have any idea what changes do i have to make on this makefile ? – scof007 Aug 09 '14 at 16:03