Dir:<my_pc>/Linux_for_Tegra/kernel
dpkg -x nvidia-l4t-kernel_4.9.140-tegra-32.4.3-20200625213407_arm64.deb origin
dpkg -e nvidia-l4t-kernel_4.9.140-tegra-32.4.3-20200625213407_arm64.deb origin/debian
mkdir -p repack/debian
vi repack/debian/rules
content:
#!/usr/bin/make -f
.PHONY: binary
clean:
dh clean
binary:
dh binary
build:
override_dh_strip:
override_dh_shlibdeps:
Open control in a text editor and add these lines; save the file.
Source: nvidia-l4t-kernel
Section: kernel
Priority: standard
Maintainer: NVIDIA Corporation
Build-Depends: debhelper (>=9)
Standards-Version: 3.9.6
Homepage: http://developer.nvidia.com/jetson
Package: nvidia-l4t-kernel
Architecture: arm64
Pre-Depends: nvidia-l4t-core (>> 32.4-0), nvidia-l4t-core (<< 32.5-0)
Depends:
Recommends:
Description: NVIDIA Kernel Package
Copy these files from the original nvidia-l4t-kernel package to debian:
•postinst
•triggers
•copyright
Extract changelog from its archive:
$ gunzip -c origin/usr/share/doc/nvidia-l4t-kernel/changelog.Debian.gz > repack/debian/changelog
Open the change log in a text editor. Find the version number and change it, change the version to:20210203172607
Open install in a text editor. Add the following line, which specifies the location where files are to be installed, then save the file:
debian/out/* /
Open compat and replace its contents with the single digit ‘9’; save the file.
Open source/format in a text editor and add the following line; save the file.
3.0 (native)
To install the files needed to build the kernel Debian package in debian/out/, enter the command:
$ mkdir -p repack/debian/out/
cp -r origin/boot repack/
cp -r origin/lib repack/
Copy the kernel license file from the original Debian package:
$ mkdir -p repack/debian/out/usr/share/doc/nvidia-l4t-kernel/
$ gunzip -c origin/usr/share/doc/nvidia-l4t-kernel/LICENSE.kernel.gz > repack/debian/out/usr/share/doc/nvidia-l4t-kernel/LICENSE.kernel
Enter these commands to build the package:
cd repack
CC=aarch64-linux-gnu-gcc dpkg-buildpackage -uc -b -d -a arm64
There will be the above warning during the compilation process, and then a new deb file is generated,
dpkg-deb: building package 'nvidia-l4t-kernel' in '../nvidia-l4t-kernel_4.9.140-tegra-32.4.3-
20210203172607_arm64.deb'.
dpkg-genbuildinfo --build=binary
dpkg-genchanges --build=binary >../nvidia-l4t-kernel_4.9.140-tegra-32.4.3-20210203172607_arm64.changes
dpkg-genchanges: info: binary-only upload (no source code included)
dpkg-source --after-build repack
dpkg-buildpackage: info: binary-only upload (no source included)
I copy it to the jetson device, and there will be the above warning during the installation process.
depmod:WARNING: could not open /lib/modules/4.9.140-tegra/modules.order: No such file or directory
depmod:WARNING: could not open /lib/modules/4.9.140-tegra/modules.builtin: No such file or directory
After the installation is complete, reboot, but can not start normally, and leave it at the nvidia icon.