How can I change the OTA of the same version?

Hi all:
References are as follows:
https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/SoftwarePackagesAndTheUpdateMechanism.html?highlight=ota_tools

I am using the JP5.1.2 baseline version. The current version is also based on JP5.1.2, but the kernel, config, and ko have all changed. I also need to add ko and delete ko. Can I use the following OTA method to perform OTA operations?

The generated file is 318M in total, which is less than 2G. Is this wrong? Please help me find out what the problem is?

w@w:~/mon/L4T-public-source $ cd out/
w@w:~/mon/L4T-public-source/out $ tar xf ota_tools_R35.4.1_aarch64.tbz2
w@w:~/mon/L4T-public-source/out $ export BASE_BSP=/home/w/mon/L4T-public-source/out/Linux_for_Tegra
w@w:~/mon/L4T-public-source/out $ export TARGET_BSP=/home/w/mon/L4T-public-source/out/Linux_for_Tegra
w@w:~/mon/L4T-public-source/out $ cd ${TARGET_BSP}
w@w:~/mon/L4T-public-source/out/Linux_for_Tegra $ sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -f --external-device nvme0n1 -b jetson-orin-nano-devkit R35-4

SUCCESS: generate OTA package for update without layout change "/home/w/mon/L4T-public-source/out/Linux_for_Tegra/bootloader/jetson-orin-nano-devkit/ota_payload_package.tar.gz"

w@w:~/mon/L4T-public-source/out/Linux_for_Tegra $ ls -lh /home/w/mon/L4T-public-source/out/Linux_for_Tegra/bootloader/jetson-orin-nano-devkit/ota_payload_package.tar.gz
-rw-r--r-- 1 root root 318M 12月  4 15:52 /home/w/mon/L4T-public-source/out/Linux_for_Tegra/bootloader/jetson-orin-nano-devkit/ota_payload_package.tar.gz
w@w:~/mon/L4T-public-source/out/Linux_for_Tegra (cam-system-lsdiag)$

log-ota.txt (622.8 KB)

Sorry, it’s because I didn’t specify the parameters.
The following can generate a relatively large OTA file.

sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -r --external-device nvme0n1 jetson-orin-nano-devkit R35-4
......
w@w:~/mon/L4T-public-source/out/Linux_for_Tegra $ ls -l /home/w/mon/L4T-public-source/out/Linux_for_Tegra/bootloader/jetson-orin-nano-devkit/ota_payload_package.tar.gz -lh
-rw-r--r-- 1 root root 5.7G 12月  4 22:00 /home/w/mon/L4T-public-source/out/Linux_for_Tegra/bootloader/jetson-orin-nano-devkit/ota_payload_package.tar.gz

My disk partitions are as follows:

robot@tegra:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/nvme0n1p1  938G   26G  874G   3% /
none            7.5G     0  7.5G   0% /dev
tmpfs           7.6G   12K  7.6G   1% /dev/shm
tmpfs           1.6G  155M  1.4G  10% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           7.6G     0  7.6G   0% /sys/fs/cgroup
tmpfs           1.6G  8.0K  1.6G   1% /run/user/1000

If I perform an OTA action, will the existing files under the / directory be lost? For example, the current configuration file is stored in the /etc directory. This is configured by the user later. It is not included in the image by default.

Hi,

Please refer to this section to Restoring Files you want to keep.

Thanks

Hi, DavidDDD:
Is there any way to keep the deb packages I have installed in the file system?

Hi,

You could use dpkg -L <package name> to find the path.

Thanks

Hi, DavidDDD:
I think that by upgrading the following software package, you can also realize the kernel’s OTA bar? I’m re-installing a customized version, which includes our custom code and image modification.
That’s okay too?
The kernel and dtb have already been compiled and passed.
However, how to generate the following document package, we have guidance document?

nvidia-l4t-display-kernel_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
nvidia-l4t-kernel_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
nvidia-l4t-kernel-dtbs_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
nvidia-l4t-kernel-headers_5.10.120-tegra-35.4.1-20230801124926_arm64.deb

Hi wxsrite

I believe this doc could be useful to you.

Which script of the above packages are made from, you know?

Hi DavidDDD:
We developed based on JP5.1.2 and the device has been running for nearly 1 year.

We want to upgrade to the latest version of JP5.1.2 by the deb package.

I noticed that the main kernel files of our system are put in the following four files. Can I package the current compiled kernel version into us, and then upgrade the kernel directly to the latest state through the deb package.

nvidia-l4t-display-kernel_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
nvidia-l4t-kernel_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
nvidia-l4t-kernel-dtbs_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
nvidia-l4t-kernel-headers_5.10.120-tegra-35.4.1-20230801124926_arm64.deb

Due to the modification of config, ko, dts, cannot replace a single file, need to replace all the current kernel-related files.

Hi,

Sorry for the late response.

  1. unpack the .deb you mentioned .
  2. Apply your custom changes
  3. using nvdebrepack.sh to repack the deb mentioned in this doc

Thanks

