[Need help] Trying to build L4T driver package (BSP) and rootfs from source:


I am trying to build the kernel and rootfs from source. (Why? To better understand how the OS, bootloader, rootfs and other components are put together. ). I started with the sample L4T BSP and rootfs sources here: https://developer.nvidia.com/embedded/linux-tegra

There are ample instructions for building the kernel as well as merging the custom built kernel w/ the rootfs image available at the same link above. However, I couldnt find instructions for building the entire BSP. When I untar the BSP sources from https://developer.nvidia.com/embedded/L4T/r32_Release_v4.2/Sources/T186/public_sources.tbz2 , I get a script file :

  • nv_public_src_build.sh

and a bunch of other packages including the kernel sources. Running the script and setting the appropriate env variables, I am able to successfully build atf, kernet, trusty, and u-boot. However the other packages are not built.


  1. Is there a way to build the entire BSP and supporting tools from source to essentially create the equivalent of the L4T BSP binary package at: https://developer.nvidia.com/embedded/L4T/r32_Release_v4.2/t186ref_release_aarch64/Tegra186_Linux_R32.4.2_aarch64.tbz2
    Or, are there proprietary blobs that will prevent building the full BSP from source?

  2. Is there a way to build the rootfs image from the source archive: https://developer.nvidia.com/embedded/L4T/r32_Release_v4.2/Sources/samplefs/ubuntu_bionic-l4t_aarch64_src.tbz2
    ? Inside that file, I couldn’t find any helper scripts to build the rootfs from scratch. I did find several posts here and on other sites to create a rootfs using Ubuntu repos, however, I couldnt find anything on building the rootfs from the nVidia sources. So - are there instructions/is it possible to build the rootfs image from nVidia sources?

Apologies if this question was asked / answered before: I tried to search the forum and google before posting - however, couldnt find anything specific to what I am trying to do.

Thanks in advance.

1 Like

hello acerbix,

you should also check BSP Customization chapter for the steps to build source packages.
please also share the failures messages for further supports.

As acerbix, I’m also interested in how to build the rootfs from the Sample Root Filesystem Sources to produce something equivalent to the Sample Root Filesystem. The BSP Customization chapter doesn’t seem to cover this. If you disagree, could you please clarify exactly which section is relevant?

This doesn’t seem to be documented anywhere online even for similar platforms, so there is some value in establishing the process here. Perhaps this is a simple procedure that every Linux developer is familiar with, but as a newbie the right search terms are not in my vocabulary.

I did come across this blog which mentions the NVidia sources but does not demonstrate use of them, instead focusing on building a custom rootfs.

Maybe I’m missing what you’re looking for but creating a root filesystem is outlined here in just a few steps…

Basically you untar the root filesystem tarball Tegra_Linux_Sample-Root-Filesystem_R32.4.2_aarch64.tbz2 into the rootfs directory then run apply_binaries.sh

Those instructions show how to use the sample root filesystem as supplied - not generated from sources.


BSP Customization did help w/ the custom kernel compile. I figured the Rootfs image is just a bunch of source packages without a script to build/generate the actual image.

@bryce.hillam I am (temporarily) abandoning the quest to build the rootfs from supplied sources - too much work. I dont think there is a magic search term you are missing - I have been using Linux since Slackware was the cool distro and I cant find these instructions either :)

The supplied sources are essentially just source packages of programs installed in the sample rootfs, and I couldnt find any build scripts that would actually build the rootfs from the supplied sources. I guess I could write some scripts to build the rootfs, but I’m not that motivated to do so:

  • since the sample rootfs is already provided - while I would have preferred to build my rootfs from scratch from sources - I can customize the supplied rootfs image if I need to. Not ideal, but livable
  • it will take some time to figure out inter-dependencies to build everything on the rootfs properly. The effort is not trivial. Take a look at Chapters 5/6 in the LFS book here for an idea: http://www.linuxfromscratch.org/lfs/view/stable/ - we would have to do something similar but would have to figure out the instructions ourselves. If you are interested in trying this out, I will be happy to volunteer to be a tester for your instructions.

I am currently focused on finishing up some AI related learning on the NX (The Getting started on Nano lessons that I am doing on my NX, as well as the jetson-inference project). After that, I plan on trying out a jetson container based approach to custom building the ketnel and rootfs based on https://github.com/idavis/jetson-containers - this is a repo from the author of the article that you linked and he seems to have a working approach that might be faster.

What Bryce/I are attempting to do is build the rootfs from source, rather than simply using he supplied sample rootfs. My reason for doing so is to better understand how the userland components for the Jetson are put together. However, as you can see in my reply earlier, I have - at least temporarily - stopped working on this, and am focusing on taking a different approach.

I think you are right that they are just a loose collection of sources not intended to be built. I had hoped to get my head around how the provided packages have been built for learning purposes, not out of necessity for a specific application. When the need arises I will have plenty of guides to refer to for generating a custom rootfs.