# Cross-compiling a kernel module

**URL:** <https://forums.developer.nvidia.com/t/cross-compiling-a-kernel-module/369283>\
**Category:** Jetson Orin Nano\
**Tags:** compile, kernel\
**Created:** [May 7, 2026, 9:09am UTC](https://forums.developer.nvidia.com/t/cross-compiling-a-kernel-module/369283 "2026-05-07T09:09:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nicolau2](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@nicolau2](https://forums.developer.nvidia.com/u/nicolau2)\
**Post date:** [May 7, 2026, 9:09am UTC](https://forums.developer.nvidia.com/t/cross-compiling-a-kernel-module/369283/1 "2026-05-07T09:09:10Z")

</div>

I’m working with a Jetson Orin Nano and I would like to use a kernel module that is not available in Jetson Linux r36.5. I would like to build it from the sources, preferably with cross-compilation. I’m finding the manual a bit hard to follow, though: [Kernel Customization — NVIDIA Jetson Linux Developer Guide](https://docs.nvidia.com/jetson/archives/r36.5/DeveloperGuide/SD/Kernel/KernelCustomization.html)

Where can I find this `source_sync.sh` script? Is it something I can just run stand-alone or does it need to be ran inside a file tree?

Where is the git repo?

What exactly should I download from [Jetson Linux Release 36.5 | NVIDIA Developer](https://developer.nvidia.com/embedded/jetson-linux-r365) ? The BSP, the root filesystem or both?

I also see that in [Jetson Download Center | NVIDIA Developer](https://developer.nvidia.com/embedded/downloads#?search=jetson%20linux) maybe 36.5 is not available yet? And is it really the “driver package” that I should get? Pardon if I find the name a bit confusing.

To clarify, I’m only trying to build a “in-tree” module, hopefully the simplest of kernel-related tasks, I appreciate any help. I tried to follow instructions on the PC (with cross compilation), and now on the Jetson itself. I believe I have the source code, but how do I obtain the “.config”? The documentation says “follow those steps to get the `.config`” but it doesn’t seem effective. Can I just use `/proc/config.gz`?

---

<div class="post-metadata">

**Author:** ![ShaneCCC](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/shaneccc/32/14043_2.png) [@ShaneCCC](https://forums.developer.nvidia.com/u/ShaneCCC)\
**Post date:** [May 8, 2026, 3:00am UTC](https://forums.developer.nvidia.com/t/cross-compiling-a-kernel-module/369283/4 "2026-05-08T03:00:49Z")

</div>

The source\_sync.sh can get by sdkmanager.

If you are using sdkmanager to flash the device. It should generate and save in the host.

And you can download the source from below link.

> **[NVIDIA Jetson Linux Release 36.5](https://developer.nvidia.com/embedded/jetson-linux-r365)**
>
> Get the latest Jetson Linux release now.

---

<div class="post-metadata">

**Author:** ![kimberly.carvajal](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/kimberly.carvajal/32/333825_2.png) [@kimberly.carvajal](https://forums.developer.nvidia.com/u/kimberly.carvajal)\
**Post date:** [May 22, 2026, 6:50pm UTC](https://forums.developer.nvidia.com/t/cross-compiling-a-kernel-module/369283/7 "2026-05-22T18:50:24Z")

</div>

Hi @nicolau2

You can download the sources either using source\_sync.sh or manually.

- **Using source\_sync.sh**

You can find source\_sync.sh in the `Linux_for_Tegra/source` folder.

Run the following commands to download the Jetson Linux r36.5 sources:

```auto
cd Linux_for_Tegra/source
./source_sync.sh -t jetson_36.5

```

This command will download the sources into the source folder.

- **Manual download**

You can dowloand the Drvier Package (BSP) sources from [Jetson Linux Release 36.5 | NVIDIA Developer](https://developer.nvidia.com/embedded/jetson-linux-r365) Jetson Linux release r36.5 archive

Run the following commands to extract the sources:

```auto
wget https://developer.nvidia.com/downloads/embedded/l4t/r36_release_v5.0/sources/public_sources.tbz2
tar -xjf public_sources.tbz2 Linux_for_Tegra/source/kernel_src.tbz2 --strip-components 2
tar -xjf public_sources.tbz2 Linux_for_Tegra/source/kernel_oot_modules_src.tbz2 --strip-components 2
tar -xjf public_sources.tbz2 Linux_for_Tegra/source/nvidia_kernel_display_driver_source.tbz2 --strip-components 2

```

Create a sources directory inside Linux\_for\_Tegra, then extract the kernel and NVIDIA out-of-tree module sources into it:

```auto
cd 
mkdir Linux_for_Tegra/sources
tar -xjf kernel_src.tbz2 -C Linux_for_Tegra/sources
tar -xjf kernel_oot_modules_src.tbz2 -C Linux_for_Tegra/sources
tar -xjf nvidia_kernel_display_driver_source.tbz2 -C Linux_for_Tegra/sources

```

With the sources extracted, you can follow these instructions to compile: [JetPack 6 Compiling Source Code - RidgeRun Developer Wiki](https://developer.ridgerun.com/wiki/index.php/JetPack_6_Compiling_Source_Code#Kernel_build_instructions)  
And these instructions to flash the board from the command line: [NVIDIA JetPack 6 Flashing the Board from Cmdline](https://developer.ridgerun.com/wiki/index.php/NVIDIA_JetPack_6_Flashing_the_Board_from_Cmdline)

Regards,

Kimberly Carvajal  
Embedded SW Engineer at RidgeRun  
Contact us: [support@ridgerun.com](mailto:support@ridgerun.com)  
Developers wiki: [https://developer.ridgerun.com/](https://developer.ridgerun.com/)  
Website: [www.ridgerun.com](http://www.ridgerun.com/)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [June 5, 2026, 6:51pm UTC](https://forums.developer.nvidia.com/t/cross-compiling-a-kernel-module/369283/8 "2026-06-05T18:51:20Z")

</div>

Closed on June 5, 2026, 6:51pm UTC

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