$ ./nvdebrepack.sh -h
Usage: nvdebrepack.sh [-d <pkg>=<ver>,...] [-f <file>] [-h] [-i <src>:<dst>[:<perm>]] [-m <msg>]
                  [-n <maintainer>] [-v <ver>] package.deb

  -d update the version number of a particular dependent package. The version number is specified
     in the format <pkg>=<version>. Multiple packages can be specified with commas.
  -f specify an injection file. Each line in the file represents a regular file to be injected and
     should comply with the format: <source>:<destination>[:<permission>]. File permission must be
     specified for a new file.
  -h show this help.
  -i specify a particular file to be injected. The file must be specified in the format mentioned
     in '-f' otpion. Multiple files can be specified with multiple '-i' options.
  -m specify a comment line to be added in the changelog. The default is "Custom version.".
  -n specify maintainer info in the format: "full name <email-address>". This option is mandatory.
  -v specify a custom version string. The string will be appended to the L4T package version
     with a "+". The default is "default0".

Hi DavidDDD:
I modified the Image, kernel tega_config, and added d4xx.ko, so how do I use this script?
If tega_config is modified, it will affect many kos, but I can’t be sure which ones are affected.

Hi wxsrite,

Please refer to Linux_for_Tegra/tools/Debian/nvdebrepack.txt
example.

If not meet your requirement, could you describe more in detail?
Please provide file path that your update or add in Linux_for_Tegra

some question to confirm
You mentioned tegra_config is the
Linux_for_Tegra/source/kernel/kernel-jammy-src/arch/arm/configs/tegra_defconfig?

Thanks

version:
JP5.1.2

device:
Orin NX

config:
kernel/kernel-5.10/arch/arm64/configs/tegra_defconfig

For example:

w@w:~/mon/L4T-public-source/out/Linux_for_Tegra $ pwd
/home/w/mon/L4T-public-source/out/Linux_for_Tegra

The following are newly added ko:

w@w:~/mon/L4T-public-source/out/Linux_for_Tegra/tools/Debian $ sudo find ../../../ -name d4xx.ko
../../../Linux_for_Tegra/rootfs/usr/lib/modules/5.10.120-tegra/kernel/drivers/media/i2c/d4xx.ko
../../../kernel_output/drivers/media/i2c/d4xx.ko

The following ko are modified:

w@w:~/mon/L4T-public-source/out/Linux_for_Tegra/tools/Debian $ sudo find ../../../ -name can.ko
../../../Linux_for_Tegra/rootfs/usr/lib/modules/5.10.120-tegra/kernel/net/can/can.ko
../../../kernel_output/net/can/can.ko

The following ko are deleted:

w@w:~/mon/L4T-public-source/out/Linux_for_Tegra/tools/Debian $ sudo find ../../../ -name i2c-i801.ko
../../../Linux_for_Tegra/rootfs/usr/lib/modules/5.10.120-tegra/kernel/drivers/i2c/busses/i2c-i801.ko
../../../kernel_output/drivers/i2c/busses/i2c-i801.ko

The following are modified kernel:

w@w:~/mon/L4T-public-source/out/Linux_for_Tegra/tools/Debian $ sudo find ../../../ -name Image
../../../Linux_for_Tegra/kernel/Image
../../../Linux_for_Tegra/rootfs/boot/Image
../../../kernel_output/arch/arm64/boot/Image

The following dts are also modified:

w@w:~/mon/L4T-public-source/out/Linux_for_Tegra/tools/Debian $ sudo find ../../../ -name tegra234-p3767-0000-p3768-0000-a0.dtb
../../../Linux_for_Tegra/kernel/dtb/tegra234-p3767-0000-p3768-0000-a0.dtb
../../../Linux_for_Tegra/bootloader/tegra234-p3767-0000-p3768-0000-a0.dtb
../../../Linux_for_Tegra/rootfs/boot/tegra234-p3767-0000-p3768-0000-a0.dtb
../../../kernel_output/arch/arm64/boot/dts/nvidia/tegra234-p3767-0000-p3768-0000-a0.dtb

Hi DavidDDD:
What command should I use to repackage?

Hi,

You could refer blow example:

  1. unpack the deb
pwd
#Linux_for_Tegra/kernel
ls *.deb 
#nvidia-l4t-display-kernel_5.10.120-tegra-35.4.1-20230801124926_arm64.deb  
#nvidia-l4t-kernel-dtbs_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
#nvidia-l4t-kernel_5.10.120-tegra-35.4.1-20230801124926_arm64.deb          
#nvidia-l4t-kernel-headers_5.10.120-tegra-35.4.1-20230801124926_arm64.deb
dpkg-deb -R ./nvidia-l4t-kernel_5.10.120-tegra-35.4.1-20230801124926_arm64.deb ${NewDirectoryName}
  1. do some modification
# add new d4xx.ko
cp d4xx.ko ./${NewDirectoryName}/lib/modules/5.10.120-tegra/kernel/drivers/i2c/
  1. repack the deb
fakeroot dpkg -b ./${NewDirectoryName} ${NewDebianName}.deb

Thanks