Public bug reported:

Binary package hint: nvidia-180-kernel-source

This can be viewed as an RFC and/or information for others that might
need a work-around for building nvidia DKMS packages on manually
installed kernels.

As a kernel developer I'm building new kernels constantly. Usually I
will not use the debian build system but the quick, out-of-tree build
method with incremental rebuilds during bug-hunting, patching and
testing.

cat debian/config/$ARCH/config{,.generic} > ../builds/ubuntu-jaunty/.config
make -j4 O=`pwd`/../builds/ubuntu-jaunty oldconfig
make -j4 O=`pwd`/../builds/ubuntu-jaunty

After building I'll install with:

cd /home/all/SourceCode/linux/ubuntu-jaunty
sudo make O=`pwd`/../builds/ubuntu-jaunty install
sudo make O=`pwd`/../builds/ubuntu-jaunty modules_install
sudo makedumpfile -g /boot/vmcoreinfo-$KVER -x ../builds/ubuntu-jaunty/vmlinux
sudo update-initramfs -c -k $KVER

sudo dkms build -m nvidia -v 180.37 -k $KVER

The last step fails in the nvidia script

/usr/src/nvidia-180.37/conftest.sh

because linux/utsname.h isn't in /lib/modules/$KVER/build/include/.

The reason is that when doing out-of-tree no-package builds there is no
linux-headers package which would include linux/utsname.h.

/lib/modules/$KVER/build symlinks to the build output directory; in this
case /home/all/SourceCode/linux/builds/ubuntu-jaunty

This is where include/linux/version.h lives.

Additionally, /lib/modules/$KVER/source symlinks to the source-code;
/home/all/SourceCode/linux/ubuntu-jaunty

This is where include/linux/utsname.h lives.

The dkms package executes the make command:

 make module KERNDIR=/lib/modules/$kernelver IGNORE_XEN_PRESENCE=1
IGNORE_CC_MISMATCH=1 SYSSRC=$kernel_source_dir

and SYSSRC is set to /lib/modules/$KVER/build

The kernel version checks done in /usr/src/nvidia-180.37/conftest.sh
look for linux/version.h in either $SYSSRC/ or $SYSOUT/include/
(assuming they are set) and adds them to the set of -I include
directories passed to gcc when it attempts to build a test program.

Although on a packaged system all the required headers files will be in
/lib/modules/$KVER/build it is clear that when doing out-of-tree builds
the files are in separate trees, although still reachable.

The solution for out-of-tree non-packaged installations is:

make module KERNDIR=/lib/modules/$kernelver IGNORE_XEN_PRESENCE=1
IGNORE_CC_MISMATCH=1 SYSOUT=$kernel_source_dir
SYSSRC=/lib/modules/$kernelver/source

I've been trying to find a way to allow the DKMS package to build in
both scenarios. Unfortunately the fact that SYSSRC and SYSOUT need to be
effectively 'swapped' to work for non-packaged installs makes it
difficult because that breaks a build on a packaged installation.

I'm going to look at the scripts in more depth once I get some time but
it looks like DKMS has got to communicate the presence of the ./source/
directory in some way.

** Affects: nvidia-graphics-drivers-180 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
FTBFS: when building against development kernel
https://bugs.launchpad.net/bugs/345079
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to