Cannot package kernel as debian for Jetpack 4.5.1 / L4T 32.5.1

Purpose:
I am trying to patch the kernel for use with custom hardware. However, I am first building the kernel with no patches applied.

Problem:
I am unable to package the kernel for L4T 32.5.1 as a debian package. I see the same issue in 32.5.0 and 32.5.1. I did not see the issue with 32.3.

Host machine:
Trial 1: x86_64
Trial 2: arm64 (in case cross-compilation was an issue)
Both had identical results

Steps followed:

  1. Download BSP
cd bsp-32.5.1.0/Linux_for_Tegra
  1. Sync sources
bash source_sync.sh -t tegra-l4t-r32.5.1
  1. Nvidia drivers
tar -xjf nv_tegra/nvidia_drivers.tbz2 -C nvidia_drivers
  1. Make
cd sources/kernel/kernel-4.9

# when cross-compiling, do the following 2 lines:
export ARCH=arm64
export CROSS_COMPILE=$TOOLCHAIN_PATH/bin/aarch64-linux-gnu-

export LOCALVERSION=-tegra-rebuilt
make tegra_defconfig
make -j 8
make bindeb-pkg

Error message occurs in the make bindeb-pkg step, particularly in the headers check:

...
CHECK   usr/include/media/ (12 files)
./usr/include/media/ov23850.h:24: found __[us]{8,16,32,64} type without #include <linux/types.h>
  CHECK   usr/include/misc/ (11 files)
./usr/include/misc/eqos_ape_ioctl.h:31: found __[us]{8,16,32,64} type without #include <linux/types.h>
./usr/include/misc/tegra-cryptodev.h:90: found __[us]{8,16,32,64} type without #include <linux/types.h>
./usr/include/misc/tegra-cryptodev.h:150: userspace cannot reference function or variable defined in the kernel
./usr/include/misc/tegra-cryptodev.h:151: userspace cannot reference function or variable defined in the kernel
  CHECK   usr/include/mtd/ (5 files)
  CHECK   usr/include/net/ (1 files)
./usr/include/net/pgdrv.h:38: included file 'linux/cdev.h' is not exported
scripts/Makefile.headersinst:169: recipe for target 'usr/include/net/.check' failed
make[2]: *** [usr/include/net/.check] Error 123
scripts/Makefile.headersinst:44: recipe for target 'net' failed
make[1]: *** [net] Error 2
Makefile:1312: recipe for target 'headers_check' failed
make: *** [headers_check] Error 2

It appears that cdev.h is in kernel space, not in user space / uapi. Is there a uapi cdev.h missing, or is there something else that should be present?

hello catherine.culkin,

may I know what’s the use-case? the kernel already deliver as debian since r32.5 release.
you may download it via apt as following, $ sudo apt-get install nvidia-l4t-kernel
thanks

Hi Jerry,

We need to patch the kernel to work with custom hardware. This build is to check that we can build the Nvidia kernel debian as is before patching the kernel and building our custom kernel debian.
We have been using our custom kernel with L4T 32.3 for two years but are trying to upgrade to L4T 32.5.1.

Thanks,
Cat

hello catherine.culkin,

please access L4T | NVIDIA Developer to download public release sources.
for example,
here’s r32.5.1 L4T Driver Package (BSP) Sources, you’ll see kernel_src.tbz2 package which contain the kernel sources that compatible with JetPack-4.5.1 / l4t-r32.5.1
thanks

I’m experiencing the exact same problem.
Clean install of Ubuntu 18.04, make deb-pkg fails at the exact same point

I suspect it might be an incompatibility with Make 4.1+

How does Nvidia package the kernel? I think we need some additional details from the developers. I have followed the steps found here : generic-no-api_r2 for compiling the kernel on a clean install of Ubuntu 18.04.

Edit: after reviewing the instructions from Nvidia again, perhaps they don’t actually use the deb-pkg recipe. Though, they do send out .deb packages of updated kernels…

For the changes I need to make to the kernel, I would like to be able to push those changes as a .deb package which could then be pinned to avoid any accidental incompatible kernel updates from being installed later.

Or, Nvidia can enable TPM in the official kernel…