How to make kernel deb

There are kernel related debs under below folders,

~/nvidia/nvidia_sdk/JetPack_7.0_Linux_JETSON_AGX_THOR_TARGETS/Linux_for_Tegra/kernel$ tree | grep deb
│ ├── nvidia-l4t-kernel-nvgpu_6.8.12-tegra-38.2.0-20250821174705_arm64.deb
├── nvidia-l4t-display-kernel_6.8.12-tegra-38.2.0-20250821174705_arm64.deb
├── nvidia-l4t-kernel_6.8.12-tegra-38.2.0-20250821174705_arm64.deb
├── nvidia-l4t-kernel-dtbs_6.8.12-tegra-38.2.0-20250821174705_arm64.deb
├── nvidia-l4t-kernel-headers_6.8.12-tegra-38.2.0-20250821174705_arm64.deb
├── nvidia-l4t-kernel-oot-headers_6.8.12-tegra-38.2.0-20250821174705_arm64.deb
├── nvidia-l4t-kernel-oot-modules_6.8.12-tegra-38.2.0-20250821174705_arm64.deb

Is there steps to make kernel debs?

I haven’t done this, but the documentation from Ubuntu would be no different for a Jetson versus any other Linux system so far as creating a .deb. Keep in mind that the “nvidia-” .deb files might have some customization compared to something like a desktop PC. The .deb itself is just for installing content. Since those are already .deb files, are you really asking how to make a .deb, or are you wanting to know how to install them? What is your goal or requirement?

Thank you for checking this question,

I want to make kernel deb after compile kernel, and only replace kernel related file(like Imag, ko, header and son) in thor system by install deb.

Is there the steps that can generate the kernel deb automatically when compiling kernel.

I think this docs_nvidia_com page discusses the mechanism to do what you want to do.

look here Linux_for_Tegra/tools/Debian/nvdebrepack.txt and the docs discuss the operation of nvdebrepack.sh

Building Kernel Debian Packages Yourself

I haven’t actually replaced everything with a .deb, but I think what @whitesscott mentions is probably the best way to proceed. Keep in mind there might be complications related to updates and knowing all of the information for some original .deb file providing the content.

Thank you very much for your information,

And do you know how to use below debian.nvidia-tegra in kernel?

kernel/kernel-noble$ tree -L 1 | grep debian
├── debian
├── debian.master
├── debian.nvidia-tegra
├── debian.nvidia-tegra-pvw
├── debian.realtime

Thank you

Where was the command run from? This looks like it is from a git repository and perhaps the source code some NVIDIA packages are derived from, but I don’t know for sure. If this happens to be from a source code repository which is used for building .deb packages to start with, then there might be instructions in that content for how to configure and build; in some cases there are build targets for packaging as a .deb file. I couldn’t say for sure though, a lot of context is needed to know where the content came from and what its original purpose and use was.

If there is a binary .deb in all of that, then you install it. If it happens that the binary .deb is a source code (source code packages can use .deb packages for install), then this would be likely need to be installed, then configured and built, followed by some make target to package it with a new name. Maybe.

The debian.nvidia-tegra mentioned above is in the kernel source code of kernel/kernel-noble, how do you use it, do you have the guide?

Thank you

I don’t have any experience with those .deb files. Was the source containing this downloaded from:
https://developer.nvidia.com/embedded/jetpack/downloads
(which is currently at L4T R38.2)

If this is from one of those specific downloads on that specific URL I can download the exact same source and look at it, but I want to make sure I’m looking at the same files that you are looking at. Additionally, if you’ve built the kernel with some specific configuration, then perhaps attach the resulting “.config” file used for that build to this thread. I can’t promise I’ll succeed, but I will try to go through that same set of steps and see what is there.

Yes, those debs downloaded from above address.

And still the question, do you know how to use below debian.nvidia-tegra in kernel for building out debs?

kernel/kernel-noble$ tree -L 1 | grep debian
├── debian
├── debian.master
├── debian.nvidia-tegra
├── debian.nvidia-tegra-pvw
├── debian.realtime

Thank you

No, I have never used that for building in the form of a Debian package.

I do see there is a target “deb-pkg”. Once the other content has been built have you tried that? Don’t forget to use the “O=/some/where” if you used it for the build or configuration.

I think this would work. Setup your kernel build environment. Change paths where needed.

sudo apt-get update
sudo apt-get install build-essential bc bison flex libssl-dev libelf-dev dwarves fakeroot dpkg-dev rsync

1) Go to the kernel top-level
cd ~/jp7/Linux_for_Tegra/source/kernel/kernel-noble

2) Set toolchain (omit CROSS_COMPILE if building on Thor)
export ARCH=arm64
export CROSS_COMPILE="$HOME/jp7/l4t-gcc/x-tools/aarch64-none-linux-gnu/bin/aarch64-none-linux-gnu-"

3) Configure use the defconfig you may have modified.
make tegra_defconfig

Add a local suffix so the image name shows “-tegra” etc.
export LOCALVERSION="-tegra"

4) Build + package .debs (outputs to the parent directory)
# KDEB_PKGVERSION lets you control the Debian pkg version string
make -j"$(nproc)" bindeb-pkg KDEB_PKGVERSION=38.2.0+thor1 KDEB_COMPRESS=zstd

You could then run following to examine the debs contents to ensure it is correct.

dpkg-deb -X packagename.deb .