Cannot build kernel debian package using L4T 32.5.1

I have been using L4T 32.3.1 for the last couple years by building the kernel debian package with the command
make ARCH=arm64 O="$TEGRA_KERNEL_OUT_DIR" -j4 deb-pkg

I’m now trying to build the L4T 32.5.1 kernel but it fails with the error message

./usr/include/net/pgdrv.h:38: included file 'linux/cdev.h' is not exported
/home/sdmello/build/xavier-nx/Linux_for_Tegra/sources/kernel/kernel-4.9/scripts/Makefile.headersinst:169: recipe for target 'usr/include/net/.check' failed
make[7]: *** [usr/include/net/.check] Error 123

After comparing the sources I see that the file pgdrv.h has moved from kernel/nvidia/drivers/net/ethernet/realtek/pgdrv.h to kernel/nvidia/include/uapi/net/pgdrv.h

This same issue was reported by other users in this forum post

Please let me know how I can get the headers check to pass(i.e export linux/cdev.h) so I can continue to generate debian artifacts (headers + kernel)

Thanks,
Sanjay

hello SanjayD,

could you please confirm you’ve download the r32.5.1 public release sources via L4T Release Page.
please also check you’ve followed developer guide, Building the NVIDIA Kernel for the environment configurations.
thanks

Confirming that I downloaded r32.5.1 public sources. As I mentioned in my original comment, pgdrv.h has moved in the latest sources, which is causing this issue.

The command make ARCH=arm64 O="$TEGRA_KERNEL_OUT_DIR" -j4 deb-pkg is a standard method to build debian artifacts when building the Linux kernel, it would be really helpful if this is fixed. Thanks.

1 Like

hello SanjayD,

we’re having investigation internally, will share the results after we have conclusion.
thanks

1 Like

Hi SanjayD,

We’re not support build kernel debian package.
Please refer to the instructions in “Repackaging Debian Packages” in the Developer Guide and use the helper script nvdebrepack.sh to repack l4t debian package.

Script path: JetPack_4.6_Linux_JETSON_TX2_TARGETS/Linux_for_Tegra/tools/Debian/

For anyone else facing a similar issue, I worked around this by simply disabling the headers check in builddeb and then building the debian artifacts

sed -i "s/\$MAKE headers_check/#\$MAKE headers_check/g" sources/kernel/kernel-4.9/scripts/package/builddeb

make ARCH=arm64 -j4 deb-pkg

1 Like

Hey @SanjayD,

I had the same issue a few months ago. I’m just following up to add another solution in case other folks run into the same thing.

Digging into pgdrv.h, it doesn’t actually use anything from cdev.h. So I created a patch to remove the include cdev.h from pgdrv.h (you can also just remove it manually).

With this, I am able to build and use the kernel debian package in order to neatly package our custom kernel mods. It has worked on both L4T 32.5.1 and L4T 32.6.1, and it passes the headers check.

Best of luck!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.