Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

Bug in NI-KAL v1.10 build

Hi,

The NI-KAL build system can't handle the kernel "build" and "source"

directories being in different locations.  In particular, it seems to look

for the file "Module.symvers" in the kernel source directory, but this

file is found in the build directory.

The following workaround seems to fix the problem for me:

sudo ln -s /lib/modules/$(uname -r)/build/Module.symvers /lib/modules/$(uname -r)/source

             -- Aaron

0 Kudos
Message 1 of 6
(4,415 Views)

After a bit more testing the problem appears worse.  With a completely

clean kernel source tree (e.g. after "make mrproper"), the NI-KAL build

fails due to a number of other missing files and directories.

0 Kudos
Message 2 of 6
(3,487 Views)

Hi Aaron,

You are correct that NI-KAL doesn't support separate kernel "build" and "source" directories if your kernel has been built with modversions support.  As you mentioned you can fix this by linking or copying the Module.symvers file to the kernel source directory.  I'm curious are you using openSUSE, or some other distribution?  If you are using openSUSE the Module.symvers step is documented in the NI-KAL README file.

Now the question is if we can support separate "build" and "source" directories without having to copy the Module.symvers file.  Currently things break because of the NI-KAL configure script.  The configure script is responsible for checking for changes in the kernel APIs since the Linux kernel frequently changes its APIs from version to version.  While it is possible to detect these changes based off of the kernel version code, that can fail if distributions backport features from newer kernels.  Of course we may be able to fix this problem by running the configure script against the "source" directory and building against the "build" directory.  I've created a CAR (corrective action request) to see if we can fix this in a future release.

Shawn Bohrer

National Instruments

Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 3 of 6
(3,487 Views)

Hey Aaron,

To my knowledge you shouldn't be able to build any kernel modules against a "make mrproper" kernel source tree, so I don't think this is a bug.  "make mrproper" removes everything from the kernel tree leaving it in a default unconfigured state.  At this point there isn't even a .config file so we have no way of knowing what options the kernel will be built with.  In order to build kernel modules you need a .config file and you need to run at least "make modules_prepare".

As a side note you may be able to run "make clean" and have it still build modules but I haven't tried.  I do know that "make clean && make modules_prepare" will work.

Shawn Bohrer

National Instruments

Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 4 of 6
(3,487 Views)

Hi Shawn,

I'm using Ubuntu 9.04, but with a custom kernel with separate source

and build directories.

0 Kudos
Message 5 of 6
(3,487 Views)

Hi Shawn,

I think I was unclear.  I am building the kernel outside the source directory (with make O=../build/).  However, previously

I had accidently done a make which generated some files in my source tree.  This meant that all the files NI-KAL was

looking for could be found in "/lib/modules/$(uname -r)/source", when actually they should be found in "build".

After a "make mrproper" in the source directory (without touching the build directory) to remove these generated files,

the NI-KAL build system complains about missing files because it's looking in the wrong place (source instead of build).

0 Kudos
Message 6 of 6
(3,487 Views)