Skip to content

Conversation

@remibettan
Copy link
Contributor

@remibettan remibettan commented Nov 13, 2025

Without this PR, uvcvideo module that is compiled during the script is copied to:
/lib/modules/$(uname -r)/kernel/drivers/media/usb/uvc/

And when using our scripts for jetson d4xx drivers, the uvcvideo is copied to:
/lib/modules/$(uname -r)/updates
(ref: https://github.com/IntelRealSense/realsense_mipi_platform_driver/blob/838616396a43d4f5c9118c6ad23fc3a9ea015872/README_JP5.md?plain=1#L131)

When the OS sees that the module is in this folder, it does not consider the module in the "standard" folder.

So the script now checks first where is the uvcvideo module used by the system, and then copies the compiled module in the right place.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the uvcvideo kernel module installation path for Jetson devices by ensuring the compiled module is placed where the system actually loads it from. The script now dynamically detects the current uvcvideo module location instead of assuming a fixed path, preventing conflicts when the module exists in the /updates directory.

Key Changes:

  • Dynamically determine uvcvideo module path using modinfo before installation
  • Reorganize kernel build preparation to occur after patch application
  • Remove hardcoded module path assumptions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

#1. Prepares kernel headers for building external modules
#2. Generates Module.symvers if it doesn’t already exist.
LOCALVERSION='-tegra'
make ARCH=arm64 prepare modules_prepare LOCALVERSION='' -j$(($(nproc)-1))
Copy link

@Kontra2B Kontra2B Nov 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assign ${LOCALVERSION} to LOCALVERSION or remove the empty assignment

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks - forgot it

Copy link

@Kontra2B Kontra2B left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@remibettan remibettan requested a review from Kontra2B November 13, 2025 11:34
LINUX_HEADERS_NAME="linux-headers-${kernel_ver}-ubuntu24.04_aarch64"
fi

export KBUILD_EXTRA_SYMBOLS="/lib/modules/${kernel_ver}/build/Module.symvers"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does
LINUX_HEADERS_NAME
and
KBUILD_EXTRA_SYMBOLS removed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to CoPilot:

Setting these variables makes sure your script:

References the right kernel headers for Ubuntu 22.04 ARM64.
Reuses existing symbol version information (Module.symvers) during external module builds to maintain compatibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LINUX_HEADERS_NAME not used - it was used by a code that has been removed in previous PR #14276 - so only removed dead code here
KBUILD_EXTRA_SYMBOLS - only moved to be initialized right before its use - see further in the script.

@remibettan remibettan requested review from Nir-Az and Copilot November 13, 2025 12:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

remibettan and others added 2 commits November 13, 2025 14:56
@remibettan remibettan requested a review from Copilot November 13, 2025 13:04
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <[email protected]>
@Nir-Az Nir-Az merged commit 1feabac into realsenseai:development Nov 13, 2025
25 of 26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants