Repackaging all kernel modifications into Debian packages

Hi Everyone,

We are making quite a few changes to the kernel for our custom board, both adding drivers as kernel modules, configuration changes, and some small patches. We are already using this in the massflash bundle that our manufacture flashes on our boards. What we need is to be able to update the kernel in the field without a flash.

We want to be able to deploy these as updates in the form of .deb packages. I know there is bindeb-pkg that some people have seemed to get working. I was able to build a .deb with bindeb-pkg as well but it is missing the control files, the dtb files, and the Image file itself. Even so, when we try and install it on a running Jetson it conflicts with the currently installed nvidia-l4t-kernel packages.

I read on the forums about the nvdebrepack.sh script. This seems to be the right path, however the examples I see in the README do not mention the Device Tree binaries or the kernel modules. We are trying to repack everything to pick up all customizations.

Before I go doing a bunch of trial and error work to figure out how do do this myself, does anyone have examples of this being used to repack all kernel changes into new Debian packages? It feels like something that would have been solved by someone already.

I’m not able to answer, my past experience is with Fedora .rpm files. I do find the question interesting though, so I looked at the control file on an NX, and noticed something you might find useful (the NX has not been updated in some time, packages will differ from Nano, and won’t be up to date on the NX, but it will be very similar):

# dpkg -S /boot/Image
nvidia-l4t-kernel: /boot/Image
# apt show -a nvidia-l4t-kernel
Package: nvidia-l4t-kernel
Version: 4.9.140-tegra-32.4.4-20201027211332
Priority: standard
Section: kernel
Maintainer: NVIDIA Corporation
Installed-Size: 113 MB
Pre-Depends: nvidia-l4t-core (>> 32.4-0), nvidia-l4t-core (<< 32.5-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 29.0 MB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Kernel Package

Package: nvidia-l4t-kernel
Version: 4.9.140-tegra-32.4.4-20201016123640
Priority: standard
Section: kernel
Maintainer: NVIDIA Corporation
Installed-Size: 113 MB
Pre-Depends: nvidia-l4t-core (>> 32.4-0), nvidia-l4t-core (<< 32.5-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 29.0 MB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Kernel Package

Package: nvidia-l4t-kernel
Version: 4.9.140-tegra-32.4.3-20200924161919
Priority: standard
Section: kernel
Maintainer: NVIDIA Corporation
Installed-Size: 102 MB
Pre-Depends: nvidia-l4t-core (>> 32.4-0), nvidia-l4t-core (<< 32.5-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 26.7 MB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Kernel Package

Package: nvidia-l4t-kernel
Version: 4.9.140-tegra-32.4.3-20200625213407
Priority: standard
Section: kernel
Maintainer: NVIDIA Corporation
Installed-Size: 102 MB
Pre-Depends: nvidia-l4t-core (>> 32.4-0), nvidia-l4t-core (<< 32.5-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 26.7 MB
APT-Manual-Installed: yes
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Kernel Package

Package: nvidia-l4t-kernel
Version: 4.9.140-tegra-32.4.2-20200428141701
Priority: standard
Section: kernel
Maintainer: NVIDIA Corporation
Installed-Size: 102 MB
Pre-Depends: nvidia-l4t-core (>> 32.4-0), nvidia-l4t-core (<< 32.5-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 26.7 MB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Kernel Package

Package: nvidia-l4t-kernel
Version: 4.9.140-tegra-32.4.2-20200408182620
Priority: standard
Section: kernel
Maintainer: NVIDIA Corporation
Installed-Size: 102 MB
Pre-Depends: nvidia-l4t-core (>> 32.4-0), nvidia-l4t-core (<< 32.5-0)
Homepage: http://developer.nvidia.com/jetson
Download-Size: 26.7 MB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Kernel Package
# apt show -a nvidia-l4t-core
Package: nvidia-l4t-core
Version: 32.4.4-20201016123640
Priority: standard
Section: libs
Maintainer: NVIDIA Corporation
Installed-Size: 7,577 kB
Depends: libc6, libegl1, libexpat1, libgcc1, libstdc++6
Conflicts: nvidia-l4t-ccp-t186ref
Replaces: nvidia-l4t-ccp-t186ref
Homepage: http://developer.nvidia.com/jetson
Download-Size: 2,717 kB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Core Package

Package: nvidia-l4t-core
Version: 32.4.3-20200625213407
Priority: standard
Section: libs
Maintainer: NVIDIA Corporation
Installed-Size: 7,577 kB
Depends: libc6, libegl1, libexpat1, libgcc1, libstdc++6
Conflicts: nvidia-l4t-ccp-t186ref
Replaces: nvidia-l4t-ccp-t186ref
Homepage: http://developer.nvidia.com/jetson
Download-Size: 2,723 kB
APT-Manual-Installed: yes
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Core Package

Package: nvidia-l4t-core
Version: 32.4.2-20200408182620
Priority: standard
Section: libs
Maintainer: NVIDIA Corporation
Installed-Size: 7,577 kB
Depends: libc6, libegl1, libexpat1, libgcc1, libstdc++6
Conflicts: nvidia-l4t-ccp-t186ref
Replaces: nvidia-l4t-ccp-t186ref
Homepage: http://developer.nvidia.com/jetson
Download-Size: 2,735 kB
APT-Sources: https://repo.download.nvidia.com/jetson/t194 r32.4/main arm64 Packages
Description: NVIDIA Core Package

In particular, note that I found the package owning “/boot/Image” via “dpkg -S /boot/Image”. Then I looked at the control file (a series since Image has had updates) with “apt show -a nvidia-l4t-kernel”. Following this I found the dependency at the top of the chain, which was “nvidia-l4t-core” (and thus “apt show -a nvidia-l4t-core”).

As a theme, look at the ones which supersede another version, such as this line in a control file:

Conflicts: nvidia-l4t-ccp-t186ref
Replaces: nvidia-l4t-ccp-t186ref

I’m thinking perhaps if you install a replacement “.deb” for both “nvidia-l4t-kernelandnvidia-l4t-coresimultaneously, using a pair of “.deb” files set to replace and conflict with the originals (and likely using a new name, e.g., “jjsalzano-l4t-core” and “jjsalzano-l4t-kernel”), then it might allow the replacement (I would have any preinstall script create a backup of the original Image and tree and an entry into “extlinux.conf” to the backup). Keep in mind that you might find a chain of dependencies which in turn depend on the “nvidia-l4t-kernel” (I’m not done this before, sorry, don’t know), and it might end up being an entire chain of dependencies. However, it doesn’t mean you couldn’t make exact duplicates of those other packages with nothing more changed than to name your version of the kernel package as the “Depends:” line of the control file.

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