Jetson Xavier NX - custom root filesystem, error in apply_binaries.sh

Hi,

I’ve been trying to create my own root filesystem for Xavier NX, based on Ubuntu 20.04 LTS. I’ve used the base image from Ubuntu website. At the first time, there was a lot of errors for not having installed the required dependencies - I’ve gathered them based on the .deb packages in Linux_for_Tegra/nv_tegra directory and installed them in the image.

After that, I tried to run apply_binaries.sh on that image, but none of the packages has been installed, there’s an error with nvidia-l4t-init package, which supposedly conflicts with systemd. Whole script log:

Using rootfs directory of: /<PATH_TO_ROOTFS>/rootfs
Installing extlinux.conf into /boot/extlinux in target rootfs
/home/maciek/Nvidia/Linux_for_Tegra/nv_tegra/nv-apply-debs.sh
Root file system directory is /<PATH_TO_ROOTFS>/rootfs
Copying public debian packages to rootfs
Start L4T BSP package installation
QEMU binary is not available, looking for QEMU from host system
Found /usr/bin/qemu-aarch64-static
Installing QEMU binary in rootfs
/<PATH_TO_ROOTFS>/rootfs 
/<PATH_TO_ROOTFS>
Installing BSP Debian packages in /<PATH_TO_ROOTFS>/rootfs
Selecting previously unselected package nvidia-l4t-core.
(Reading database ... 24235 files and directories currently installed.)
Preparing to unpack .../nvidia-l4t-core_32.5.1-20210219084708_arm64.deb ...
Pre-installing... skip compatibility checking.
Unpacking nvidia-l4t-core (32.5.1-20210219084708) ...
Setting up nvidia-l4t-core (32.5.1-20210219084708) ...
Selecting previously unselected package jetson-gpio-common.
(Reading database ... 24283 files and directories currently installed.)
Preparing to unpack .../jetson-gpio-common_2.0.16_arm64.deb ...
Unpacking jetson-gpio-common (2.0.16) ...
Selecting previously unselected package python3-jetson-gpio.
Preparing to unpack .../python3-jetson-gpio_2.0.16_arm64.deb ...
Unpacking python3-jetson-gpio (2.0.16) ...
Selecting previously unselected package python-jetson-gpio.
Preparing to unpack .../python-jetson-gpio_2.0.16_arm64.deb ...
Unpacking python-jetson-gpio (2.0.16) ...
Selecting previously unselected package nvidia-l4t-3d-core.
Preparing to unpack .../nvidia-l4t-3d-core_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-3d-core (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-apt-source.
Preparing to unpack .../nvidia-l4t-apt-source_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-apt-source (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-camera.
Preparing to unpack .../nvidia-l4t-camera_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-camera (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-configs.
Preparing to unpack .../nvidia-l4t-configs_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-configs (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-cuda.
Preparing to unpack .../nvidia-l4t-cuda_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-cuda (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-firmware.
Preparing to unpack .../nvidia-l4t-firmware_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-firmware (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-graphics-demos.
Preparing to unpack .../nvidia-l4t-graphics-demos_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-graphics-demos (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-gstreamer.
Preparing to unpack .../nvidia-l4t-gstreamer_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-gstreamer (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-init.
Preparing to unpack .../nvidia-l4t-init_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-init (32.5.1-20210219084708) ...
dpkg: error processing archive /opt/nvidia/l4t-packages/userspace/nvidia-l4t-init_32.5.1-20210219084708_arm64.deb (--install):
 trying to overwrite '/etc/systemd/sleep.conf', which is also in package systemd 245.4-4ubuntu3.6
Selecting previously unselected package nvidia-l4t-initrd.
Preparing to unpack .../nvidia-l4t-initrd_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-initrd (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-jetson-io.
Preparing to unpack .../nvidia-l4t-jetson-io_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-jetson-io (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-multimedia.
Preparing to unpack .../nvidia-l4t-multimedia_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-multimedia (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-multimedia-utils.
Preparing to unpack .../nvidia-l4t-multimedia-utils_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-multimedia-utils (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-oem-config.
Preparing to unpack .../nvidia-l4t-oem-config_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-oem-config (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-tools.
Preparing to unpack .../nvidia-l4t-tools_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-tools (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-wayland.
Preparing to unpack .../nvidia-l4t-wayland_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-wayland (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-weston.
Preparing to unpack .../nvidia-l4t-weston_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-weston (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-x11.
Preparing to unpack .../nvidia-l4t-x11_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-x11 (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-xusb-firmware.
Preparing to unpack .../nvidia-l4t-xusb-firmware_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-xusb-firmware (32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-kernel.
Preparing to unpack .../nvidia-l4t-kernel_4.9.201-tegra-32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-kernel (4.9.201-tegra-32.5.1-20210219084708) ...

 Selecting previously unselected package nvidia-l4t-kernel-dtbs.
Preparing to unpack .../nvidia-l4t-kernel-dtbs_4.9.201-tegra-32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-kernel-dtbs (4.9.201-tegra-32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-kernel-headers.
Preparing to unpack .../nvidia-l4t-kernel-headers_4.9.201-tegra-32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-kernel-headers (4.9.201-tegra-32.5.1-20210219084708) ...
Selecting previously unselected package nvidia-l4t-bootloader.
Preparing to unpack .../nvidia-l4t-bootloader_32.5.1-20210219084708_arm64.deb ...
Unpacking nvidia-l4t-bootloader (32.5.1-20210219084708) ...
Setting up jetson-gpio-common (2.0.16) ...
Setting up python3-jetson-gpio (2.0.16) ...
Setting up python-jetson-gpio (2.0.16) ...
dpkg: dependency problems prevent configuration of nvidia-l4t-3d-core:
 nvidia-l4t-3d-core depends on nvidia-l4t-init (= 32.5.1-20210219084708); however:
  Package nvidia-l4t-init is not installed.

dpkg: error processing package nvidia-l4t-3d-core (--install):
 dependency problems - leaving unconfigured
Setting up nvidia-l4t-apt-source (32.5.1-20210219084708) ...
Pre-installing... skip changing source list.
Setting up nvidia-l4t-configs (32.5.1-20210219084708) ...
dpkg: dependency problems prevent configuration of nvidia-l4t-cuda:
 nvidia-l4t-cuda depends on nvidia-l4t-3d-core (= 32.5.1-20210219084708); however:
  Package nvidia-l4t-3d-core is not configured yet.

dpkg: error processing package nvidia-l4t-cuda (--install):
 dependency problems - leaving unconfigured
Setting up nvidia-l4t-firmware (32.5.1-20210219084708) ...
dpkg: dependency problems prevent configuration of nvidia-l4t-graphics-demos:
 nvidia-l4t-graphics-demos depends on nvidia-l4t-3d-core (= 32.5.1-20210219084708); however:
  Package nvidia-l4t-3d-core is not configured yet.

dpkg: error processing package nvidia-l4t-graphics-demos (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-l4t-gstreamer:
 nvidia-l4t-gstreamer depends on libasound2; however:
  Package libasound2 is not installed.
 nvidia-l4t-gstreamer depends on libgstreamer1.0-0; however:
  Package libgstreamer1.0-0 is not installed.
 nvidia-l4t-gstreamer depends on libgstreamer-plugins-bad1.0-0; however:
  Package libgstreamer-plugins-bad1.0-0 is not installed.
 nvidia-l4t-gstreamer depends on libgstreamer-plugins-base1.0-0; however:
  Package libgstreamer-plugins-base1.0-0 is not installed.
 nvidia-l4t-gstreamer depends on nvidia-l4t-cuda (= 32.5.1-20210219084708) | cuda-drivers; however:
  Package nvidia-l4t-cuda is not configured yet.
  Package cuda-drivers is not installed.

dpkg: error processing package nvidia-l4t-gstreamer (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-l4t-multimedia:
 nvidia-l4t-multimedia depends on libasound2; however:
  Package libasound2 is not installed.
 nvidia-l4t-multimedia depends on libgstreamer1.0-0; however:
  Package libgstreamer1.0-0 is not installed.
 nvidia-l4t-multimedia depends on libgstreamer-plugins-bad1.0-0; however:
  Package libgstreamer-plugins-bad1.0-0 is not installed.
 nvidia-l4t-multimedia depends on libgstreamer-plugins-base1.0-0; however:
  Package libgstreamer-plugins-base1.0-0 is not installed.
 nvidia-l4t-multimedia depends on nvidia-l4t-cuda (= 32.5.1-20210219084708) | cuda-drivers; however:
  Package nvidia-l4t-cuda is not configured yet.
  Package cuda-drivers is not installed.

dpkg: error processing package nvidia-l4t-multimedia (--install):
 dependency problems - leaving unconfigured
Setting up nvidia-l4t-multimedia-utils (32.5.1-20210219084708) ...
Setting up nvidia-l4t-oem-config (32.5.1-20210219084708) ...
Setting up nvidia-l4t-tools (32.5.1-20210219084708) ...
dpkg: dependency problems prevent configuration of nvidia-l4t-wayland:
 nvidia-l4t-wayland depends on libffi6; however:
  Package libffi6 is not installed.

dpkg: error processing package nvidia-l4t-wayland (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-l4t-weston:
 nvidia-l4t-weston depends on libevdev2; however:
  Package libevdev2 is not installed.
 nvidia-l4t-weston depends on libffi6; however:
  Package libffi6 is not installed.
 nvidia-l4t-weston depends on libinput10; however:
  Package libinput10 is not installed.
 nvidia-l4t-weston depends on libunwind8; however:
  Package libunwind8 is not installed.

dpkg: error processing package nvidia-l4t-weston (--install):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nvidia-l4t-x11:
 nvidia-l4t-x11 depends on nvidia-l4t-init (= 32.5.1-20210219084708); however:
  Package nvidia-l4t-init is not installed.

dpkg: error processing package nvidia-l4t-x11 (--install):
 dependency problems - leaving unconfigured
Setting up nvidia-l4t-xusb-firmware (32.5.1-20210219084708) ...
Pre-installing xusb firmware package, skip flashing
Setting up nvidia-l4t-kernel (4.9.201-tegra-32.5.1-20210219084708) ...
/var/lib/dpkg/info/nvidia-l4t-kernel.postinst: line 52: depmod: command not found
Using the existing boot entry 'primary'
Pre-installing kernel package, skip flashing
Setting up nvidia-l4t-kernel-dtbs (4.9.201-tegra-32.5.1-20210219084708) ...
Setting up nvidia-l4t-kernel-headers (4.9.201-tegra-32.5.1-20210219084708) ...
Setting up nvidia-l4t-bootloader (32.5.1-20210219084708) ...
Pre-installing bootloader package, skip flashing
dpkg: dependency problems prevent configuration of nvidia-l4t-camera:
 nvidia-l4t-camera depends on nvidia-l4t-cuda (= 32.5.1-20210219084708) | cuda-drivers; however:
  Package nvidia-l4t-cuda is not configured yet.
  Package cuda-drivers is not installed.
 nvidia-l4t-camera depends on nvidia-l4t-multimedia (= 32.5.1-20210219084708); however:
  Package nvidia-l4t-multimedia is not configured yet.

dpkg: error processing package nvidia-l4t-camera (--install):
 dependency problems - leaving unconfigured
Setting up nvidia-l4t-initrd (32.5.1-20210219084708) ...
Setting up nvidia-l4t-jetson-io (32.5.1-20210219084708) ...
Processing triggers for nvidia-l4t-kernel (4.9.201-tegra-32.5.1-20210219084708) ...
Errors were encountered while processing:
 /opt/nvidia/l4t-packages/userspace/nvidia-l4t-init_32.5.1-20210219084708_arm64.deb
 nvidia-l4t-3d-core
 nvidia-l4t-cuda
 nvidia-l4t-graphics-demos
 nvidia-l4t-gstreamer
 nvidia-l4t-multimedia
 nvidia-l4t-wayland
 nvidia-l4t-weston
 nvidia-l4t-x11
 nvidia-l4t-camera

I can’t fix the errors, I’m not sure what I’m doing wrong with the installation, so I’ve decided to create a new topic, since I can’t find anything like that on this forum.

Thanks for help!

There are probably a lot of things going on, but the first dependency failure is the above where you lack “nvidia-l4t-init”. You should try manually installing that package and then running again. I do not know what part of the script is determining to run without that being installed first, I simply don’t know enough about the newer apply_binaries.sh, but installing that package first seems mandatory.

apply_binaries.sh is used to install nvidia-l4t-init, and it failed due to the conflict with systemd, so I couldn’t install it, even manually. As a workaround, I managed to remove conflicting /etc/systemd/sleep.conf from nvidia-l4t-init.deb package (I’ve regenerated the package) and succeeded in installing the required packages. Also, when using Ubuntu 20.04 LTS as a base image, libffi6 package is not available in 20.04 sources, therefore you have to manually download it from the sources for Ubuntu 18.04. I know that messing with the packages content is not the best thing to do in production environment, but sleep.conf is responsible only for hibernating the system, what I do not want to happen, so it should cause any problems with the prepared OS.